--- zzzz-none-000/linux-2.6.39.4/net/ipv6/sit.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-arm-6490-729/linux-2.6.39.4/net/ipv6/sit.c 2021-11-10 13:23:11.000000000 +0000 @@ -143,7 +143,7 @@ return t; } t = rcu_dereference(sitn->tunnels_wc[0]); - if ((t != NULL) && (t->dev->flags & IFF_UP)) + if (t && (t->dev->flags & IFF_UP)) return t; return NULL; } @@ -179,7 +179,7 @@ struct ip_tunnel *iter; for (tp = ipip6_bucket(sitn, t); - (iter = rtnl_dereference(*tp)) != NULL; + (iter = rtnl_dereference(*tp)); tp = &iter->next) { if (t == iter) { rcu_assign_pointer(*tp, t->next); @@ -225,7 +225,7 @@ struct sit_net *sitn = net_generic(net, sit_net_id); for (tp = __ipip6_bucket(sitn, parms); - (t = rtnl_dereference(*tp)) != NULL; + (t = rtnl_dereference(*tp)); tp = &t->next) { if (local == t->parms.iph.saddr && remote == t->parms.iph.daddr && @@ -245,7 +245,7 @@ strcpy(name, "sit%d"); dev = alloc_netdev(sizeof(*t), name, ipip6_tunnel_setup); - if (dev == NULL) + if (!dev) return NULL; dev_net_set(dev, net); @@ -429,7 +429,7 @@ if (a && a->addr != htonl(INADDR_ANY)) { for (p = &t->prl; - (x = rtnl_dereference(*p)) != NULL; + (x = rtnl_dereference(*p)); p = &x->next) { if (x->addr == a->addr) { *p = x->next; @@ -540,7 +540,7 @@ skb->dev, iph->daddr, iph->saddr); - if (t == NULL || t->parms.iph.daddr == 0) + if (!t || t->parms.iph.daddr == 0) goto out; err = 0; @@ -576,7 +576,7 @@ rcu_read_lock(); tunnel = ipip6_tunnel_lookup(dev_net(skb->dev), skb->dev, iph->saddr, iph->daddr); - if (tunnel != NULL) { + if (tunnel) { struct pcpu_tstats *tstats; secpath_reset(skb); @@ -687,7 +687,7 @@ if (skb_dst(skb)) neigh = skb_dst(skb)->neighbour; - if (neigh == NULL) { + if (!neigh) { if (net_ratelimit()) printk(KERN_DEBUG "sit: nexthop == NULL\n"); goto tx_error; @@ -712,7 +712,7 @@ if (skb_dst(skb)) neigh = skb_dst(skb)->neighbour; - if (neigh == NULL) { + if (!neigh) { if (net_ratelimit()) printk(KERN_DEBUG "sit: nexthop == NULL\n"); goto tx_error; @@ -907,7 +907,7 @@ } t = ipip6_tunnel_locate(net, &p, 0); } - if (t == NULL) + if (!t) t = netdev_priv(dev); err = -EFAULT; @@ -950,7 +950,7 @@ t = ipip6_tunnel_locate(net, &p, cmd == SIOCADDTUNNEL); if (dev != sitn->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) { - if (t != NULL) { + if (t) { if (t->dev != dev) { err = -EEXIST; break; @@ -1000,7 +1000,8 @@ if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) goto done; err = -ENOENT; - if ((t = ipip6_tunnel_locate(net, &p, 0)) == NULL) + t = ipip6_tunnel_locate(net, &p, 0); + if (!t) goto done; err = -EPERM; if (t == netdev_priv(sitn->fb_tunnel_dev)) @@ -1200,7 +1201,7 @@ struct ip_tunnel *t; t = rtnl_dereference(sitn->tunnels[prio][h]); - while (t != NULL) { + while (t) { unregister_netdevice_queue(t->dev, head); t = rtnl_dereference(t->next); } @@ -1231,8 +1232,8 @@ goto err_dev_free; ipip6_tunnel_clone_6rd(sitn->fb_tunnel_dev, sitn); - - if ((err = register_netdev(sitn->fb_tunnel_dev))) + err = register_netdev(sitn->fb_tunnel_dev); + if (err) goto err_reg_dev; return 0;