提交 8865fdd4 编写于 作者: A Alexander Aring 提交者: David S. Miller

net: sched: cls: fix code style issues

This patch changes some code style issues pointed out by checkpatch
inside the TC cls subsystem.
Signed-off-by: NAlexander Aring <aring@mojatatu.com>
Acked-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 fd5204cd
...@@ -240,7 +240,8 @@ struct tcf_proto_ops { ...@@ -240,7 +240,8 @@ struct tcf_proto_ops {
struct tcf_proto*, unsigned long, struct tcf_proto*, unsigned long,
u32 handle, struct nlattr **, u32 handle, struct nlattr **,
void **, bool); void **, bool);
int (*delete)(struct tcf_proto*, void *, bool*); int (*delete)(struct tcf_proto *tp, void *arg,
bool *last);
void (*walk)(struct tcf_proto*, struct tcf_walker *arg); void (*walk)(struct tcf_proto*, struct tcf_walker *arg);
void (*bind_class)(void *, u32, unsigned long); void (*bind_class)(void *, u32, unsigned long);
......
...@@ -203,7 +203,7 @@ static int mall_change(struct net *net, struct sk_buff *in_skb, ...@@ -203,7 +203,7 @@ static int mall_change(struct net *net, struct sk_buff *in_skb,
goto err_set_parms; goto err_set_parms;
if (!tc_skip_hw(new->flags)) { if (!tc_skip_hw(new->flags)) {
err = mall_replace_hw_filter(tp, new, (unsigned long) new); err = mall_replace_hw_filter(tp, new, (unsigned long)new);
if (err) if (err)
goto err_replace_hw_filter; goto err_replace_hw_filter;
} }
......
...@@ -783,7 +783,7 @@ static int u32_set_parms(struct net *net, struct tcf_proto *tp, ...@@ -783,7 +783,7 @@ static int u32_set_parms(struct net *net, struct tcf_proto *tp,
if (handle) { if (handle) {
ht_down = u32_lookup_ht(ht->tp_c, handle); ht_down = u32_lookup_ht(ht->tp_c, handle);
if (ht_down == NULL) if (!ht_down)
return -EINVAL; return -EINVAL;
ht_down->refcnt++; ht_down->refcnt++;
} }
...@@ -907,7 +907,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, ...@@ -907,7 +907,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
size_t size; size_t size;
#endif #endif
if (opt == NULL) if (!opt)
return handle ? -EINVAL : 0; return handle ? -EINVAL : 0;
err = nla_parse_nested(tb, TCA_U32_MAX, opt, u32_policy, NULL); err = nla_parse_nested(tb, TCA_U32_MAX, opt, u32_policy, NULL);
...@@ -1011,7 +1011,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, ...@@ -1011,7 +1011,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
htid = ht->handle; htid = ht->handle;
} else { } else {
ht = u32_lookup_ht(tp->data, TC_U32_HTID(htid)); ht = u32_lookup_ht(tp->data, TC_U32_HTID(htid));
if (ht == NULL) if (!ht)
return -EINVAL; return -EINVAL;
} }
} else { } else {
...@@ -1023,7 +1023,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, ...@@ -1023,7 +1023,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb,
return -EINVAL; return -EINVAL;
if (handle) { if (handle) {
if (TC_U32_HTID(handle) && TC_U32_HTID(handle^htid)) if (TC_U32_HTID(handle) && TC_U32_HTID(handle ^ htid))
return -EINVAL; return -EINVAL;
handle = htid | TC_U32_NODE(handle); handle = htid | TC_U32_NODE(handle);
err = idr_alloc_ext(&ht->handle_idr, NULL, NULL, err = idr_alloc_ext(&ht->handle_idr, NULL, NULL,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册