diff options
Diffstat (limited to 'include/linux/kernel.h')
| -rw-r--r-- | include/linux/kernel.h | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 396a350b87a..dc7e0d0a647 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -116,6 +116,8 @@ extern int _cond_resched(void); | |||
| 116 | # define might_resched() do { } while (0) | 116 | # define might_resched() do { } while (0) |
| 117 | #endif | 117 | #endif |
| 118 | 118 | ||
| 119 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP | ||
| 120 | void __might_sleep(char *file, int line); | ||
| 119 | /** | 121 | /** |
| 120 | * might_sleep - annotation for functions that can sleep | 122 | * might_sleep - annotation for functions that can sleep |
| 121 | * | 123 | * |
| @@ -126,8 +128,6 @@ extern int _cond_resched(void); | |||
| 126 | * be bitten later when the calling function happens to sleep when it is not | 128 | * be bitten later when the calling function happens to sleep when it is not |
| 127 | * supposed to. | 129 | * supposed to. |
| 128 | */ | 130 | */ |
| 129 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP | ||
| 130 | void __might_sleep(char *file, int line); | ||
| 131 | # define might_sleep() \ | 131 | # define might_sleep() \ |
| 132 | do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0) | 132 | do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0) |
| 133 | #else | 133 | #else |
| @@ -318,32 +318,36 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 318 | return buf; | 318 | return buf; |
| 319 | } | 319 | } |
| 320 | 320 | ||
| 321 | #define pr_emerg(fmt, arg...) \ | 321 | #ifndef pr_fmt |
| 322 | printk(KERN_EMERG fmt, ##arg) | 322 | #define pr_fmt(fmt) fmt |
| 323 | #define pr_alert(fmt, arg...) \ | 323 | #endif |
| 324 | printk(KERN_ALERT fmt, ##arg) | 324 | |
| 325 | #define pr_crit(fmt, arg...) \ | 325 | #define pr_emerg(fmt, ...) \ |
| 326 | printk(KERN_CRIT fmt, ##arg) | 326 | printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__) |
| 327 | #define pr_err(fmt, arg...) \ | 327 | #define pr_alert(fmt, ...) \ |
| 328 | printk(KERN_ERR fmt, ##arg) | 328 | printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__) |
| 329 | #define pr_warning(fmt, arg...) \ | 329 | #define pr_crit(fmt, ...) \ |
| 330 | printk(KERN_WARNING fmt, ##arg) | 330 | printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) |
| 331 | #define pr_notice(fmt, arg...) \ | 331 | #define pr_err(fmt, ...) \ |
| 332 | printk(KERN_NOTICE fmt, ##arg) | 332 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) |
| 333 | #define pr_info(fmt, arg...) \ | 333 | #define pr_warning(fmt, ...) \ |
| 334 | printk(KERN_INFO fmt, ##arg) | 334 | printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) |
| 335 | #define pr_notice(fmt, ...) \ | ||
| 336 | printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) | ||
| 337 | #define pr_info(fmt, ...) \ | ||
| 338 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) | ||
| 335 | 339 | ||
| 336 | /* If you are writing a driver, please use dev_dbg instead */ | 340 | /* If you are writing a driver, please use dev_dbg instead */ |
| 337 | #if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) | 341 | #if defined(CONFIG_DYNAMIC_PRINTK_DEBUG) |
| 338 | #define pr_debug(fmt, ...) do { \ | 342 | #define pr_debug(fmt, ...) do { \ |
| 339 | dynamic_pr_debug(fmt, ##__VA_ARGS__); \ | 343 | dynamic_pr_debug(pr_fmt(fmt), ##__VA_ARGS__); \ |
| 340 | } while (0) | 344 | } while (0) |
| 341 | #elif defined(DEBUG) | 345 | #elif defined(DEBUG) |
| 342 | #define pr_debug(fmt, arg...) \ | 346 | #define pr_debug(fmt, ...) \ |
| 343 | printk(KERN_DEBUG fmt, ##arg) | 347 | printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) |
| 344 | #else | 348 | #else |
| 345 | #define pr_debug(fmt, arg...) \ | 349 | #define pr_debug(fmt, ...) \ |
| 346 | ({ if (0) printk(KERN_DEBUG fmt, ##arg); 0; }) | 350 | ({ if (0) printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); 0; }) |
| 347 | #endif | 351 | #endif |
| 348 | 352 | ||
| 349 | /* | 353 | /* |
