netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfp: flower: Remove redundant assignment to mask
@ 2021-04-28 10:05 Jiapeng Chong
  2021-04-28 19:13 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2021-04-28 10:05 UTC (permalink / raw)
  To: simon.horman
  Cc: kuba, davem, oss-drivers, netdev, linux-kernel, Jiapeng Chong

The value stored to mask in the calculations this patch removes is
not used, so the calculation and the assignment can be removed.

Cleans up the following clang-analyzer warning:

drivers/net/ethernet/netronome/nfp/flower/offload.c:1230:3: warning:
Value stored to 'mask' 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>
---
 drivers/net/ethernet/netronome/nfp/flower/offload.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c
index e95969c..86e734a 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/offload.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c
@@ -1227,7 +1227,6 @@ int nfp_flower_merge_offloaded_flows(struct nfp_app *app,
 				return -EOPNOTSUPP;
 			}
 		ext += size;
-		mask += size;
 	}
 
 	if ((priv->flower_ext_feats & NFP_FL_FEATS_VLAN_QINQ)) {
-- 
1.8.3.1


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

* Re: [PATCH] nfp: flower: Remove redundant assignment to mask
  2021-04-28 10:05 [PATCH] nfp: flower: Remove redundant assignment to mask Jiapeng Chong
@ 2021-04-28 19:13 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2021-04-28 19:13 UTC (permalink / raw)
  To: Jiapeng Chong; +Cc: simon.horman, davem, oss-drivers, netdev, linux-kernel

On Wed, 28 Apr 2021 18:05:30 +0800 Jiapeng Chong wrote:
> The value stored to mask in the calculations this patch removes is
> not used, so the calculation and the assignment can be removed.
> 
> Cleans up the following clang-analyzer warning:
> 
> drivers/net/ethernet/netronome/nfp/flower/offload.c:1230:3: warning:
> Value stored to 'mask' 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>

Seems cleaner to always move ext and mask, in case some code 
is added later in the function and starts accessing mask.

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

end of thread, other threads:[~2021-04-28 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28 10:05 [PATCH] nfp: flower: Remove redundant assignment to mask Jiapeng Chong
2021-04-28 19:13 ` Jakub Kicinski

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