Commit d2c3c8dc authored by Joe Perches's avatar Joe Perches Committed by Mike Snitzer

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 7e3fd855
...@@ -543,48 +543,41 @@ extern struct ratelimit_state dm_ratelimit_state; ...@@ -543,48 +543,41 @@ extern struct ratelimit_state dm_ratelimit_state;
#define dm_ratelimit() 0 #define dm_ratelimit() 0
#endif #endif
#define DMCRIT(f, arg...) \ #define DM_FMT(fmt) DM_NAME ": " DM_MSG_PREFIX ": " fmt "\n"
printk(KERN_CRIT DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg)
#define DMCRIT(fmt, ...) pr_crit(DM_FMT(fmt), ##__VA_ARGS__)
#define DMERR(f, arg...) \
printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) #define DMERR(fmt, ...) pr_err(DM_FMT(fmt), ##__VA_ARGS__)
#define DMERR_LIMIT(f, arg...) \ #define DMERR_LIMIT(fmt, ...) \
do { \ do { \
if (dm_ratelimit()) \ if (dm_ratelimit()) \
printk(KERN_ERR DM_NAME ": " DM_MSG_PREFIX ": " \ DMERR(fmt, ##__VA_ARGS__); \
f "\n", ## arg); \ } while (0)
} while (0)
#define DMWARN(fmt, ...) pr_warn(DM_FMT(fmt), ##__VA_ARGS__)
#define DMWARN(f, arg...) \ #define DMWARN_LIMIT(fmt, ...) \
printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) do { \
#define DMWARN_LIMIT(f, arg...) \ if (dm_ratelimit()) \
do { \ DMWARN(fmt, ##__VA_ARGS__); \
if (dm_ratelimit()) \ } while (0)
printk(KERN_WARNING DM_NAME ": " DM_MSG_PREFIX ": " \
f "\n", ## arg); \ #define DMINFO(fmt, ...) pr_info(DM_FMT(fmt), ##__VA_ARGS__)
} while (0) #define DMINFO_LIMIT(fmt, ...) \
do { \
#define DMINFO(f, arg...) \ if (dm_ratelimit()) \
printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f "\n", ## arg) DMINFO(fmt, ##__VA_ARGS__); \
#define DMINFO_LIMIT(f, arg...) \ } while (0)
do { \
if (dm_ratelimit()) \
printk(KERN_INFO DM_NAME ": " DM_MSG_PREFIX ": " f \
"\n", ## arg); \
} while (0)
#ifdef CONFIG_DM_DEBUG #ifdef CONFIG_DM_DEBUG
# define DMDEBUG(f, arg...) \ #define DMDEBUG(fmt, ...) printk(KERN_DEBUG DM_FMT(fmt), ##__VA_ARGS__)
printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX " DEBUG: " f "\n", ## arg) #define DMDEBUG_LIMIT(fmt, ...) \
# define DMDEBUG_LIMIT(f, arg...) \ do { \
do { \ if (dm_ratelimit()) \
if (dm_ratelimit()) \ DMDEBUG(fmt, ##__VA_ARGS__); \
printk(KERN_DEBUG DM_NAME ": " DM_MSG_PREFIX ": " f \ } while (0)
"\n", ## arg); \
} while (0)
#else #else
# define DMDEBUG(f, arg...) do {} while (0) #define DMDEBUG(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
# define DMDEBUG_LIMIT(f, arg...) do {} while (0) #define DMDEBUG_LIMIT(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
#endif #endif
#define DMEMIT(x...) sz += ((sz >= maxlen) ? \ #define DMEMIT(x...) sz += ((sz >= maxlen) ? \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment