diff mbox series

nfp: flower: Remove redundant assignment to mask

Message ID 1619604330-122462-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series nfp: flower: Remove redundant assignment to mask | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers warning 10 maintainers not CCed: yinjun.zhang@corigine.com pablo@netfilter.org gustavoars@kernel.org louis.peens@corigine.com wenxu@ucloud.cn clang-built-linux@googlegroups.com nathan@kernel.org heinrich.kuhn@netronome.com petrm@mellanox.com ndesaulniers@google.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Jiapeng Chong April 28, 2021, 10:05 a.m. UTC
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(-)

Comments

Jakub Kicinski April 28, 2021, 7:13 p.m. UTC | #1
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.
diff mbox series

Patch

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