2021-04-25 10:37:08

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH] pcnet32: Remove redundant variable prev_link and curr_link

Variable prev_link and curr_link is being assigned a value from a
calculation however the variable is never read, so this redundant
variable can be removed.

Cleans up the following clang-analyzer warning:

drivers/net/ethernet/amd/pcnet32.c:2857:4: warning: Value stored to
'prev_link' is never read [clang-analyzer-deadcode.DeadStores].

drivers/net/ethernet/amd/pcnet32.c:2856:4: warning: Value stored to
'curr_link' is never read [clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
---
drivers/net/ethernet/amd/pcnet32.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index f78daba..aa41250 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -2853,8 +2853,7 @@ static void pcnet32_check_media(struct net_device *dev, int verbose)
netif_info(lp, link, dev, "link down\n");
}
if (lp->phycount > 1) {
- curr_link = pcnet32_check_otherphy(dev);
- prev_link = 0;
+ pcnet32_check_otherphy(dev);
}
} else if (verbose || !prev_link) {
netif_carrier_on(dev);
--
1.8.3.1


2021-04-26 19:56:24

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH] pcnet32: Remove redundant variable prev_link and curr_link

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Sun, 25 Apr 2021 18:35:18 +0800 you wrote:
> Variable prev_link and curr_link is being assigned a value from a
> calculation however the variable is never read, so this redundant
> variable can be removed.
>
> Cleans up the following clang-analyzer warning:
>
> drivers/net/ethernet/amd/pcnet32.c:2857:4: warning: Value stored to
> 'prev_link' is never read [clang-analyzer-deadcode.DeadStores].
>
> [...]

Here is the summary with links:
- pcnet32: Remove redundant variable prev_link and curr_link
https://git.kernel.org/netdev/net-next/c/930d2d619d0a

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html