diff options
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r-- | include/linux/kernel.h | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 8eefcf7e95eb..e8b1597b5cf2 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -287,6 +287,8 @@ static inline int __must_check kstrtos32_from_user(const char __user *s, size_t | |||
287 | return kstrtoint_from_user(s, count, base, res); | 287 | return kstrtoint_from_user(s, count, base, res); |
288 | } | 288 | } |
289 | 289 | ||
290 | /* Obsolete, do not use. Use kstrto<foo> instead */ | ||
291 | |||
290 | extern unsigned long simple_strtoul(const char *,char **,unsigned int); | 292 | extern unsigned long simple_strtoul(const char *,char **,unsigned int); |
291 | extern long simple_strtol(const char *,char **,unsigned int); | 293 | extern long simple_strtol(const char *,char **,unsigned int); |
292 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); | 294 | extern unsigned long long simple_strtoull(const char *,char **,unsigned int); |
@@ -296,20 +298,20 @@ extern long long simple_strtoll(const char *,char **,unsigned int); | |||
296 | #define strict_strtoull kstrtoull | 298 | #define strict_strtoull kstrtoull |
297 | #define strict_strtoll kstrtoll | 299 | #define strict_strtoll kstrtoll |
298 | 300 | ||
299 | extern int sprintf(char * buf, const char * fmt, ...) | 301 | /* lib/printf utilities */ |
300 | __attribute__ ((format (printf, 2, 3))); | 302 | |
301 | extern int vsprintf(char *buf, const char *, va_list) | 303 | extern __printf(2, 3) int sprintf(char *buf, const char * fmt, ...); |
302 | __attribute__ ((format (printf, 2, 0))); | 304 | extern __printf(2, 0) int vsprintf(char *buf, const char *, va_list); |
303 | extern int snprintf(char * buf, size_t size, const char * fmt, ...) | 305 | extern __printf(3, 4) |
304 | __attribute__ ((format (printf, 3, 4))); | 306 | int snprintf(char *buf, size_t size, const char *fmt, ...); |
305 | extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | 307 | extern __printf(3, 0) |
306 | __attribute__ ((format (printf, 3, 0))); | 308 | int vsnprintf(char *buf, size_t size, const char *fmt, va_list args); |
307 | extern int scnprintf(char * buf, size_t size, const char * fmt, ...) | 309 | extern __printf(3, 4) |
308 | __attribute__ ((format (printf, 3, 4))); | 310 | int scnprintf(char *buf, size_t size, const char *fmt, ...); |
309 | extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) | 311 | extern __printf(3, 0) |
310 | __attribute__ ((format (printf, 3, 0))); | 312 | int vscnprintf(char *buf, size_t size, const char *fmt, va_list args); |
311 | extern char *kasprintf(gfp_t gfp, const char *fmt, ...) | 313 | extern __printf(2, 3) |
312 | __attribute__ ((format (printf, 2, 3))); | 314 | char *kasprintf(gfp_t gfp, const char *fmt, ...); |
313 | extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args); | 315 | extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args); |
314 | 316 | ||
315 | extern int sscanf(const char *, const char *, ...) | 317 | extern int sscanf(const char *, const char *, ...) |
@@ -369,18 +371,24 @@ extern enum system_states { | |||
369 | #define TAINT_WARN 9 | 371 | #define TAINT_WARN 9 |
370 | #define TAINT_CRAP 10 | 372 | #define TAINT_CRAP 10 |
371 | #define TAINT_FIRMWARE_WORKAROUND 11 | 373 | #define TAINT_FIRMWARE_WORKAROUND 11 |
374 | #define TAINT_OOT_MODULE 12 | ||
372 | 375 | ||
373 | extern const char hex_asc[]; | 376 | extern const char hex_asc[]; |
374 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] | 377 | #define hex_asc_lo(x) hex_asc[((x) & 0x0f)] |
375 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] | 378 | #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4] |
376 | 379 | ||
377 | static inline char *pack_hex_byte(char *buf, u8 byte) | 380 | static inline char *hex_byte_pack(char *buf, u8 byte) |
378 | { | 381 | { |
379 | *buf++ = hex_asc_hi(byte); | 382 | *buf++ = hex_asc_hi(byte); |
380 | *buf++ = hex_asc_lo(byte); | 383 | *buf++ = hex_asc_lo(byte); |
381 | return buf; | 384 | return buf; |
382 | } | 385 | } |
383 | 386 | ||
387 | static inline char * __deprecated pack_hex_byte(char *buf, u8 byte) | ||
388 | { | ||
389 | return hex_byte_pack(buf, byte); | ||
390 | } | ||
391 | |||
384 | extern int hex_to_bin(char ch); | 392 | extern int hex_to_bin(char ch); |
385 | extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); | 393 | extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); |
386 | 394 | ||
@@ -427,8 +435,8 @@ extern void tracing_start(void); | |||
427 | extern void tracing_stop(void); | 435 | extern void tracing_stop(void); |
428 | extern void ftrace_off_permanent(void); | 436 | extern void ftrace_off_permanent(void); |
429 | 437 | ||
430 | static inline void __attribute__ ((format (printf, 1, 2))) | 438 | static inline __printf(1, 2) |
431 | ____trace_printk_check_format(const char *fmt, ...) | 439 | void ____trace_printk_check_format(const char *fmt, ...) |
432 | { | 440 | { |
433 | } | 441 | } |
434 | #define __trace_printk_check_format(fmt, args...) \ | 442 | #define __trace_printk_check_format(fmt, args...) \ |
@@ -467,13 +475,11 @@ do { \ | |||
467 | __trace_printk(_THIS_IP_, fmt, ##args); \ | 475 | __trace_printk(_THIS_IP_, fmt, ##args); \ |
468 | } while (0) | 476 | } while (0) |
469 | 477 | ||
470 | extern int | 478 | extern __printf(2, 3) |
471 | __trace_bprintk(unsigned long ip, const char *fmt, ...) | 479 | int __trace_bprintk(unsigned long ip, const char *fmt, ...); |
472 | __attribute__ ((format (printf, 2, 3))); | ||
473 | 480 | ||
474 | extern int | 481 | extern __printf(2, 3) |
475 | __trace_printk(unsigned long ip, const char *fmt, ...) | 482 | int __trace_printk(unsigned long ip, const char *fmt, ...); |
476 | __attribute__ ((format (printf, 2, 3))); | ||
477 | 483 | ||
478 | extern void trace_dump_stack(void); | 484 | extern void trace_dump_stack(void); |
479 | 485 | ||
@@ -502,8 +508,8 @@ __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); | |||
502 | 508 | ||
503 | extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); | 509 | extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); |
504 | #else | 510 | #else |
505 | static inline int | 511 | static inline __printf(1, 2) |
506 | trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); | 512 | int trace_printk(const char *fmt, ...); |
507 | 513 | ||
508 | static inline void tracing_start(void) { } | 514 | static inline void tracing_start(void) { } |
509 | static inline void tracing_stop(void) { } | 515 | static inline void tracing_stop(void) { } |