xirc2ps_cs: remove redundant assignment to variable okay, clean up freespace
Subsystems (3)
PATCH 1/1 xirc2ps_cs: remove redundant assignment to variable okay, clean up freespace
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]
--- drivers/net/ethernet/xircom/xirc2ps_cs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/xircom/xirc2ps_cs.c +1 -3
@@ -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",
Signature · 1 line
2.39.2
Quoted 10 lines · Colin Ian King
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 <[email protected]>
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · 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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html