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>
This commit is contained in:

committed by
David S. Miller

parent
11a9c7821c
commit
51456b2914
@@ -692,7 +692,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
|
||||
hlen = LL_RESERVED_SPACE(dev);
|
||||
tlen = dev->needed_tailroom;
|
||||
skb = alloc_skb(IGMP_SIZE + hlen + tlen, GFP_ATOMIC);
|
||||
if (skb == NULL) {
|
||||
if (!skb) {
|
||||
ip_rt_put(rt);
|
||||
return -1;
|
||||
}
|
||||
@@ -981,7 +981,7 @@ int igmp_rcv(struct sk_buff *skb)
|
||||
int len = skb->len;
|
||||
bool dropped = true;
|
||||
|
||||
if (in_dev == NULL)
|
||||
if (!in_dev)
|
||||
goto drop;
|
||||
|
||||
if (!pskb_may_pull(skb, sizeof(struct igmphdr)))
|
||||
@@ -1888,7 +1888,7 @@ int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr)
|
||||
if (count >= sysctl_igmp_max_memberships)
|
||||
goto done;
|
||||
iml = sock_kmalloc(sk, sizeof(*iml), GFP_KERNEL);
|
||||
if (iml == NULL)
|
||||
if (!iml)
|
||||
goto done;
|
||||
|
||||
memcpy(&iml->multi, imr, sizeof(*imr));
|
||||
@@ -1909,7 +1909,7 @@ static int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml,
|
||||
struct ip_sf_socklist *psf = rtnl_dereference(iml->sflist);
|
||||
int err;
|
||||
|
||||
if (psf == NULL) {
|
||||
if (!psf) {
|
||||
/* any-source empty exclude case */
|
||||
return ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr,
|
||||
iml->sfmode, 0, NULL, 0);
|
||||
@@ -2360,7 +2360,7 @@ void ip_mc_drop_socket(struct sock *sk)
|
||||
struct ip_mc_socklist *iml;
|
||||
struct net *net = sock_net(sk);
|
||||
|
||||
if (inet->mc_list == NULL)
|
||||
if (!inet->mc_list)
|
||||
return;
|
||||
|
||||
rtnl_lock();
|
||||
@@ -2587,7 +2587,7 @@ static inline struct ip_sf_list *igmp_mcf_get_first(struct seq_file *seq)
|
||||
for_each_netdev_rcu(net, state->dev) {
|
||||
struct in_device *idev;
|
||||
idev = __in_dev_get_rcu(state->dev);
|
||||
if (unlikely(idev == NULL))
|
||||
if (unlikely(!idev))
|
||||
continue;
|
||||
im = rcu_dereference(idev->mc_list);
|
||||
if (likely(im != NULL)) {
|
||||
|
Reference in New Issue
Block a user