2021-04-29 10:39:54

by Yang Li

[permalink] [raw]
Subject: [PATCH] bnx2x: Remove redundant assignment to err

Variable 'err' is set to -EIO but this value is never read as it is
overwritten with a new value later on, hence it is a redundant
assignment and can be removed.

Clean up the following clang-analyzer warning:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:1195:2: warning: Value
stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 9c2f51f..d21f085 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -1192,7 +1192,6 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param,
return 0;
}

- err = -EIO;
/* verify ari is enabled */
if (!pci_ari_enabled(bp->pdev->bus)) {
BNX2X_ERR("ARI not supported (check pci bridge ARI forwarding), SRIOV can not be enabled\n");
--
1.8.3.1


2021-04-29 23:02:59

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH] bnx2x: Remove redundant assignment to err

Hello:

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

On Thu, 29 Apr 2021 18:38:25 +0800 you wrote:
> Variable 'err' is set to -EIO but this value is never read as it is
> overwritten with a new value later on, hence it is a redundant
> assignment and can be removed.
>
> Clean up the following clang-analyzer warning:
> drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c:1195:2: warning: Value
> stored to 'err' is never read [clang-analyzer-deadcode.DeadStores]
>
> [...]

Here is the summary with links:
- bnx2x: Remove redundant assignment to err
https://git.kernel.org/netdev/net/c/8343b1f8b97a

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