]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/ipv6/ip6_gre.c
ipv6: coding style: comparison for inequality with NULL
[mirror_ubuntu-bionic-kernel.git] / net / ipv6 / ip6_gre.c
index 01ccc28a686f8cd6bc2b6c69b6d48548b627fbdc..67e014d88e55fd15dab6486fdb0e4717d32aadc1 100644 (file)
@@ -223,7 +223,7 @@ static struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev,
                }
        }
 
-       if (cand != NULL)
+       if (cand)
                return cand;
 
        dev = ign->fb_tunnel_dev;
@@ -395,7 +395,7 @@ static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
                                flags & GRE_KEY ?
                                *(((__be32 *)p) + (grehlen / 4) - 1) : 0,
                                p[1]);
-       if (t == NULL)
+       if (!t)
                return;
 
        switch (type) {
@@ -980,7 +980,7 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu)
                                                 &p->raddr, &p->laddr,
                                                 p->link, strict);
 
-               if (rt == NULL)
+               if (!rt)
                        return;
 
                if (rt->dst.dev) {
@@ -1073,7 +1073,7 @@ static int ip6gre_tunnel_ioctl(struct net_device *dev,
                        }
                        ip6gre_tnl_parm_from_user(&p1, &p);
                        t = ip6gre_tunnel_locate(net, &p1, 0);
-                       if (t == NULL)
+                       if (!t)
                                t = netdev_priv(dev);
                }
                memset(&p, 0, sizeof(p));
@@ -1105,7 +1105,7 @@ static int ip6gre_tunnel_ioctl(struct net_device *dev,
                t = ip6gre_tunnel_locate(net, &p1, cmd == SIOCADDTUNNEL);
 
                if (dev != ign->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) {
-                       if (t != NULL) {
+                       if (t) {
                                if (t->dev != dev) {
                                        err = -EEXIST;
                                        break;
@@ -1144,7 +1144,7 @@ static int ip6gre_tunnel_ioctl(struct net_device *dev,
                        err = -ENOENT;
                        ip6gre_tnl_parm_from_user(&p1, &p);
                        t = ip6gre_tunnel_locate(net, &p1, 0);
-                       if (t == NULL)
+                       if (!t)
                                goto done;
                        err = -EPERM;
                        if (t == netdev_priv(ign->fb_tunnel_dev))
@@ -1313,7 +1313,7 @@ static void ip6gre_destroy_tunnels(struct net *net, struct list_head *head)
 
                        t = rtnl_dereference(ign->tunnels[prio][h]);
 
-                       while (t != NULL) {
+                       while (t) {
                                /* If dev is in the same netns, it has already
                                 * been added to the list by the previous loop.
                                 */
@@ -1662,6 +1662,7 @@ static struct rtnl_link_ops ip6gre_link_ops __read_mostly = {
        .dellink        = ip6gre_dellink,
        .get_size       = ip6gre_get_size,
        .fill_info      = ip6gre_fill_info,
+       .get_link_net   = ip6_tnl_get_link_net,
 };
 
 static struct rtnl_link_ops ip6gre_tap_ops __read_mostly = {
@@ -1675,6 +1676,7 @@ static struct rtnl_link_ops ip6gre_tap_ops __read_mostly = {
        .changelink     = ip6gre_changelink,
        .get_size       = ip6gre_get_size,
        .fill_info      = ip6gre_fill_info,
+       .get_link_net   = ip6_tnl_get_link_net,
 };
 
 /*