* [PATCH] net: phy: micrel: remove redundant assignment to pointer of_node
@ 2021-06-13 13:27 Colin King
2021-06-13 16:37 ` Andrew Lunn
2021-06-14 19:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Colin King @ 2021-06-13 13:27 UTC (permalink / raw
To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller,
Jakub Kicinski, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The pointer of_node is being initialized with a value that is never
read and it is being updated later with a new value inside a do-while
loop. The initialization is redundant and can be removed and the
pointer dev is no longer required and can be removed too.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/phy/micrel.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index a14a00328fa3..93cf9500728f 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -488,8 +488,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
@@ -711,8 +710,7 @@ static int ksz9031_config_rgmii_delay(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",
@@ -907,8 +905,7 @@ static int ksz9131_config_rgmii_delay(struct phy_device *phydev)
static int ksz9131_config_init(struct phy_device *phydev)
{
- const struct device *dev = &phydev->mdio.dev;
- struct device_node *of_node = dev->of_node;
+ struct device_node *of_node;
char *clk_skews[2] = {"rxc-skew-psec", "txc-skew-psec"};
char *rx_data_skews[4] = {
"rxd0-skew-psec", "rxd1-skew-psec",
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: phy: micrel: remove redundant assignment to pointer of_node
2021-06-13 13:27 [PATCH] net: phy: micrel: remove redundant assignment to pointer of_node Colin King
@ 2021-06-13 16:37 ` Andrew Lunn
2021-06-14 19:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2021-06-13 16:37 UTC (permalink / raw
To: Colin King
Cc: Heiner Kallweit, Russell King, David S . Miller, Jakub Kicinski,
netdev, kernel-janitors, linux-kernel
On Sun, Jun 13, 2021 at 02:27:40PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The pointer of_node is being initialized with a value that is never
> read and it is being updated later with a new value inside a do-while
> loop. The initialization is redundant and can be removed and the
> pointer dev is no longer required and can be removed too.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: phy: micrel: remove redundant assignment to pointer of_node
2021-06-13 13:27 [PATCH] net: phy: micrel: remove redundant assignment to pointer of_node Colin King
2021-06-13 16:37 ` Andrew Lunn
@ 2021-06-14 19:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-14 19:50 UTC (permalink / raw
To: Colin King
Cc: andrew, hkallweit1, linux, davem, kuba, netdev, kernel-janitors,
linux-kernel
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Sun, 13 Jun 2021 14:27:40 +0100 you wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The pointer of_node is being initialized with a value that is never
> read and it is being updated later with a new value inside a do-while
> loop. The initialization is redundant and can be removed and the
> pointer dev is no longer required and can be removed too.
>
> [...]
Here is the summary with links:
- net: phy: micrel: remove redundant assignment to pointer of_node
https://git.kernel.org/netdev/net-next/c/ce4f8afd85d6
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-14 19:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-13 13:27 [PATCH] net: phy: micrel: remove redundant assignment to pointer of_node Colin King
2021-06-13 16:37 ` Andrew Lunn
2021-06-14 19:50 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.