* [PATCH] net: phy-micrel: remove redundant initialization of pointer of_node
@ 2018-02-05 12:47 Colin King
2018-02-05 15:11 ` Andrew Lunn
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-02-05 12:47 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, netdev; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Pointer of_node is initialized with a value that is never read, of_node
is later updated with a new value instead, hence the initialization is
redundant and can be removed. Also remove unused pointer dev and
remove an empty line.
Cleans up clang warnings:
drivers/net/phy/micrel.c:393:28: warning: Value stored to 'of_node'
during its initialization is never read
drivers/net/phy/micrel.c:532:28: warning: Value stored to 'of_node'
during its initialization is never read
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/phy/micrel.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 0f45310300f6..a86ecccde924 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -389,8 +389,7 @@ static int ksz9021_load_values_from_of(struct phy_device *phydev,
static int ksz9021_config_init(struct phy_device *phydev)
{
- const struct device *dev = &phydev->mdio.dev;
- const struct device_node *of_node = dev->of_node;
+ const struct device_node *of_node;
const struct device *dev_walker;
/* The Micrel driver has a deprecated option to place phy OF
@@ -401,7 +400,6 @@ static int ksz9021_config_init(struct phy_device *phydev)
do {
of_node = dev_walker->of_node;
dev_walker = dev_walker->parent;
-
} while (!of_node && dev_walker);
if (of_node) {
@@ -528,8 +526,7 @@ static int ksz9031_enable_edpd(struct phy_device *phydev)
static int ksz9031_config_init(struct phy_device *phydev)
{
- const struct device *dev = &phydev->mdio.dev;
- const struct device_node *of_node = dev->of_node;
+ const struct device_node *of_node;
static const char *clk_skews[2] = {"rxc-skew-ps", "txc-skew-ps"};
static const char *rx_data_skews[4] = {
"rxd0-skew-ps", "rxd1-skew-ps",
--
2.15.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: phy-micrel: remove redundant initialization of pointer of_node
2018-02-05 12:47 [PATCH] net: phy-micrel: remove redundant initialization of pointer of_node Colin King
@ 2018-02-05 15:11 ` Andrew Lunn
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2018-02-05 15:11 UTC (permalink / raw)
To: Colin King; +Cc: Florian Fainelli, netdev, kernel-janitors, linux-kernel
On Mon, Feb 05, 2018 at 12:47:59PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Pointer of_node is initialized with a value that is never read, of_node
> is later updated with a new value instead, hence the initialization is
> redundant and can be removed. Also remove unused pointer dev and
> remove an empty line.
>
> Cleans up clang warnings:
> drivers/net/phy/micrel.c:393:28: warning: Value stored to 'of_node'
> during its initialization is never read
> drivers/net/phy/micrel.c:532:28: warning: Value stored to 'of_node'
> during its initialization is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Hi Colin
You probably need to repost once netdev re-opens.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-02-05 15:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-05 12:47 [PATCH] net: phy-micrel: remove redundant initialization of pointer of_node Colin King
2018-02-05 15:11 ` Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).