diff options
author | Eldad Zack <eldad@fogrefinery.com> | 2012-05-05 06:13:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-11 18:04:53 -0400 |
commit | 647c0c70e8a44e359d1d90d9d067d0b6b611076a (patch) | |
tree | 4b700190bdb12c3dceb3413a6733b6c1559a879c /net/ipv6/af_inet6.c | |
parent | b943fbb09036bf7ff8e780af511a21576fe60a1e (diff) |
net/ipv6/af_inet6.c: checkpatch cleanup
af_inet6.c:80: ERROR: do not initialise statics to 0 or NULL
af_inet6.c:259: ERROR: spaces required around that '=' (ctx:VxV)
af_inet6.c:394: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:412: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:422: ERROR: do not use assignment in if condition
af_inet6.c:425: ERROR: do not use assignment in if condition
af_inet6.c:433: ERROR: do not use assignment in if condition
af_inet6.c:437: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:446: ERROR: spaces required around that '=' (ctx:VxV)
af_inet6.c:478: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:485: ERROR: that open brace { should be on the previous line
af_inet6.c:485: ERROR: space required before the open parenthesis '('
af_inet6.c:513: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:629: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:647: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:687: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:709: WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
af_inet6.c:1073: ERROR: space required before the open parenthesis '('
Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r-- | net/ipv6/af_inet6.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 0ad046c7ae95..bf8e14659e2d 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -77,7 +77,7 @@ struct ipv6_params ipv6_defaults = { | |||
77 | .autoconf = 1, | 77 | .autoconf = 1, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | static int disable_ipv6_mod = 0; | 80 | static int disable_ipv6_mod; |
81 | 81 | ||
82 | module_param_named(disable, disable_ipv6_mod, int, 0444); | 82 | module_param_named(disable, disable_ipv6_mod, int, 0444); |
83 | MODULE_PARM_DESC(disable, "Disable IPv6 module such that it is non-functional"); | 83 | MODULE_PARM_DESC(disable, "Disable IPv6 module such that it is non-functional"); |
@@ -256,7 +256,7 @@ out_rcu_unlock: | |||
256 | /* bind for INET6 API */ | 256 | /* bind for INET6 API */ |
257 | int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | 257 | int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) |
258 | { | 258 | { |
259 | struct sockaddr_in6 *addr=(struct sockaddr_in6 *)uaddr; | 259 | struct sockaddr_in6 *addr = (struct sockaddr_in6 *)uaddr; |
260 | struct sock *sk = sock->sk; | 260 | struct sock *sk = sock->sk; |
261 | struct inet_sock *inet = inet_sk(sk); | 261 | struct inet_sock *inet = inet_sk(sk); |
262 | struct ipv6_pinfo *np = inet6_sk(sk); | 262 | struct ipv6_pinfo *np = inet6_sk(sk); |
@@ -390,7 +390,6 @@ out_unlock: | |||
390 | rcu_read_unlock(); | 390 | rcu_read_unlock(); |
391 | goto out; | 391 | goto out; |
392 | } | 392 | } |
393 | |||
394 | EXPORT_SYMBOL(inet6_bind); | 393 | EXPORT_SYMBOL(inet6_bind); |
395 | 394 | ||
396 | int inet6_release(struct socket *sock) | 395 | int inet6_release(struct socket *sock) |
@@ -408,7 +407,6 @@ int inet6_release(struct socket *sock) | |||
408 | 407 | ||
409 | return inet_release(sock); | 408 | return inet_release(sock); |
410 | } | 409 | } |
411 | |||
412 | EXPORT_SYMBOL(inet6_release); | 410 | EXPORT_SYMBOL(inet6_release); |
413 | 411 | ||
414 | void inet6_destroy_sock(struct sock *sk) | 412 | void inet6_destroy_sock(struct sock *sk) |
@@ -419,10 +417,12 @@ void inet6_destroy_sock(struct sock *sk) | |||
419 | 417 | ||
420 | /* Release rx options */ | 418 | /* Release rx options */ |
421 | 419 | ||
422 | if ((skb = xchg(&np->pktoptions, NULL)) != NULL) | 420 | skb = xchg(&np->pktoptions, NULL); |
421 | if (skb != NULL) | ||
423 | kfree_skb(skb); | 422 | kfree_skb(skb); |
424 | 423 | ||
425 | if ((skb = xchg(&np->rxpmtu, NULL)) != NULL) | 424 | skb = xchg(&np->rxpmtu, NULL); |
425 | if (skb != NULL) | ||
426 | kfree_skb(skb); | 426 | kfree_skb(skb); |
427 | 427 | ||
428 | /* Free flowlabels */ | 428 | /* Free flowlabels */ |
@@ -430,10 +430,10 @@ void inet6_destroy_sock(struct sock *sk) | |||
430 | 430 | ||
431 | /* Free tx options */ | 431 | /* Free tx options */ |
432 | 432 | ||
433 | if ((opt = xchg(&np->opt, NULL)) != NULL) | 433 | opt = xchg(&np->opt, NULL); |
434 | if (opt != NULL) | ||
434 | sock_kfree_s(sk, opt, opt->tot_len); | 435 | sock_kfree_s(sk, opt, opt->tot_len); |
435 | } | 436 | } |
436 | |||
437 | EXPORT_SYMBOL_GPL(inet6_destroy_sock); | 437 | EXPORT_SYMBOL_GPL(inet6_destroy_sock); |
438 | 438 | ||
439 | /* | 439 | /* |
@@ -443,7 +443,7 @@ EXPORT_SYMBOL_GPL(inet6_destroy_sock); | |||
443 | int inet6_getname(struct socket *sock, struct sockaddr *uaddr, | 443 | int inet6_getname(struct socket *sock, struct sockaddr *uaddr, |
444 | int *uaddr_len, int peer) | 444 | int *uaddr_len, int peer) |
445 | { | 445 | { |
446 | struct sockaddr_in6 *sin=(struct sockaddr_in6 *)uaddr; | 446 | struct sockaddr_in6 *sin = (struct sockaddr_in6 *)uaddr; |
447 | struct sock *sk = sock->sk; | 447 | struct sock *sk = sock->sk; |
448 | struct inet_sock *inet = inet_sk(sk); | 448 | struct inet_sock *inet = inet_sk(sk); |
449 | struct ipv6_pinfo *np = inet6_sk(sk); | 449 | struct ipv6_pinfo *np = inet6_sk(sk); |
@@ -474,7 +474,6 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr, | |||
474 | *uaddr_len = sizeof(*sin); | 474 | *uaddr_len = sizeof(*sin); |
475 | return 0; | 475 | return 0; |
476 | } | 476 | } |
477 | |||
478 | EXPORT_SYMBOL(inet6_getname); | 477 | EXPORT_SYMBOL(inet6_getname); |
479 | 478 | ||
480 | int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | 479 | int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) |
@@ -482,8 +481,7 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
482 | struct sock *sk = sock->sk; | 481 | struct sock *sk = sock->sk; |
483 | struct net *net = sock_net(sk); | 482 | struct net *net = sock_net(sk); |
484 | 483 | ||
485 | switch(cmd) | 484 | switch (cmd) { |
486 | { | ||
487 | case SIOCGSTAMP: | 485 | case SIOCGSTAMP: |
488 | return sock_get_timestamp(sk, (struct timeval __user *)arg); | 486 | return sock_get_timestamp(sk, (struct timeval __user *)arg); |
489 | 487 | ||
@@ -509,7 +507,6 @@ int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | |||
509 | /*NOTREACHED*/ | 507 | /*NOTREACHED*/ |
510 | return 0; | 508 | return 0; |
511 | } | 509 | } |
512 | |||
513 | EXPORT_SYMBOL(inet6_ioctl); | 510 | EXPORT_SYMBOL(inet6_ioctl); |
514 | 511 | ||
515 | const struct proto_ops inet6_stream_ops = { | 512 | const struct proto_ops inet6_stream_ops = { |
@@ -625,7 +622,6 @@ out_illegal: | |||
625 | p->type); | 622 | p->type); |
626 | goto out; | 623 | goto out; |
627 | } | 624 | } |
628 | |||
629 | EXPORT_SYMBOL(inet6_register_protosw); | 625 | EXPORT_SYMBOL(inet6_register_protosw); |
630 | 626 | ||
631 | void | 627 | void |
@@ -643,7 +639,6 @@ inet6_unregister_protosw(struct inet_protosw *p) | |||
643 | synchronize_net(); | 639 | synchronize_net(); |
644 | } | 640 | } |
645 | } | 641 | } |
646 | |||
647 | EXPORT_SYMBOL(inet6_unregister_protosw); | 642 | EXPORT_SYMBOL(inet6_unregister_protosw); |
648 | 643 | ||
649 | int inet6_sk_rebuild_header(struct sock *sk) | 644 | int inet6_sk_rebuild_header(struct sock *sk) |
@@ -683,7 +678,6 @@ int inet6_sk_rebuild_header(struct sock *sk) | |||
683 | 678 | ||
684 | return 0; | 679 | return 0; |
685 | } | 680 | } |
686 | |||
687 | EXPORT_SYMBOL_GPL(inet6_sk_rebuild_header); | 681 | EXPORT_SYMBOL_GPL(inet6_sk_rebuild_header); |
688 | 682 | ||
689 | int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb) | 683 | int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb) |
@@ -705,7 +699,6 @@ int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb) | |||
705 | } | 699 | } |
706 | return 0; | 700 | return 0; |
707 | } | 701 | } |
708 | |||
709 | EXPORT_SYMBOL_GPL(ipv6_opt_accepted); | 702 | EXPORT_SYMBOL_GPL(ipv6_opt_accepted); |
710 | 703 | ||
711 | static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto) | 704 | static int ipv6_gso_pull_exthdrs(struct sk_buff *skb, int proto) |
@@ -1070,7 +1063,7 @@ static int __init inet6_init(void) | |||
1070 | BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb)); | 1063 | BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb)); |
1071 | 1064 | ||
1072 | /* Register the socket-side information for inet6_create. */ | 1065 | /* Register the socket-side information for inet6_create. */ |
1073 | for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r) | 1066 | for (r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r) |
1074 | INIT_LIST_HEAD(r); | 1067 | INIT_LIST_HEAD(r); |
1075 | 1068 | ||
1076 | if (disable_ipv6_mod) { | 1069 | if (disable_ipv6_mod) { |