diff options
author | Joe Perches <joe@perches.com> | 2014-11-11 16:37:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-11 18:11:00 -0500 |
commit | 6c91023dc35c88d5e6aebe4bfe6f1ed5ec2b84be (patch) | |
tree | 2f33e40962dd622ae926ff7e8284f3ef540d3ca9 /net/irda/parameters.c | |
parent | 09626e9d153326ca82568e4e27f2daa53713992e (diff) |
irda: Remove IRDA_<TYPE> logging macros
And use the more common mechanisms directly.
Other miscellanea:
o Coalesce formats
o Add missing newlines
o Realign arguments
o Remove unnecessary OOM message logging as
there's a generic stack dump already on OOM.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda/parameters.c')
-rw-r--r-- | net/irda/parameters.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/net/irda/parameters.c b/net/irda/parameters.c index 6d0869716bf6..d7a5778262ef 100644 --- a/net/irda/parameters.c +++ b/net/irda/parameters.c | |||
@@ -158,8 +158,8 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, | |||
158 | } | 158 | } |
159 | /* Check if buffer is long enough for insertion */ | 159 | /* Check if buffer is long enough for insertion */ |
160 | if (len < (2+p.pl)) { | 160 | if (len < (2+p.pl)) { |
161 | IRDA_WARNING("%s: buffer too short for insertion!\n", | 161 | net_warn_ratelimited("%s: buffer too short for insertion!\n", |
162 | __func__); | 162 | __func__); |
163 | return -1; | 163 | return -1; |
164 | } | 164 | } |
165 | IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __func__, | 165 | IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d, pi=%d\n", __func__, |
@@ -184,8 +184,8 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, | |||
184 | 184 | ||
185 | break; | 185 | break; |
186 | default: | 186 | default: |
187 | IRDA_WARNING("%s: length %d not supported\n", | 187 | net_warn_ratelimited("%s: length %d not supported\n", |
188 | __func__, p.pl); | 188 | __func__, p.pl); |
189 | /* Skip parameter */ | 189 | /* Skip parameter */ |
190 | return -1; | 190 | return -1; |
191 | } | 191 | } |
@@ -214,9 +214,8 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, | |||
214 | 214 | ||
215 | /* Check if buffer is long enough for parsing */ | 215 | /* Check if buffer is long enough for parsing */ |
216 | if (len < (2+p.pl)) { | 216 | if (len < (2+p.pl)) { |
217 | IRDA_WARNING("%s: buffer too short for parsing! " | 217 | net_warn_ratelimited("%s: buffer too short for parsing! Need %d bytes, but len is only %d\n", |
218 | "Need %d bytes, but len is only %d\n", | 218 | __func__, p.pl, len); |
219 | __func__, p.pl, len); | ||
220 | return -1; | 219 | return -1; |
221 | } | 220 | } |
222 | 221 | ||
@@ -226,9 +225,8 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, | |||
226 | * PV_INTEGER means that the handler is flexible. | 225 | * PV_INTEGER means that the handler is flexible. |
227 | */ | 226 | */ |
228 | if (((type & PV_MASK) != PV_INTEGER) && ((type & PV_MASK) != p.pl)) { | 227 | if (((type & PV_MASK) != PV_INTEGER) && ((type & PV_MASK) != p.pl)) { |
229 | IRDA_ERROR("%s: invalid parameter length! " | 228 | net_err_ratelimited("%s: invalid parameter length! Expected %d bytes, but value had %d bytes!\n", |
230 | "Expected %d bytes, but value had %d bytes!\n", | 229 | __func__, type & PV_MASK, p.pl); |
231 | __func__, type & PV_MASK, p.pl); | ||
232 | 230 | ||
233 | /* Most parameters are bit/byte fields or little endian, | 231 | /* Most parameters are bit/byte fields or little endian, |
234 | * so it's ok to only extract a subset of it (the subset | 232 | * so it's ok to only extract a subset of it (the subset |
@@ -265,8 +263,8 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, | |||
265 | le32_to_cpus(&p.pv.i); | 263 | le32_to_cpus(&p.pv.i); |
266 | break; | 264 | break; |
267 | default: | 265 | default: |
268 | IRDA_WARNING("%s: length %d not supported\n", | 266 | net_warn_ratelimited("%s: length %d not supported\n", |
269 | __func__, p.pl); | 267 | __func__, p.pl); |
270 | 268 | ||
271 | /* Skip parameter */ | 269 | /* Skip parameter */ |
272 | return p.pl+2; | 270 | return p.pl+2; |
@@ -304,9 +302,8 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi, | |||
304 | 302 | ||
305 | /* Check if buffer is long enough for parsing */ | 303 | /* Check if buffer is long enough for parsing */ |
306 | if (len < (2+p.pl)) { | 304 | if (len < (2+p.pl)) { |
307 | IRDA_WARNING("%s: buffer too short for parsing! " | 305 | net_warn_ratelimited("%s: buffer too short for parsing! Need %d bytes, but len is only %d\n", |
308 | "Need %d bytes, but len is only %d\n", | 306 | __func__, p.pl, len); |
309 | __func__, p.pl, len); | ||
310 | return -1; | 307 | return -1; |
311 | } | 308 | } |
312 | 309 | ||
@@ -343,9 +340,8 @@ static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi, | |||
343 | 340 | ||
344 | /* Check if buffer is long enough for parsing */ | 341 | /* Check if buffer is long enough for parsing */ |
345 | if (len < (2+p.pl)) { | 342 | if (len < (2+p.pl)) { |
346 | IRDA_WARNING("%s: buffer too short for parsing! " | 343 | net_warn_ratelimited("%s: buffer too short for parsing! Need %d bytes, but len is only %d\n", |
347 | "Need %d bytes, but len is only %d\n", | 344 | __func__, p.pl, len); |
348 | __func__, p.pl, len); | ||
349 | return -1; | 345 | return -1; |
350 | } | 346 | } |
351 | 347 | ||
@@ -487,7 +483,8 @@ int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len, | |||
487 | 483 | ||
488 | /* Check if handler has been implemented */ | 484 | /* Check if handler has been implemented */ |
489 | if (!pi_minor_info->func) { | 485 | if (!pi_minor_info->func) { |
490 | IRDA_MESSAGE("%s: no handler for pi=%#x\n", __func__, pi); | 486 | net_info_ratelimited("%s: no handler for pi=%#x\n", |
487 | __func__, pi); | ||
491 | /* Skip this parameter */ | 488 | /* Skip this parameter */ |
492 | return -1; | 489 | return -1; |
493 | } | 490 | } |
@@ -544,8 +541,8 @@ static int irda_param_extract(void *self, __u8 *buf, int len, | |||
544 | 541 | ||
545 | /* Check if handler has been implemented */ | 542 | /* Check if handler has been implemented */ |
546 | if (!pi_minor_info->func) { | 543 | if (!pi_minor_info->func) { |
547 | IRDA_MESSAGE("%s: no handler for pi=%#x\n", | 544 | net_info_ratelimited("%s: no handler for pi=%#x\n", |
548 | __func__, buf[n]); | 545 | __func__, buf[n]); |
549 | /* Skip this parameter */ | 546 | /* Skip this parameter */ |
550 | return 2 + buf[n + 1]; /* Continue */ | 547 | return 2 + buf[n + 1]; /* Continue */ |
551 | } | 548 | } |