[PATCH net-next] net: sched: act_ctinfo: minor size optimisation

DORMANTno replies

From: Kevin 'ldir' Darbyshire-Bryant <hidden>
Date: 2019-05-30 17:10:52
Subsystem: networking [general], tc subsystem, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jamal Hadi Salim, Jiri Pirko, Linus Torvalds

Since the new parameter block is initialised to 0 by kzmalloc we don't
need to mask & clear unused operational mode bits, they are already
unset.

Drop the pointless code.

Signed-off-by: Kevin Darbyshire-Bryant <redacted>
---
 net/sched/act_ctinfo.c | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/net/sched/act_ctinfo.c b/net/sched/act_ctinfo.c
index 926109139a81..e78b60e47c0f 100644
--- a/net/sched/act_ctinfo.c
+++ b/net/sched/act_ctinfo.c
@@ -231,16 +231,12 @@ static int tcf_ctinfo_init(struct net *net, struct nlattr *nla,
 		cp_new->dscpmaskshift = dscpmaskshift;
 		cp_new->dscpstatemask = dscpstatemask;
 		cp_new->mode |= CTINFO_MODE_DSCP;
-	} else {
-		cp_new->mode &= ~CTINFO_MODE_DSCP;
 	}
 
 	if (tb[TCA_CTINFO_PARMS_CPMARK_MASK]) {
 		cp_new->cpmarkmask =
 				nla_get_u32(tb[TCA_CTINFO_PARMS_CPMARK_MASK]);
 		cp_new->mode |= CTINFO_MODE_CPMARK;
-	} else {
-		cp_new->mode &= ~CTINFO_MODE_CPMARK;
 	}
 
 	spin_lock_bh(&ci->tcf_lock);
-- 
2.20.1 (Apple Git-117)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help