linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] caif: Remove redundant variable expectlen
@ 2021-04-26 10:10 Jiapeng Chong
  0 siblings, 0 replies; only message in thread
From: Jiapeng Chong @ 2021-04-26 10:10 UTC (permalink / raw)
  To: davem; +Cc: kuba, netdev, linux-kernel, Jiapeng Chong

Variable expectlen is being assigned a value from a calculation
however the variable is never read, so this redundant variable
can be removed.

Cleans up the following clang-analyzer warning:

net/caif/cfserl.c:126:5: warning: Value stored to 'expectlen' is never
read [clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 net/caif/cfserl.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c
index e11725a..fef72e6 100644
--- a/net/caif/cfserl.c
+++ b/net/caif/cfserl.c
@@ -123,7 +123,6 @@ static int cfserl_receive(struct cflayer *l, struct cfpkt *newpkt)
 				if (pkt != NULL)
 					cfpkt_destroy(pkt);
 				layr->incomplete_frm = NULL;
-				expectlen = 0;
 				spin_unlock(&layr->sync);
 				return -EPROTO;
 			}
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-26 10:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 10:10 [PATCH] caif: Remove redundant variable expectlen Jiapeng Chong

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