aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/igmp.c
diff options
context:
space:
mode:
authorIan Morris <ipm@chirality.org.uk>2015-04-03 04:17:26 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-03 12:11:15 -0400
commit51456b2914a34d16b1255b7c55d5cbf6a681d306 (patch)
treeb8f1135150269f591105f787fbf7c7d8c2307d3e /net/ipv4/igmp.c
parent11a9c7821c583aa22b35f37fba20539def9e8f14 (diff)
ipv4: coding style: comparison for equality with NULL
The ipv4 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/ipv4/igmp.c')
-rw-r--r--net/ipv4/igmp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index ad09213ac5b2..27d204b834f9 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -692,7 +692,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
692 hlen = LL_RESERVED_SPACE(dev); 692 hlen = LL_RESERVED_SPACE(dev);
693 tlen = dev->needed_tailroom; 693 tlen = dev->needed_tailroom;
694 skb = alloc_skb(IGMP_SIZE + hlen + tlen, GFP_ATOMIC); 694 skb = alloc_skb(IGMP_SIZE + hlen + tlen, GFP_ATOMIC);
695 if (skb == NULL) { 695 if (!skb) {
696 ip_rt_put(rt); 696 ip_rt_put(rt);
697 return -1; 697 return -1;
698 } 698 }
@@ -981,7 +981,7 @@ int igmp_rcv(struct sk_buff *skb)
981 int len = skb->len; 981 int len = skb->len;
982 bool dropped = true; 982 bool dropped = true;
983 983
984 if (in_dev == NULL) 984 if (!in_dev)
985 goto drop; 985 goto drop;
986 986
987 if (!pskb_may_pull(skb, sizeof(struct igmphdr))) 987 if (!pskb_may_pull(skb, sizeof(struct igmphdr)))
@@ -1888,7 +1888,7 @@ int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr)
1888 if (count >= sysctl_igmp_max_memberships) 1888 if (count >= sysctl_igmp_max_memberships)
1889 goto done; 1889 goto done;
1890 iml = sock_kmalloc(sk, sizeof(*iml), GFP_KERNEL); 1890 iml = sock_kmalloc(sk, sizeof(*iml), GFP_KERNEL);
1891 if (iml == NULL) 1891 if (!iml)
1892 goto done; 1892 goto done;
1893 1893
1894 memcpy(&iml->multi, imr, sizeof(*imr)); 1894 memcpy(&iml->multi, imr, sizeof(*imr));
@@ -1909,7 +1909,7 @@ static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
1909 struct ip_sf_socklist *psf = rtnl_dereference(iml->sflist); 1909 struct ip_sf_socklist *psf = rtnl_dereference(iml->sflist);
1910 int err; 1910 int err;
1911 1911
1912 if (psf == NULL) { 1912 if (!psf) {
1913 /* any-source empty exclude case */ 1913 /* any-source empty exclude case */
1914 return ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr, 1914 return ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr,
1915 iml->sfmode, 0, NULL, 0); 1915 iml->sfmode, 0, NULL, 0);
@@ -2360,7 +2360,7 @@ void ip_mc_drop_socket(struct sock *sk)
2360 struct ip_mc_socklist *iml; 2360 struct ip_mc_socklist *iml;
2361 struct net *net = sock_net(sk); 2361 struct net *net = sock_net(sk);
2362 2362
2363 if (inet->mc_list == NULL) 2363 if (!inet->mc_list)
2364 return; 2364 return;
2365 2365
2366 rtnl_lock(); 2366 rtnl_lock();
@@ -2587,7 +2587,7 @@ static inline struct ip_sf_list *igmp_mcf_get_first(struct seq_file *seq)
2587 for_each_netdev_rcu(net, state->dev) { 2587 for_each_netdev_rcu(net, state->dev) {
2588 struct in_device *idev; 2588 struct in_device *idev;
2589 idev = __in_dev_get_rcu(state->dev); 2589 idev = __in_dev_get_rcu(state->dev);
2590 if (unlikely(idev == NULL)) 2590 if (unlikely(!idev))
2591 continue; 2591 continue;
2592 im = rcu_dereference(idev->mc_list); 2592 im = rcu_dereference(idev->mc_list);
2593 if (likely(im != NULL)) { 2593 if (likely(im != NULL)) {