diff options
author | Joe Perches <joe@perches.com> | 2017-04-20 10:46:07 -0700 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2017-06-19 11:03:50 -0400 |
commit | d2c3c8dcb5987b8352e82089c79a41b6e17e28d2 (patch) | |
tree | a9a3b736ee8ddb6b8f44aae99479897a781270c2 | |
parent | 7e3fd855ad66ffc0dd926911da23dd21e59f9462 (diff) | |
download | linux-stable-d2c3c8dcb5987b8352e82089c79a41b6e17e28d2.tar.gz linux-stable-d2c3c8dcb5987b8352e82089c79a41b6e17e28d2.tar.bz2 linux-stable-d2c3c8dcb5987b8352e82089c79a41b6e17e28d2.zip |
dm: convert DM printk macros to pr_<level> macros
Using pr_<level> is the more common logging style.
Standardize style and use new macro DM_FMT.
Use no_printk in DMDEBUG macros when CONFIG_DM_DEBUG is not #defined.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r-- | include/linux/device-mapper.h | 71 |
1 files changed, 32 insertions, 39 deletions
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 456da5017b32..19bc7fdfd6da 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -543,48 +543,41 @@ extern struct ratelimit_state dm_ratelimit_state; #define dm_ratelimit() 0 #endif -#define DMCRIT(f, arg...) \ - printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) - -#define DMERR(f, arg...) \ - printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) -#define DMERR_LIMIT(f, arg...) \ - do { \ - if (dm_ratelimit()) \ - printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \ - f "\n", ## arg); \ - } while (0) - -#define DMWARN(f, arg...) \ - printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) -#define DMWARN_LIMIT(f, arg...) \ - do { \ - if (dm_ratelimit()) \ - printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \ - f "\n", ## arg); \ - } while (0) - -#define DMINFO(f, arg...) \ - printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) -#define DMINFO_LIMIT(f, arg...) \ - do { \ - if (dm_ratelimit()) \ - printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \ - "\n", ## arg); \ - } while (0) +#define DM_FMT(fmt) DM_NAME ": " DM_MSG_PREFIX ": " fmt "\n" + +#define DMCRIT(fmt, ...) pr_crit(DM_FMT(fmt), ##__VA_ARGS__) + +#define DMERR(fmt, ...) pr_err(DM_FMT(fmt), ##__VA_ARGS__) +#define DMERR_LIMIT(fmt, ...) \ +do { \ + if (dm_ratelimit()) \ + DMERR(fmt, ##__VA_ARGS__); \ +} while (0) + +#define DMWARN(fmt, ...) pr_warn(DM_FMT(fmt), ##__VA_ARGS__) +#define DMWARN_LIMIT(fmt, ...) \ +do { \ + if (dm_ratelimit()) \ + DMWARN(fmt, ##__VA_ARGS__); \ +} while (0) + +#define DMINFO(fmt, ...) pr_info(DM_FMT(fmt), ##__VA_ARGS__) +#define DMINFO_LIMIT(fmt, ...) \ +do { \ + if (dm_ratelimit()) \ + DMINFO(fmt, ##__VA_ARGS__); \ +} while (0) #ifdef CONFIG_DM_DEBUG -# define DMDEBUG(f, arg...) \ - printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg) -# define DMDEBUG_LIMIT(f, arg...) \ - do { \ - if (dm_ratelimit()) \ - printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \ - "\n", ## arg); \ - } while (0) +#define DMDEBUG(fmt, ...) printk(KERN_DEBUG DM_FMT(fmt), ##__VA_ARGS__) +#define DMDEBUG_LIMIT(fmt, ...) \ +do { \ + if (dm_ratelimit()) \ + DMDEBUG(fmt, ##__VA_ARGS__); \ +} while (0) #else -# define DMDEBUG(f, arg...) do {} while (0) -# define DMDEBUG_LIMIT(f, arg...) do {} while (0) +#define DMDEBUG(fmt, ...) no_printk(fmt, ##__VA_ARGS__) +#define DMDEBUG_LIMIT(fmt, ...) no_printk(fmt, ##__VA_ARGS__) #endif #define DMEMIT(x...) sz += ((sz >= maxlen) ? \ |