All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qlcnic: remove redundant assignment to variable index
@ 2022-03-18  1:20 Colin Ian King
  2022-03-18 21:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-03-18  1:20 UTC (permalink / raw)
  To: Shahed Shaikh, Manish Chopra, GR-Linux-NIC-Dev, David S . Miller,
	Paolo Abeni, netdev
  Cc: kernel-janitors, linux-kernel, llvm

Variable index is being assigned a value that is never read, it is being
re-assigned later in a following for-loop. The assignment is redundant
and can be removed.

Cleans up clang scan build warning:
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c:1358:17: warning:
Although the value stored to 'index' is used in the enclosing expression,
the value is never actually read from 'index' [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index e10fe071a40f..54a2d653be63 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -1355,7 +1355,7 @@ static void qlcnic_get_ethtool_stats(struct net_device *dev,
 
 	memset(data, 0, stats->n_stats * sizeof(u64));
 
-	for (ring = 0, index = 0; ring < adapter->drv_tx_rings; ring++) {
+	for (ring = 0; ring < adapter->drv_tx_rings; ring++) {
 		if (adapter->is_up == QLCNIC_ADAPTER_UP_MAGIC) {
 			tx_ring = &adapter->tx_ring[ring];
 			data = qlcnic_fill_tx_queue_stats(data, tx_ring);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] qlcnic: remove redundant assignment to variable index
  2022-03-18  1:20 [PATCH] qlcnic: remove redundant assignment to variable index Colin Ian King
@ 2022-03-18 21:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-18 21:30 UTC (permalink / raw)
  To: Colin Ian King
  Cc: shshaikh, manishc, GR-Linux-NIC-Dev, davem, pabeni, netdev,
	kernel-janitors, linux-kernel, llvm

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 18 Mar 2022 01:20:35 +0000 you wrote:
> Variable index is being assigned a value that is never read, it is being
> re-assigned later in a following for-loop. The assignment is redundant
> and can be removed.
> 
> Cleans up clang scan build warning:
> drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c:1358:17: warning:
> Although the value stored to 'index' is used in the enclosing expression,
> the value is never actually read from 'index' [deadcode.DeadStores]
> 
> [...]

Here is the summary with links:
  - qlcnic: remove redundant assignment to variable index
    https://git.kernel.org/netdev/net-next/c/79fdce0513ac

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] 2+ messages in thread

end of thread, other threads:[~2022-03-18 21:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18  1:20 [PATCH] qlcnic: remove redundant assignment to variable index Colin Ian King
2022-03-18 21:30 ` 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.