Skip to content

Commit

Permalink
xirc2ps_cs: remove redundant assignment to variable okay, clean up fr…
Browse files Browse the repository at this point in the history
…eespace

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>
Link: https://lore.kernel.org/r/20240205213643.1850420-1-colin.i.king@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Colin Ian King authored and Jakub Kicinski committed Feb 9, 2024
1 parent 36f75f7 commit e084a1c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/xircom/xirc2ps_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit e084a1c

Please sign in to comment.