Message ID | 1417539636-12710-7-git-send-email-jiri@resnulli.us |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
On 12/02/14 12:00, Jiri Pirko wrote: > since head->handle == handle (checked before), just assign handle. > > Signed-off-by: Jiri Pirko <jiri@resnulli.us> > --- > net/sched/cls_cgroup.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c > index d61a801..dbee65e 100644 > --- a/net/sched/cls_cgroup.c > +++ b/net/sched/cls_cgroup.c > @@ -117,11 +117,7 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb, > return -ENOBUFS; > > tcf_exts_init(&new->exts, TCA_CGROUP_ACT, TCA_CGROUP_POLICE); > - if (head) > - new->handle = head->handle; > - else > - new->handle = handle; > - > + new->handle = handle; Hrm. head could be NULL, no? cheers, jamal -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Wed, Dec 03, 2014 at 02:07:06PM CET, jhs@mojatatu.com wrote: >On 12/02/14 12:00, Jiri Pirko wrote: >>since head->handle == handle (checked before), just assign handle. >> >>Signed-off-by: Jiri Pirko <jiri@resnulli.us> >>--- >> net/sched/cls_cgroup.c | 6 +----- >> 1 file changed, 1 insertion(+), 5 deletions(-) >> >>diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c >>index d61a801..dbee65e 100644 >>--- a/net/sched/cls_cgroup.c >>+++ b/net/sched/cls_cgroup.c >>@@ -117,11 +117,7 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb, >> return -ENOBUFS; >> >> tcf_exts_init(&new->exts, TCA_CGROUP_ACT, TCA_CGROUP_POLICE); >>- if (head) >>- new->handle = head->handle; >>- else >>- new->handle = handle; >>- >>+ new->handle = handle; > > >Hrm. head could be NULL, no? Sure it can. But that is not a problem. Not sure what you are trying to point at... > >cheers, >jamal > -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 12/03/14 08:18, Jiri Pirko wrote: >> >> Hrm. head could be NULL, no? > > Sure it can. But that is not a problem. Not sure what you are trying to > point at... > I suppose head->handle MUST always be equal to handle for the change to work. So doesnt matter if handle is null or not. Too clever for me. Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> cheers, jamal -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Wed, Dec 03, 2014 at 03:30:48PM CET, jhs@mojatatu.com wrote: >On 12/03/14 08:18, Jiri Pirko wrote: > >>> >>>Hrm. head could be NULL, no? >> >>Sure it can. But that is not a problem. Not sure what you are trying to >>point at... >> > >I suppose head->handle MUST always be equal to handle for the change to >work. So doesnt matter if handle is null or not. Too clever for me. Exactly. That is what I tried to say in patch desc :) > >Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> > >cheers, >jamal -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index d61a801..dbee65e 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c @@ -117,11 +117,7 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb, return -ENOBUFS; tcf_exts_init(&new->exts, TCA_CGROUP_ACT, TCA_CGROUP_POLICE); - if (head) - new->handle = head->handle; - else - new->handle = handle; - + new->handle = handle; new->tp = tp; err = nla_parse_nested(tb, TCA_CGROUP_MAX, tca[TCA_OPTIONS], cgroup_policy);
since head->handle == handle (checked before), just assign handle. Signed-off-by: Jiri Pirko <jiri@resnulli.us> --- net/sched/cls_cgroup.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)