Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53b24b8f authored by Ian Morris's avatar Ian Morris Committed by David S. Miller
Browse files

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: default avatarIan Morris <ipm@chirality.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 63159f29
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -140,7 +140,7 @@ void in6_dev_finish_destroy(struct inet6_dev *idev)
	struct net_device *dev = idev->dev;
	struct net_device *dev = idev->dev;


	WARN_ON(!list_empty(&idev->addr_list));
	WARN_ON(!list_empty(&idev->addr_list));
	WARN_ON(idev->mc_list != NULL);
	WARN_ON(idev->mc_list);
	WARN_ON(timer_pending(&idev->rs_timer));
	WARN_ON(timer_pending(&idev->rs_timer));


#ifdef NET_REFCNT_DEBUG
#ifdef NET_REFCNT_DEBUG
+3 −3
Original line number Original line Diff line number Diff line
@@ -413,11 +413,11 @@ void inet6_destroy_sock(struct sock *sk)
	/* Release rx options */
	/* Release rx options */


	skb = xchg(&np->pktoptions, NULL);
	skb = xchg(&np->pktoptions, NULL);
	if (skb != NULL)
	if (skb)
		kfree_skb(skb);
		kfree_skb(skb);


	skb = xchg(&np->rxpmtu, NULL);
	skb = xchg(&np->rxpmtu, NULL);
	if (skb != NULL)
	if (skb)
		kfree_skb(skb);
		kfree_skb(skb);


	/* Free flowlabels */
	/* Free flowlabels */
@@ -426,7 +426,7 @@ void inet6_destroy_sock(struct sock *sk)
	/* Free tx options */
	/* Free tx options */


	opt = xchg(&np->opt, NULL);
	opt = xchg(&np->opt, NULL);
	if (opt != NULL)
	if (opt)
		sock_kfree_s(sk, opt, opt->tot_len);
		sock_kfree_s(sk, opt, opt->tot_len);
}
}
EXPORT_SYMBOL_GPL(inet6_destroy_sock);
EXPORT_SYMBOL_GPL(inet6_destroy_sock);
+2 −2
Original line number Original line Diff line number Diff line
@@ -1206,7 +1206,7 @@ static struct fib6_node *fib6_repair_tree(struct net *net,


		WARN_ON(fn->fn_flags & RTN_RTINFO);
		WARN_ON(fn->fn_flags & RTN_RTINFO);
		WARN_ON(fn->fn_flags & RTN_TL_ROOT);
		WARN_ON(fn->fn_flags & RTN_TL_ROOT);
		WARN_ON(fn->leaf != NULL);
		WARN_ON(fn->leaf);


		children = 0;
		children = 0;
		child = NULL;
		child = NULL;
@@ -1361,7 +1361,7 @@ int fib6_del(struct rt6_info *rt, struct nl_info *info)


#if RT6_DEBUG >= 2
#if RT6_DEBUG >= 2
	if (rt->dst.obsolete > 0) {
	if (rt->dst.obsolete > 0) {
		WARN_ON(fn != NULL);
		WARN_ON(fn);
		return -ENOENT;
		return -ENOENT;
	}
	}
#endif
#endif
+3 −3
Original line number Original line Diff line number Diff line
@@ -219,7 +219,7 @@ static struct ip6_flowlabel *fl_intern(struct net *net,
		 * with the same label can only appear on another sock
		 * with the same label can only appear on another sock
		 */
		 */
		lfl = __fl_lookup(net, fl->label);
		lfl = __fl_lookup(net, fl->label);
		if (lfl != NULL) {
		if (lfl) {
			atomic_inc(&lfl->users);
			atomic_inc(&lfl->users);
			spin_unlock_bh(&ip6_fl_lock);
			spin_unlock_bh(&ip6_fl_lock);
			return lfl;
			return lfl;
@@ -300,7 +300,7 @@ struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions *opt_space,
	if (!fopt || fopt->opt_flen == 0)
	if (!fopt || fopt->opt_flen == 0)
		return fl_opt;
		return fl_opt;


	if (fl_opt != NULL) {
	if (fl_opt) {
		opt_space->hopopt = fl_opt->hopopt;
		opt_space->hopopt = fl_opt->hopopt;
		opt_space->dst0opt = fl_opt->dst0opt;
		opt_space->dst0opt = fl_opt->dst0opt;
		opt_space->srcrt = fl_opt->srcrt;
		opt_space->srcrt = fl_opt->srcrt;
@@ -661,7 +661,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen)
			goto done;
			goto done;


		fl1 = fl_intern(net, fl, freq.flr_label);
		fl1 = fl_intern(net, fl, freq.flr_label);
		if (fl1 != NULL)
		if (fl1)
			goto recheck;
			goto recheck;


		if (!freq.flr_label) {
		if (!freq.flr_label) {
+3 −3
Original line number Original line Diff line number Diff line
@@ -223,7 +223,7 @@ static struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev,
		}
		}
	}
	}


	if (cand != NULL)
	if (cand)
		return cand;
		return cand;


	dev = ign->fb_tunnel_dev;
	dev = ign->fb_tunnel_dev;
@@ -1105,7 +1105,7 @@ static int ip6gre_tunnel_ioctl(struct net_device *dev,
		t = ip6gre_tunnel_locate(net, &p1, cmd == SIOCADDTUNNEL);
		t = ip6gre_tunnel_locate(net, &p1, cmd == SIOCADDTUNNEL);


		if (dev != ign->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) {
		if (dev != ign->fb_tunnel_dev && cmd == SIOCCHGTUNNEL) {
			if (t != NULL) {
			if (t) {
				if (t->dev != dev) {
				if (t->dev != dev) {
					err = -EEXIST;
					err = -EEXIST;
					break;
					break;
@@ -1313,7 +1313,7 @@ static void ip6gre_destroy_tunnels(struct net *net, struct list_head *head)


			t = rtnl_dereference(ign->tunnels[prio][h]);
			t = rtnl_dereference(ign->tunnels[prio][h]);


			while (t != NULL) {
			while (t) {
				/* If dev is in the same netns, it has already
				/* If dev is in the same netns, it has already
				 * been added to the list by the previous loop.
				 * been added to the list by the previous loop.
				 */
				 */
Loading