netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] xirc2ps_cs: remove redundant assignment to variable okay, clean up freespace
@ 2024-02-05 21:36 Colin Ian King
  2024-02-07  9:37 ` Simon Horman
  2024-02-09  3:11 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2024-02-05 21:36 UTC (permalink / raw)
  To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev
  Cc: kernel-janitors, linux-kernel

The variable okay is being initialized with a value that is never
read, it is being re-assigned later on. The initialization is
redundant and can be removed.  Also clean up assignment to
variable freespace using an assignment and mask operation.

Cleans up clang scan build warning:
drivers/net/ethernet/xircom/xirc2ps_cs.c:1244:5: warning: Value stored
to 'okay' is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/net/ethernet/xircom/xirc2ps_cs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/xircom/xirc2ps_cs.c b/drivers/net/ethernet/xircom/xirc2ps_cs.c
index 9f505cf02d96..e9bc38fd2025 100644
--- a/drivers/net/ethernet/xircom/xirc2ps_cs.c
+++ b/drivers/net/ethernet/xircom/xirc2ps_cs.c
@@ -1240,9 +1240,7 @@ do_start_xmit(struct sk_buff *skb, struct net_device *dev)
     netif_stop_queue(dev);
     SelectPage(0);
     PutWord(XIRCREG0_TRS, (u_short)pktlen+2);
-    freespace = GetWord(XIRCREG0_TSO);
-    okay = freespace & 0x8000;
-    freespace &= 0x7fff;
+    freespace = GetWord(XIRCREG0_TSO) & 0x7fff;
     /* TRS doesn't work - (indeed it is eliminated with sil-rev 1) */
     okay = pktlen +2 < freespace;
     pr_debug("%s: avail. tx space=%u%s\n",
-- 
2.39.2


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

* Re: [PATCH][next] xirc2ps_cs: remove redundant assignment to variable okay, clean up freespace
  2024-02-05 21:36 [PATCH][next] xirc2ps_cs: remove redundant assignment to variable okay, clean up freespace Colin Ian King
@ 2024-02-07  9:37 ` Simon Horman
  2024-02-09  3:11 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-02-07  9:37 UTC (permalink / raw)
  To: Colin Ian King
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, kernel-janitors, linux-kernel

On Mon, Feb 05, 2024 at 09:36:43PM +0000, Colin Ian King wrote:
> The variable okay is being initialized with a value that is never
> read, it is being re-assigned later on. The initialization is
> redundant and can be removed.  Also clean up assignment to
> variable freespace using an assignment and mask operation.
> 
> Cleans up clang scan build warning:
> drivers/net/ethernet/xircom/xirc2ps_cs.c:1244:5: warning: Value stored
> to 'okay' is never read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>

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

* Re: [PATCH][next] xirc2ps_cs: remove redundant assignment to variable okay, clean up freespace
  2024-02-05 21:36 [PATCH][next] xirc2ps_cs: remove redundant assignment to variable okay, clean up freespace Colin Ian King
  2024-02-07  9:37 ` Simon Horman
@ 2024-02-09  3:11 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-09  3:11 UTC (permalink / raw)
  To: Colin Ian King
  Cc: davem, edumazet, kuba, pabeni, netdev, kernel-janitors,
	linux-kernel

Hello:

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

On Mon,  5 Feb 2024 21:36:43 +0000 you wrote:
> The variable okay is being initialized with a value that is never
> read, it is being re-assigned later on. The initialization is
> redundant and can be removed.  Also clean up assignment to
> variable freespace using an assignment and mask operation.
> 
> Cleans up clang scan build warning:
> drivers/net/ethernet/xircom/xirc2ps_cs.c:1244:5: warning: Value stored
> to 'okay' is never read [deadcode.DeadStores]
> 
> [...]

Here is the summary with links:
  - [next] xirc2ps_cs: remove redundant assignment to variable okay, clean up freespace
    https://git.kernel.org/netdev/net-next/c/e084a1c1dff6

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

end of thread, other threads:[~2024-02-09  3:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-05 21:36 [PATCH][next] xirc2ps_cs: remove redundant assignment to variable okay, clean up freespace Colin Ian King
2024-02-07  9:37 ` Simon Horman
2024-02-09  3:11 ` patchwork-bot+netdevbpf

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).