Skip to contentSkip to conversation

bnx2x: Remove redundant assignment to err

PATCH Applied Yang Li 2 participants 2 messages Apr 29, 2021

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 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]

---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +0 -1
index 9c2f51f..d21f085 100644
@@ -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");
Signature · 1 line
1.8.3.1
#1 lore raw
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

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

Quoted 9 lines · 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