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 /drivers/net | |
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 'drivers/net')
-rw-r--r-- | drivers/net/hamradio/bpqether.c | 4 | ||||
-rw-r--r-- | drivers/net/loopback.c | 2 | ||||
-rw-r--r-- | drivers/net/wan/hdlc.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index fe893c91a01b..76abed9a70b1 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
@@ -186,7 +186,7 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty | |||
186 | struct ethhdr *eth; | 186 | struct ethhdr *eth; |
187 | struct bpqdev *bpq; | 187 | struct bpqdev *bpq; |
188 | 188 | ||
189 | if (dev_net(dev) != &init_net) | 189 | if (!net_eq(dev_net(dev), &init_net)) |
190 | goto drop; | 190 | goto drop; |
191 | 191 | ||
192 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) | 192 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) |
@@ -552,7 +552,7 @@ static int bpq_device_event(struct notifier_block *this,unsigned long event, voi | |||
552 | { | 552 | { |
553 | struct net_device *dev = (struct net_device *)ptr; | 553 | struct net_device *dev = (struct net_device *)ptr; |
554 | 554 | ||
555 | if (dev_net(dev) != &init_net) | 555 | if (!net_eq(dev_net(dev), &init_net)) |
556 | return NOTIFY_DONE; | 556 | return NOTIFY_DONE; |
557 | 557 | ||
558 | if (!dev_is_ethdev(dev)) | 558 | if (!dev_is_ethdev(dev)) |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 1bc654a73c47..c9f65574378f 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -207,7 +207,7 @@ static __net_init int loopback_net_init(struct net *net) | |||
207 | out_free_netdev: | 207 | out_free_netdev: |
208 | free_netdev(dev); | 208 | free_netdev(dev); |
209 | out: | 209 | out: |
210 | if (net == &init_net) | 210 | if (net_eq(net, &init_net)) |
211 | panic("loopback: Failed to register netdevice: %d\n", err); | 211 | panic("loopback: Failed to register netdevice: %d\n", err); |
212 | return err; | 212 | return err; |
213 | } | 213 | } |
diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c index cc07236ea734..9937bbab938d 100644 --- a/drivers/net/wan/hdlc.c +++ b/drivers/net/wan/hdlc.c | |||
@@ -57,7 +57,7 @@ static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev, | |||
57 | { | 57 | { |
58 | struct hdlc_device *hdlc = dev_to_hdlc(dev); | 58 | struct hdlc_device *hdlc = dev_to_hdlc(dev); |
59 | 59 | ||
60 | if (dev_net(dev) != &init_net) { | 60 | if (!net_eq(dev_net(dev), &init_net)) { |
61 | kfree_skb(skb); | 61 | kfree_skb(skb); |
62 | return 0; | 62 | return 0; |
63 | } | 63 | } |
@@ -102,7 +102,7 @@ static int hdlc_device_event(struct notifier_block *this, unsigned long event, | |||
102 | unsigned long flags; | 102 | unsigned long flags; |
103 | int on; | 103 | int on; |
104 | 104 | ||
105 | if (dev_net(dev) != &init_net) | 105 | if (!net_eq(dev_net(dev), &init_net)) |
106 | return NOTIFY_DONE; | 106 | return NOTIFY_DONE; |
107 | 107 | ||
108 | if (!(dev->priv_flags & IFF_WAN_HDLC)) | 108 | if (!(dev->priv_flags & IFF_WAN_HDLC)) |