Skip to content

Commit

Permalink
net: sched: move TC_H_MAJ macro call into tcf_auto_prio
Browse files Browse the repository at this point in the history
Call the helper from the function rather than to always adjust the
return value of the function.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed May 17, 2017
1 parent 9d36d9e commit 7961973
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/sched/cls_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static inline u32 tcf_auto_prio(struct tcf_proto *tp)
if (tp)
first = tp->prio - 1;

return first;
return TC_H_MAJ(first);
}

static struct tcf_proto *tcf_proto_create(const char *kind, u32 protocol,
Expand Down Expand Up @@ -411,7 +411,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
}

if (prio_allocate)
prio = TC_H_MAJ(tcf_auto_prio(rtnl_dereference(*back)));
prio = tcf_auto_prio(rtnl_dereference(*back));

tp = tcf_proto_create(nla_data(tca[TCA_KIND]),
protocol, prio, parent, q, block);
Expand Down

0 comments on commit 7961973

Please sign in to comment.