diff options
author | Joe Perches <joe@perches.com> | 2010-08-24 09:21:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-26 17:11:48 -0400 |
commit | 145ce502e44b57c074c72cfdc855557e19026999 (patch) | |
tree | fd663feae03f5c5f4a31ceecd6a61e790344b8b3 /net/sctp/socket.c | |
parent | dee06e4702b5a64b9ca81e650d66223c5b3e7f14 (diff) |
net/sctp: Use pr_fmt and pr_<level>
Change SCTP_DEBUG_PRINTK and SCTP_DEBUG_PRINTK_IPADDR to
use do { print } while (0) guards.
Add SCTP_DEBUG_PRINTK_CONT to fix errors in log when
lines were continued.
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Add a missing newline in "Failed bind hash alloc"
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index ca44917872d2..f4bec2772351 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -57,6 +57,8 @@ | |||
57 | * be incorporated into the next SCTP release. | 57 | * be incorporated into the next SCTP release. |
58 | */ | 58 | */ |
59 | 59 | ||
60 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
61 | |||
60 | #include <linux/types.h> | 62 | #include <linux/types.h> |
61 | #include <linux/kernel.h> | 63 | #include <linux/kernel.h> |
62 | #include <linux/wait.h> | 64 | #include <linux/wait.h> |
@@ -2458,9 +2460,8 @@ static int sctp_setsockopt_delayed_ack(struct sock *sk, | |||
2458 | if (params.sack_delay == 0 && params.sack_freq == 0) | 2460 | if (params.sack_delay == 0 && params.sack_freq == 0) |
2459 | return 0; | 2461 | return 0; |
2460 | } else if (optlen == sizeof(struct sctp_assoc_value)) { | 2462 | } else if (optlen == sizeof(struct sctp_assoc_value)) { |
2461 | printk(KERN_WARNING "SCTP: Use of struct sctp_assoc_value " | 2463 | pr_warn("Use of struct sctp_assoc_value in delayed_ack socket option deprecated\n"); |
2462 | "in delayed_ack socket option deprecated\n"); | 2464 | pr_warn("Use struct sctp_sack_info instead\n"); |
2463 | printk(KERN_WARNING "SCTP: Use struct sctp_sack_info instead\n"); | ||
2464 | if (copy_from_user(¶ms, optval, optlen)) | 2465 | if (copy_from_user(¶ms, optval, optlen)) |
2465 | return -EFAULT; | 2466 | return -EFAULT; |
2466 | 2467 | ||
@@ -2868,10 +2869,8 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, unsigned | |||
2868 | int val; | 2869 | int val; |
2869 | 2870 | ||
2870 | if (optlen == sizeof(int)) { | 2871 | if (optlen == sizeof(int)) { |
2871 | printk(KERN_WARNING | 2872 | pr_warn("Use of int in maxseg socket option deprecated\n"); |
2872 | "SCTP: Use of int in maxseg socket option deprecated\n"); | 2873 | pr_warn("Use struct sctp_assoc_value instead\n"); |
2873 | printk(KERN_WARNING | ||
2874 | "SCTP: Use struct sctp_assoc_value instead\n"); | ||
2875 | if (copy_from_user(&val, optval, optlen)) | 2874 | if (copy_from_user(&val, optval, optlen)) |
2876 | return -EFAULT; | 2875 | return -EFAULT; |
2877 | params.assoc_id = 0; | 2876 | params.assoc_id = 0; |
@@ -3121,10 +3120,8 @@ static int sctp_setsockopt_maxburst(struct sock *sk, | |||
3121 | int assoc_id = 0; | 3120 | int assoc_id = 0; |
3122 | 3121 | ||
3123 | if (optlen == sizeof(int)) { | 3122 | if (optlen == sizeof(int)) { |
3124 | printk(KERN_WARNING | 3123 | pr_warn("Use of int in max_burst socket option deprecated\n"); |
3125 | "SCTP: Use of int in max_burst socket option deprecated\n"); | 3124 | pr_warn("Use struct sctp_assoc_value instead\n"); |
3126 | printk(KERN_WARNING | ||
3127 | "SCTP: Use struct sctp_assoc_value instead\n"); | ||
3128 | if (copy_from_user(&val, optval, optlen)) | 3125 | if (copy_from_user(&val, optval, optlen)) |
3129 | return -EFAULT; | 3126 | return -EFAULT; |
3130 | } else if (optlen == sizeof(struct sctp_assoc_value)) { | 3127 | } else if (optlen == sizeof(struct sctp_assoc_value)) { |
@@ -4281,9 +4278,8 @@ static int sctp_getsockopt_delayed_ack(struct sock *sk, int len, | |||
4281 | if (copy_from_user(¶ms, optval, len)) | 4278 | if (copy_from_user(¶ms, optval, len)) |
4282 | return -EFAULT; | 4279 | return -EFAULT; |
4283 | } else if (len == sizeof(struct sctp_assoc_value)) { | 4280 | } else if (len == sizeof(struct sctp_assoc_value)) { |
4284 | printk(KERN_WARNING "SCTP: Use of struct sctp_assoc_value " | 4281 | pr_warn("Use of struct sctp_assoc_value in delayed_ack socket option deprecated\n"); |
4285 | "in delayed_ack socket option deprecated\n"); | 4282 | pr_warn("Use struct sctp_sack_info instead\n"); |
4286 | printk(KERN_WARNING "SCTP: Use struct sctp_sack_info instead\n"); | ||
4287 | if (copy_from_user(¶ms, optval, len)) | 4283 | if (copy_from_user(¶ms, optval, len)) |
4288 | return -EFAULT; | 4284 | return -EFAULT; |
4289 | } else | 4285 | } else |
@@ -4929,10 +4925,8 @@ static int sctp_getsockopt_maxseg(struct sock *sk, int len, | |||
4929 | struct sctp_association *asoc; | 4925 | struct sctp_association *asoc; |
4930 | 4926 | ||
4931 | if (len == sizeof(int)) { | 4927 | if (len == sizeof(int)) { |
4932 | printk(KERN_WARNING | 4928 | pr_warn("Use of int in maxseg socket option deprecated\n"); |
4933 | "SCTP: Use of int in maxseg socket option deprecated\n"); | 4929 | pr_warn("Use struct sctp_assoc_value instead\n"); |
4934 | printk(KERN_WARNING | ||
4935 | "SCTP: Use struct sctp_assoc_value instead\n"); | ||
4936 | params.assoc_id = 0; | 4930 | params.assoc_id = 0; |
4937 | } else if (len >= sizeof(struct sctp_assoc_value)) { | 4931 | } else if (len >= sizeof(struct sctp_assoc_value)) { |
4938 | len = sizeof(struct sctp_assoc_value); | 4932 | len = sizeof(struct sctp_assoc_value); |
@@ -5023,10 +5017,8 @@ static int sctp_getsockopt_maxburst(struct sock *sk, int len, | |||
5023 | struct sctp_association *asoc; | 5017 | struct sctp_association *asoc; |
5024 | 5018 | ||
5025 | if (len == sizeof(int)) { | 5019 | if (len == sizeof(int)) { |
5026 | printk(KERN_WARNING | 5020 | pr_warn("Use of int in max_burst socket option deprecated\n"); |
5027 | "SCTP: Use of int in max_burst socket option deprecated\n"); | 5021 | pr_warn("Use struct sctp_assoc_value instead\n"); |
5028 | printk(KERN_WARNING | ||
5029 | "SCTP: Use struct sctp_assoc_value instead\n"); | ||
5030 | params.assoc_id = 0; | 5022 | params.assoc_id = 0; |
5031 | } else if (len >= sizeof(struct sctp_assoc_value)) { | 5023 | } else if (len >= sizeof(struct sctp_assoc_value)) { |
5032 | len = sizeof(struct sctp_assoc_value); | 5024 | len = sizeof(struct sctp_assoc_value); |
@@ -5586,8 +5578,7 @@ SCTP_STATIC int sctp_listen_start(struct sock *sk, int backlog) | |||
5586 | tfm = crypto_alloc_hash(sctp_hmac_alg, 0, CRYPTO_ALG_ASYNC); | 5578 | tfm = crypto_alloc_hash(sctp_hmac_alg, 0, CRYPTO_ALG_ASYNC); |
5587 | if (IS_ERR(tfm)) { | 5579 | if (IS_ERR(tfm)) { |
5588 | if (net_ratelimit()) { | 5580 | if (net_ratelimit()) { |
5589 | printk(KERN_INFO | 5581 | pr_info("failed to load transform for %s: %ld\n", |
5590 | "SCTP: failed to load transform for %s: %ld\n", | ||
5591 | sctp_hmac_alg, PTR_ERR(tfm)); | 5582 | sctp_hmac_alg, PTR_ERR(tfm)); |
5592 | } | 5583 | } |
5593 | return -ENOSYS; | 5584 | return -ENOSYS; |