diff options
author | Ian Morris <ipm@chirality.org.uk> | 2015-04-03 04:17:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-03 12:11:15 -0400 |
commit | 00db41243e8d5032c2e0f5bf6063bb19324bfdb3 (patch) | |
tree | 627f419868eac50f1ae8582915827b2525fc5999 /net/ipv4/igmp.c | |
parent | 51456b2914a34d16b1255b7c55d5cbf6a681d306 (diff) |
ipv4: coding style: comparison for inequality with NULL
The ipv4 code uses a mixture of coding styles. In some instances check
for non-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 27d204b834f9..a3a697f5ffba 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -2370,7 +2370,7 @@ void ip_mc_drop_socket(struct sock *sk) | |||
2370 | inet->mc_list = iml->next_rcu; | 2370 | inet->mc_list = iml->next_rcu; |
2371 | in_dev = inetdev_by_index(net, iml->multi.imr_ifindex); | 2371 | in_dev = inetdev_by_index(net, iml->multi.imr_ifindex); |
2372 | (void) ip_mc_leave_src(sk, iml, in_dev); | 2372 | (void) ip_mc_leave_src(sk, iml, in_dev); |
2373 | if (in_dev != NULL) | 2373 | if (in_dev) |
2374 | ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr); | 2374 | ip_mc_dec_group(in_dev, iml->multi.imr_multiaddr.s_addr); |
2375 | /* decrease mem now to avoid the memleak warning */ | 2375 | /* decrease mem now to avoid the memleak warning */ |
2376 | atomic_sub(sizeof(*iml), &sk->sk_omem_alloc); | 2376 | atomic_sub(sizeof(*iml), &sk->sk_omem_alloc); |
@@ -2590,10 +2590,10 @@ static inline struct ip_sf_list *igmp_mcf_get_first(struct seq_file *seq) | |||
2590 | if (unlikely(!idev)) | 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)) { |
2594 | spin_lock_bh(&im->lock); | 2594 | spin_lock_bh(&im->lock); |
2595 | psf = im->sources; | 2595 | psf = im->sources; |
2596 | if (likely(psf != NULL)) { | 2596 | if (likely(psf)) { |
2597 | state->im = im; | 2597 | state->im = im; |
2598 | state->idev = idev; | 2598 | state->idev = idev; |
2599 | break; | 2599 | break; |
@@ -2663,7 +2663,7 @@ static void igmp_mcf_seq_stop(struct seq_file *seq, void *v) | |||
2663 | __releases(rcu) | 2663 | __releases(rcu) |
2664 | { | 2664 | { |
2665 | struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq); | 2665 | struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq); |
2666 | if (likely(state->im != NULL)) { | 2666 | if (likely(state->im)) { |
2667 | spin_unlock_bh(&state->im->lock); | 2667 | spin_unlock_bh(&state->im->lock); |
2668 | state->im = NULL; | 2668 | state->im = NULL; |
2669 | } | 2669 | } |