diff options
author | Ian Morris <ipm@chirality.org.uk> | 2015-03-29 09:00:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-31 13:51:54 -0400 |
commit | 63159f29be1df7f93563a8a0f78c5e65fc844ed6 (patch) | |
tree | aba1b4275abb0692728b97851f2d52e07d3f6e94 /net/ipv6/ip6_flowlabel.c | |
parent | bc48878c06028f297e4fdf75be7dda88de050430 (diff) |
ipv6: coding style: comparison for equality 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: Ian Morris <ipm@chirality.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ip6_flowlabel.c')
-rw-r--r-- | net/ipv6/ip6_flowlabel.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index 457303886fd4..3f54ac5f05b8 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c | |||
@@ -205,7 +205,7 @@ static struct ip6_flowlabel *fl_intern(struct net *net, | |||
205 | fl->label = htonl(prandom_u32())&IPV6_FLOWLABEL_MASK; | 205 | fl->label = htonl(prandom_u32())&IPV6_FLOWLABEL_MASK; |
206 | if (fl->label) { | 206 | if (fl->label) { |
207 | lfl = __fl_lookup(net, fl->label); | 207 | lfl = __fl_lookup(net, fl->label); |
208 | if (lfl == NULL) | 208 | if (!lfl) |
209 | break; | 209 | break; |
210 | } | 210 | } |
211 | } | 211 | } |
@@ -297,7 +297,7 @@ struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions *opt_space, | |||
297 | { | 297 | { |
298 | struct ipv6_txoptions *fl_opt = fl->opt; | 298 | struct ipv6_txoptions *fl_opt = fl->opt; |
299 | 299 | ||
300 | if (fopt == NULL || fopt->opt_flen == 0) | 300 | if (!fopt || fopt->opt_flen == 0) |
301 | return fl_opt; | 301 | return fl_opt; |
302 | 302 | ||
303 | if (fl_opt != NULL) { | 303 | if (fl_opt != NULL) { |
@@ -366,7 +366,7 @@ fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq, | |||
366 | 366 | ||
367 | err = -ENOMEM; | 367 | err = -ENOMEM; |
368 | fl = kzalloc(sizeof(*fl), GFP_KERNEL); | 368 | fl = kzalloc(sizeof(*fl), GFP_KERNEL); |
369 | if (fl == NULL) | 369 | if (!fl) |
370 | goto done; | 370 | goto done; |
371 | 371 | ||
372 | if (olen > 0) { | 372 | if (olen > 0) { |
@@ -376,7 +376,7 @@ fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq, | |||
376 | 376 | ||
377 | err = -ENOMEM; | 377 | err = -ENOMEM; |
378 | fl->opt = kmalloc(sizeof(*fl->opt) + olen, GFP_KERNEL); | 378 | fl->opt = kmalloc(sizeof(*fl->opt) + olen, GFP_KERNEL); |
379 | if (fl->opt == NULL) | 379 | if (!fl->opt) |
380 | goto done; | 380 | goto done; |
381 | 381 | ||
382 | memset(fl->opt, 0, sizeof(*fl->opt)); | 382 | memset(fl->opt, 0, sizeof(*fl->opt)); |
@@ -596,7 +596,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen) | |||
596 | return -EINVAL; | 596 | return -EINVAL; |
597 | 597 | ||
598 | fl = fl_create(net, sk, &freq, optval, optlen, &err); | 598 | fl = fl_create(net, sk, &freq, optval, optlen, &err); |
599 | if (fl == NULL) | 599 | if (!fl) |
600 | return err; | 600 | return err; |
601 | sfl1 = kmalloc(sizeof(*sfl1), GFP_KERNEL); | 601 | sfl1 = kmalloc(sizeof(*sfl1), GFP_KERNEL); |
602 | 602 | ||
@@ -616,7 +616,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen) | |||
616 | } | 616 | } |
617 | rcu_read_unlock_bh(); | 617 | rcu_read_unlock_bh(); |
618 | 618 | ||
619 | if (fl1 == NULL) | 619 | if (!fl1) |
620 | fl1 = fl_lookup(net, freq.flr_label); | 620 | fl1 = fl_lookup(net, freq.flr_label); |
621 | if (fl1) { | 621 | if (fl1) { |
622 | recheck: | 622 | recheck: |
@@ -633,7 +633,7 @@ recheck: | |||
633 | goto release; | 633 | goto release; |
634 | 634 | ||
635 | err = -ENOMEM; | 635 | err = -ENOMEM; |
636 | if (sfl1 == NULL) | 636 | if (!sfl1) |
637 | goto release; | 637 | goto release; |
638 | if (fl->linger > fl1->linger) | 638 | if (fl->linger > fl1->linger) |
639 | fl1->linger = fl->linger; | 639 | fl1->linger = fl->linger; |
@@ -653,7 +653,7 @@ release: | |||
653 | goto done; | 653 | goto done; |
654 | 654 | ||
655 | err = -ENOMEM; | 655 | err = -ENOMEM; |
656 | if (sfl1 == NULL) | 656 | if (!sfl1) |
657 | goto done; | 657 | goto done; |
658 | 658 | ||
659 | err = mem_check(sk); | 659 | err = mem_check(sk); |