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/ipv4/sysctl_net_ipv4.c | |
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/ipv4/sysctl_net_ipv4.c')
-rw-r--r-- | net/ipv4/sysctl_net_ipv4.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 2dcf04d9b005..c00323bae044 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
@@ -818,7 +818,7 @@ static __net_init int ipv4_sysctl_init_net(struct net *net) | |||
818 | struct ctl_table *table; | 818 | struct ctl_table *table; |
819 | 819 | ||
820 | table = ipv4_net_table; | 820 | table = ipv4_net_table; |
821 | if (net != &init_net) { | 821 | if (!net_eq(net, &init_net)) { |
822 | table = kmemdup(table, sizeof(ipv4_net_table), GFP_KERNEL); | 822 | table = kmemdup(table, sizeof(ipv4_net_table), GFP_KERNEL); |
823 | if (table == NULL) | 823 | if (table == NULL) |
824 | goto err_alloc; | 824 | goto err_alloc; |
@@ -849,7 +849,7 @@ static __net_init int ipv4_sysctl_init_net(struct net *net) | |||
849 | return 0; | 849 | return 0; |
850 | 850 | ||
851 | err_reg: | 851 | err_reg: |
852 | if (net != &init_net) | 852 | if (!net_eq(net, &init_net)) |
853 | kfree(table); | 853 | kfree(table); |
854 | err_alloc: | 854 | err_alloc: |
855 | return -ENOMEM; | 855 | return -ENOMEM; |