mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] mptcp: Remove redundant assignment to remaining
@ 2021-06-15 10:55 Jiapeng Chong
  2021-06-15 23:52 ` Mat Martineau
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-06-15 10:55 UTC (permalink / raw)
  To: mathew.j.martineau
  Cc: matthieu.baerts, davem, kuba, netdev, mptcp, linux-kernel, Jiapeng Chong

Variable remaining is assigned, but this value is never read as it is
not used later on, hence it is a redundant assignment and can be
removed.

Clean up the following clang-analyzer warning:

net/mptcp/options.c:779:3: warning: Value stored to 'remaining' is never
read [clang-analyzer-deadcode.DeadStores].

net/mptcp/options.c:547:3: warning: Value stored to 'remaining' 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/mptcp/options.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 9b263f2..f99272f 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -544,7 +544,6 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
 
 		map_size = TCPOLEN_MPTCP_DSS_BASE + TCPOLEN_MPTCP_DSS_MAP64;
 
-		remaining -= map_size;
 		dss_size = map_size;
 		if (mpext)
 			opts->ext_copy = *mpext;
@@ -776,7 +775,6 @@ bool mptcp_established_options(struct sock *sk, struct sk_buff *skb,
 
 	if (mptcp_established_options_mp_prio(sk, &opt_size, remaining, opts)) {
 		*size += opt_size;
-		remaining -= opt_size;
 		ret = true;
 	}
 
-- 
1.8.3.1


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

end of thread, other threads:[~2021-06-15 23:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 10:55 [PATCH] mptcp: Remove redundant assignment to remaining Jiapeng Chong
2021-06-15 23:52 ` Mat Martineau

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