aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/sit.c
diff options
context:
space:
mode:
authorIan Morris <ipm@chirality.org.uk>2015-03-29 09:00:05 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-31 13:51:54 -0400
commit53b24b8f94cb15e38e332db82177cf3f0f4df0c5 (patch)
treec314553dc093f5226913a247c36c03012f7d22d7 /net/ipv6/sit.c
parent63159f29be1df7f93563a8a0f78c5e65fc844ed6 (diff)
ipv6: coding style: comparison for inequality with NULL
The ipv6 code uses a mixture of coding styles. In some instances check for NULL pointer is done as x != NULL and sometimes as x. x is preferred according to checkpatch and this patch makes the code consistent by adopting the latter form. No changes detected by objdiff. Signed-off-by: Ian Morris <ipm@chirality.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r--net/ipv6/sit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index c61ed24cd098..92692a7e8a2b 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -118,7 +118,7 @@ static struct ip_tunnel *ipip6_tunnel_lookup(struct net *net,
118 return t; 118 return t;
119 } 119 }
120 t = rcu_dereference(sitn->tunnels_wc[0]); 120 t = rcu_dereference(sitn->tunnels_wc[0]);
121 if ((t != NULL) && (t->dev->flags & IFF_UP)) 121 if (t && (t->dev->flags & IFF_UP))
122 return t; 122 return t;
123 return NULL; 123 return NULL;
124} 124}
@@ -671,7 +671,7 @@ static int ipip6_rcv(struct sk_buff *skb)
671 671
672 tunnel = ipip6_tunnel_lookup(dev_net(skb->dev), skb->dev, 672 tunnel = ipip6_tunnel_lookup(dev_net(skb->dev), skb->dev,
673 iph->saddr, iph->daddr); 673 iph->saddr, iph->daddr);
674 if (tunnel != NULL) { 674 if (tunnel) {
675 struct pcpu_sw_netstats *tstats; 675 struct pcpu_sw_netstats *tstats;
676 676
677 if (tunnel->parms.iph.protocol != IPPROTO_IPV6 && 677 if (tunnel->parms.iph.protocol != IPPROTO_IPV6 &&
@@ -733,7 +733,7 @@ static int ipip_rcv(struct sk_buff *skb)
733 iph = ip_hdr(skb); 733 iph = ip_hdr(skb);
734 tunnel = ipip6_tunnel_lookup(dev_net(skb->dev), skb->dev, 734 tunnel = ipip6_tunnel_lookup(dev_net(skb->dev), skb->dev,
735 iph->saddr, iph->daddr); 735 iph->saddr, iph->daddr);
736 if (tunnel != NULL) { 736 if (tunnel) {
737 if (tunnel->parms.iph.protocol != IPPROTO_IPIP && 737 if (tunnel->parms.iph.protocol != IPPROTO_IPIP &&
738 tunnel->parms.iph.protocol != 0) 738 tunnel->parms.iph.protocol != 0)
739 goto drop; 739 goto drop;
@@ -1206,7 +1206,7 @@ ipip6_tunnel_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1206 t = ipip6_tunnel_locate(net, &p, cmd == SIOCADDTUNNEL); 1206 t = ipip6_tunnel_locate(net, &p, cmd == SIOCADDTUNNEL);
1207 1207
1208 if (dev != sitn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) { 1208 if (dev != sitn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) {
1209 if (t != NULL) { 1209 if (t) {
1210 if (t->dev != dev) { 1210 if (t->dev != dev) {
1211 err = -EEXIST; 1211 err = -EEXIST;
1212 break; 1212 break;
@@ -1795,7 +1795,7 @@ static void __net_exit sit_destroy_tunnels(struct net *net,
1795 struct ip_tunnel *t; 1795 struct ip_tunnel *t;
1796 1796
1797 t = rtnl_dereference(sitn->tunnels[prio][h]); 1797 t = rtnl_dereference(sitn->tunnels[prio][h]);
1798 while (t != NULL) { 1798 while (t) {
1799 /* If dev is in the same netns, it has already 1799 /* If dev is in the same netns, it has already
1800 * been added to the list by the previous loop. 1800 * been added to the list by the previous loop.
1801 */ 1801 */