diff mbox series

[next] xirc2ps_cs: remove redundant assignment to variable okay, clean up freespace

Message ID 20240205213643.1850420-1-colin.i.king@gmail.com (mailing list archive)
State Accepted
Commit e084a1c1dff6172887eb5a71e697745e3f5855be
Delegated to: Netdev Maintainers
Headers show
Series [next] xirc2ps_cs: remove redundant assignment to variable okay, clean up freespace | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1048 this patch: 1048
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 6 maintainers not CCed: morbo@google.com justinstitt@google.com nathan@kernel.org llvm@lists.linux.dev ndesaulniers@google.com zyytlz.wz@163.com
netdev/build_clang success Errors and warnings before: 1065 this patch: 1065
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1065 this patch: 1065
netdev/checkpatch warning WARNING: please, no spaces at the start of a line
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-09--00-00 (tests: 687)

Commit Message

Colin Ian King Feb. 5, 2024, 9:36 p.m. UTC
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(-)

Comments

Simon Horman Feb. 7, 2024, 9:37 a.m. UTC | #1
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>
patchwork-bot+netdevbpf@kernel.org Feb. 9, 2024, 3:11 a.m. UTC | #2
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!
diff mbox series

Patch

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",