mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
net: sched: cls_u32: get rid of tp_c
Both hnode ->tp_c and tp_c argument of u32_set_parms() the latter is redundant, the former - never read... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
db04ff4863
commit
8a8065f683
1 changed files with 4 additions and 7 deletions
|
@ -79,7 +79,6 @@ struct tc_u_hnode {
|
||||||
struct tc_u_hnode __rcu *next;
|
struct tc_u_hnode __rcu *next;
|
||||||
u32 handle;
|
u32 handle;
|
||||||
u32 prio;
|
u32 prio;
|
||||||
struct tc_u_common *tp_c;
|
|
||||||
int refcnt;
|
int refcnt;
|
||||||
unsigned int divisor;
|
unsigned int divisor;
|
||||||
struct idr handle_idr;
|
struct idr handle_idr;
|
||||||
|
@ -390,7 +389,6 @@ static int u32_init(struct tcf_proto *tp)
|
||||||
tp_c->refcnt++;
|
tp_c->refcnt++;
|
||||||
RCU_INIT_POINTER(root_ht->next, tp_c->hlist);
|
RCU_INIT_POINTER(root_ht->next, tp_c->hlist);
|
||||||
rcu_assign_pointer(tp_c->hlist, root_ht);
|
rcu_assign_pointer(tp_c->hlist, root_ht);
|
||||||
root_ht->tp_c = tp_c;
|
|
||||||
|
|
||||||
rcu_assign_pointer(tp->root, root_ht);
|
rcu_assign_pointer(tp->root, root_ht);
|
||||||
tp->data = tp_c;
|
tp->data = tp_c;
|
||||||
|
@ -761,7 +759,7 @@ static const struct nla_policy u32_policy[TCA_U32_MAX + 1] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int u32_set_parms(struct net *net, struct tcf_proto *tp,
|
static int u32_set_parms(struct net *net, struct tcf_proto *tp,
|
||||||
unsigned long base, struct tc_u_common *tp_c,
|
unsigned long base,
|
||||||
struct tc_u_knode *n, struct nlattr **tb,
|
struct tc_u_knode *n, struct nlattr **tb,
|
||||||
struct nlattr *est, bool ovr,
|
struct nlattr *est, bool ovr,
|
||||||
struct netlink_ext_ack *extack)
|
struct netlink_ext_ack *extack)
|
||||||
|
@ -782,7 +780,7 @@ static int u32_set_parms(struct net *net, struct tcf_proto *tp,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handle) {
|
if (handle) {
|
||||||
ht_down = u32_lookup_ht(tp_c, handle);
|
ht_down = u32_lookup_ht(tp->data, handle);
|
||||||
|
|
||||||
if (!ht_down) {
|
if (!ht_down) {
|
||||||
NL_SET_ERR_MSG_MOD(extack, "Link hash table not found");
|
NL_SET_ERR_MSG_MOD(extack, "Link hash table not found");
|
||||||
|
@ -956,7 +954,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
|
||||||
if (!new)
|
if (!new)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
err = u32_set_parms(net, tp, base, tp_c, new, tb,
|
err = u32_set_parms(net, tp, base, new, tb,
|
||||||
tca[TCA_RATE], ovr, extack);
|
tca[TCA_RATE], ovr, extack);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -1012,7 +1010,6 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ht->tp_c = tp_c;
|
|
||||||
ht->refcnt = 1;
|
ht->refcnt = 1;
|
||||||
ht->divisor = divisor;
|
ht->divisor = divisor;
|
||||||
ht->handle = handle;
|
ht->handle = handle;
|
||||||
|
@ -1123,7 +1120,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
err = u32_set_parms(net, tp, base, tp_c, n, tb, tca[TCA_RATE], ovr,
|
err = u32_set_parms(net, tp, base, n, tb, tca[TCA_RATE], ovr,
|
||||||
extack);
|
extack);
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
struct tc_u_knode __rcu **ins;
|
struct tc_u_knode __rcu **ins;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue