aboutsummaryrefslogtreecommitdiffstats
path: root/net/can/af_can.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-07-20 01:34:43 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-20 01:34:43 -0400
commit721499e8931c5732202481ae24f2dfbf9910f129 (patch)
treec94d8d681966109bb41f712f21f3a9825ae2172d /net/can/af_can.c
parent407d819cf0fd54c6fc1138a509225696aecafd15 (diff)
netns: Use net_eq() to compare net-namespaces for optimization.
Without CONFIG_NET_NS, namespace is always &init_net. Compiler will be able to omit namespace comparisons with this patch. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/can/af_can.c')
-rw-r--r--net/can/af_can.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/can/af_can.c b/net/can/af_can.c
index 484bbf6dd032..8035fbf526ae 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -615,7 +615,7 @@ static int can_rcv(struct sk_buff *skb, struct net_device *dev,
615 struct can_frame *cf = (struct can_frame *)skb->data; 615 struct can_frame *cf = (struct can_frame *)skb->data;
616 int matches; 616 int matches;
617 617
618 if (dev->type != ARPHRD_CAN || dev_net(dev) != &init_net) { 618 if (dev->type != ARPHRD_CAN || !net_eq(dev_net(dev), &init_net)) {
619 kfree_skb(skb); 619 kfree_skb(skb);
620 return 0; 620 return 0;
621 } 621 }
@@ -728,7 +728,7 @@ static int can_notifier(struct notifier_block *nb, unsigned long msg,
728 struct net_device *dev = (struct net_device *)data; 728 struct net_device *dev = (struct net_device *)data;
729 struct dev_rcv_lists *d; 729 struct dev_rcv_lists *d;
730 730
731 if (dev_net(dev) != &init_net) 731 if (!net_eq(dev_net(dev), &init_net))
732 return NOTIFY_DONE; 732 return NOTIFY_DONE;
733 733
734 if (dev->type != ARPHRD_CAN) 734 if (dev->type != ARPHRD_CAN)