Commit 1af85155 authored by Alexander Aring's avatar Alexander Aring Committed by David S. Miller

net: sched: act: fix code style

This patch is used by subsequent patches. It fixes code style issues
caught by checkpatch.
Signed-off-by: default avatarAlexander Aring <aring@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 80c6d2b8
...@@ -87,12 +87,13 @@ struct tc_action_ops { ...@@ -87,12 +87,13 @@ struct tc_action_ops {
struct tcf_result *); struct tcf_result *);
int (*dump)(struct sk_buff *, struct tc_action *, int, int); int (*dump)(struct sk_buff *, struct tc_action *, int, int);
void (*cleanup)(struct tc_action *); void (*cleanup)(struct tc_action *);
int (*lookup)(struct net *, struct tc_action **, u32); int (*lookup)(struct net *net, struct tc_action **a, u32 index);
int (*init)(struct net *net, struct nlattr *nla, int (*init)(struct net *net, struct nlattr *nla,
struct nlattr *est, struct tc_action **act, int ovr, struct nlattr *est, struct tc_action **act, int ovr,
int bind); int bind);
int (*walk)(struct net *, struct sk_buff *, int (*walk)(struct net *, struct sk_buff *,
struct netlink_callback *, int, const struct tc_action_ops *); struct netlink_callback *, int,
const struct tc_action_ops *);
void (*stats_update)(struct tc_action *, u64, u32, u64); void (*stats_update)(struct tc_action *, u64, u32, u64);
struct net_device *(*get_dev)(const struct tc_action *a); struct net_device *(*get_dev)(const struct tc_action *a);
}; };
......
...@@ -621,7 +621,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp, ...@@ -621,7 +621,7 @@ struct tc_action *tcf_action_init_1(struct net *net, struct tcf_proto *tp,
goto err_out; goto err_out;
err = -EINVAL; err = -EINVAL;
kind = tb[TCA_ACT_KIND]; kind = tb[TCA_ACT_KIND];
if (kind == NULL) if (!kind)
goto err_out; goto err_out;
if (nla_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ) if (nla_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ)
goto err_out; goto err_out;
...@@ -822,7 +822,7 @@ static int tca_get_fill(struct sk_buff *skb, struct list_head *actions, ...@@ -822,7 +822,7 @@ static int tca_get_fill(struct sk_buff *skb, struct list_head *actions,
t->tca__pad2 = 0; t->tca__pad2 = 0;
nest = nla_nest_start(skb, TCA_ACT_TAB); nest = nla_nest_start(skb, TCA_ACT_TAB);
if (nest == NULL) if (!nest)
goto out_nlmsg_trim; goto out_nlmsg_trim;
if (tcf_action_dump(skb, actions, bind, ref) < 0) if (tcf_action_dump(skb, actions, bind, ref) < 0)
...@@ -934,7 +934,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla, ...@@ -934,7 +934,7 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
t->tca__pad2 = 0; t->tca__pad2 = 0;
nest = nla_nest_start(skb, TCA_ACT_TAB); nest = nla_nest_start(skb, TCA_ACT_TAB);
if (nest == NULL) if (!nest)
goto out_module_put; goto out_module_put;
err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops); err = ops->walk(net, skb, &dcb, RTM_DELACTION, ops);
...@@ -1007,9 +1007,9 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n, ...@@ -1007,9 +1007,9 @@ tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n,
return ret; return ret;
if (event == RTM_DELACTION && n->nlmsg_flags & NLM_F_ROOT) { if (event == RTM_DELACTION && n->nlmsg_flags & NLM_F_ROOT) {
if (tb[1] != NULL) if (tb[1])
return tca_action_flush(net, tb[1], n, portid); return tca_action_flush(net, tb[1], n, portid);
else
return -EINVAL; return -EINVAL;
} }
......
...@@ -80,12 +80,12 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla, ...@@ -80,12 +80,12 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
bool exists = false; bool exists = false;
int ret; int ret;
if (nla == NULL) if (!nla)
return -EINVAL; return -EINVAL;
ret = nla_parse_nested(tb, TCA_MIRRED_MAX, nla, mirred_policy, NULL); ret = nla_parse_nested(tb, TCA_MIRRED_MAX, nla, mirred_policy, NULL);
if (ret < 0) if (ret < 0)
return ret; return ret;
if (tb[TCA_MIRRED_PARMS] == NULL) if (!tb[TCA_MIRRED_PARMS])
return -EINVAL; return -EINVAL;
parm = nla_data(tb[TCA_MIRRED_PARMS]); parm = nla_data(tb[TCA_MIRRED_PARMS]);
...@@ -117,7 +117,7 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla, ...@@ -117,7 +117,7 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
} }
if (!exists) { if (!exists) {
if (dev == NULL) if (!dev)
return -EINVAL; return -EINVAL;
ret = tcf_idr_create(tn, parm->index, est, a, ret = tcf_idr_create(tn, parm->index, est, a,
&act_mirred_ops, bind, true); &act_mirred_ops, bind, true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment