diff options
author | Octavian Purdila <opurdila@ixiacom.com> | 2009-11-25 18:14:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-25 18:14:13 -0500 |
commit | 09ad9bc752519cc167d0a573e1acf69b5c707c67 (patch) | |
tree | 0e190a9ffb90d7e0534136c3e9f31dce02f423c3 /net/sched | |
parent | 4ba3eb034fb6fd1990ccc5a6d71d5abcda37b905 (diff) |
net: use net_eq to compare nets
Generated with the following semantic patch
@@
struct net *n1;
struct net *n2;
@@
- n1 == n2
+ net_eq(n1, n2)
@@
struct net *n1;
struct net *n2;
@@
- n1 != n2
+ !net_eq(n1, n2)
applied over {include,net,drivers/net}.
Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/act_api.c | 4 | ||||
-rw-r--r-- | net/sched/cls_api.c | 4 | ||||
-rw-r--r-- | net/sched/sch_api.c | 10 |
3 files changed, 9 insertions, 9 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index ca2e1fd2bf69..2a740035aa6b 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c | |||
@@ -969,7 +969,7 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n, void *arg) | |||
969 | u32 pid = skb ? NETLINK_CB(skb).pid : 0; | 969 | u32 pid = skb ? NETLINK_CB(skb).pid : 0; |
970 | int ret = 0, ovr = 0; | 970 | int ret = 0, ovr = 0; |
971 | 971 | ||
972 | if (net != &init_net) | 972 | if (!net_eq(net, &init_net)) |
973 | return -EINVAL; | 973 | return -EINVAL; |
974 | 974 | ||
975 | ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL); | 975 | ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL); |
@@ -1052,7 +1052,7 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb) | |||
1052 | struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh); | 1052 | struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh); |
1053 | struct nlattr *kind = find_dump_kind(cb->nlh); | 1053 | struct nlattr *kind = find_dump_kind(cb->nlh); |
1054 | 1054 | ||
1055 | if (net != &init_net) | 1055 | if (!net_eq(net, &init_net)) |
1056 | return 0; | 1056 | return 0; |
1057 | 1057 | ||
1058 | if (kind == NULL) { | 1058 | if (kind == NULL) { |
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index c024da77824f..3725d8fa29db 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -137,7 +137,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg) | |||
137 | int err; | 137 | int err; |
138 | int tp_created = 0; | 138 | int tp_created = 0; |
139 | 139 | ||
140 | if (net != &init_net) | 140 | if (!net_eq(net, &init_net)) |
141 | return -EINVAL; | 141 | return -EINVAL; |
142 | 142 | ||
143 | replay: | 143 | replay: |
@@ -418,7 +418,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) | |||
418 | const struct Qdisc_class_ops *cops; | 418 | const struct Qdisc_class_ops *cops; |
419 | struct tcf_dump_args arg; | 419 | struct tcf_dump_args arg; |
420 | 420 | ||
421 | if (net != &init_net) | 421 | if (!net_eq(net, &init_net)) |
422 | return 0; | 422 | return 0; |
423 | 423 | ||
424 | if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm))) | 424 | if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm))) |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 876ba4bb6ae9..75fd1c672c61 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -947,7 +947,7 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg) | |||
947 | struct Qdisc *p = NULL; | 947 | struct Qdisc *p = NULL; |
948 | int err; | 948 | int err; |
949 | 949 | ||
950 | if (net != &init_net) | 950 | if (!net_eq(net, &init_net)) |
951 | return -EINVAL; | 951 | return -EINVAL; |
952 | 952 | ||
953 | if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL) | 953 | if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL) |
@@ -1009,7 +1009,7 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg) | |||
1009 | struct Qdisc *q, *p; | 1009 | struct Qdisc *q, *p; |
1010 | int err; | 1010 | int err; |
1011 | 1011 | ||
1012 | if (net != &init_net) | 1012 | if (!net_eq(net, &init_net)) |
1013 | return -EINVAL; | 1013 | return -EINVAL; |
1014 | 1014 | ||
1015 | replay: | 1015 | replay: |
@@ -1274,7 +1274,7 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb) | |||
1274 | int s_idx, s_q_idx; | 1274 | int s_idx, s_q_idx; |
1275 | struct net_device *dev; | 1275 | struct net_device *dev; |
1276 | 1276 | ||
1277 | if (net != &init_net) | 1277 | if (!net_eq(net, &init_net)) |
1278 | return 0; | 1278 | return 0; |
1279 | 1279 | ||
1280 | s_idx = cb->args[0]; | 1280 | s_idx = cb->args[0]; |
@@ -1334,7 +1334,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n, void *arg) | |||
1334 | u32 qid = TC_H_MAJ(clid); | 1334 | u32 qid = TC_H_MAJ(clid); |
1335 | int err; | 1335 | int err; |
1336 | 1336 | ||
1337 | if (net != &init_net) | 1337 | if (!net_eq(net, &init_net)) |
1338 | return -EINVAL; | 1338 | return -EINVAL; |
1339 | 1339 | ||
1340 | if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL) | 1340 | if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL) |
@@ -1576,7 +1576,7 @@ static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb) | |||
1576 | struct net_device *dev; | 1576 | struct net_device *dev; |
1577 | int t, s_t; | 1577 | int t, s_t; |
1578 | 1578 | ||
1579 | if (net != &init_net) | 1579 | if (!net_eq(net, &init_net)) |
1580 | return 0; | 1580 | return 0; |
1581 | 1581 | ||
1582 | if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm))) | 1582 | if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm))) |