netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] net: ipa: remove the redundant assignment to variable trans_id
@ 2024-01-16 11:40 Colin Ian King
  2024-01-16 11:44 ` Alex Elder
  2024-01-16 19:31 ` Simon Horman
  0 siblings, 2 replies; 4+ messages in thread
From: Colin Ian King @ 2024-01-16 11:40 UTC (permalink / raw)
  To: Alex Elder, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev
  Cc: kernel-janitors, linux-kernel

The variable trans_id is being modulo'd by channel->tre_count and
the value is being re-assigned back to trans_id even though the
variable is not used after this operation. The assignment is
redundant. Remove the assignment and just replace it with the modulo
operator.

Cleans up clang scan build warning:
warning: Although the value stored to 'trans_id' is used in the
enclosing expression, the value is never actually read from
'trans_id' [deadcode.DeadStores]

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

diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c
index ee6fb00b71eb..f5dafc2f53ab 100644
--- a/drivers/net/ipa/gsi_trans.c
+++ b/drivers/net/ipa/gsi_trans.c
@@ -247,7 +247,7 @@ struct gsi_trans *gsi_channel_trans_complete(struct gsi_channel *channel)
 			return NULL;
 	}
 
-	return &trans_info->trans[trans_id %= channel->tre_count];
+	return &trans_info->trans[trans_id % channel->tre_count];
 }
 
 /* Move a transaction from allocated to committed state */
-- 
2.39.2


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

end of thread, other threads:[~2024-01-26 15:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-16 11:40 [PATCH][next] net: ipa: remove the redundant assignment to variable trans_id Colin Ian King
2024-01-16 11:44 ` Alex Elder
2024-01-16 19:31 ` Simon Horman
2024-01-26 15:15   ` Alex Elder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).