Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2018-07-09 18:43:31 +0800
committerColy Li <colyli@suse.de>2018-07-09 18:43:37 +0800
commit5258c8af12f832c9df05d3c6079c05f41deb4ae0 (patch)
tree17694590a4eb0af87e0cee25be2a7fc7376ace7b
parent74ebdcf3cf4ba35e0a7d6c3b5df58e65984139b9 (diff)
dm: convert DM printk macros to pr_<level> macros (bsc#1099918).
-rw-r--r--patches.suse/0001-dm-convert-DM-printk-macros-to-pr_-level-macros.patch108
-rw-r--r--series.conf1
2 files changed, 109 insertions, 0 deletions
diff --git a/patches.suse/0001-dm-convert-DM-printk-macros-to-pr_-level-macros.patch b/patches.suse/0001-dm-convert-DM-printk-macros-to-pr_-level-macros.patch
new file mode 100644
index 0000000000..8e5b6b75eb
--- /dev/null
+++ b/patches.suse/0001-dm-convert-DM-printk-macros-to-pr_-level-macros.patch
@@ -0,0 +1,108 @@
+From d2c3c8dcb5987b8352e82089c79a41b6e17e28d2 Mon Sep 17 00:00:00 2001
+From: Joe Perches <joe@perches.com>
+Date: Thu, 20 Apr 2017 10:46:07 -0700
+Subject: [PATCH] dm: convert DM printk macros to pr_<level> macros
+Git-commit: d2c3c8dcb5987b8352e82089c79a41b6e17e28d2
+Patch-mainline: v4.13-rc1
+References: bsc#1099918
+
+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>
+Signed-off-by: Coly Li <colyli@suse.de>
+---
+ include/linux/device-mapper.h | 71 ++++++++++++++++-------------------
+ 1 file 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) ? \
+--
+2.17.1
+
diff --git a/series.conf b/series.conf
index 89e518668d..65f9ec08ae 100644
--- a/series.conf
+++ b/series.conf
@@ -15909,6 +15909,7 @@
patches.fixes/0001-net-mlx5-Fix-driver-load-error-flow-when-firmware-is.patch
patches.drivers/net-mlx5-Cancel-delayed-recovery-work-when-unloading.patch
patches.drivers/net-mlx5e-Fix-TX-carrier-errors-report-in-get-stats-.patch
+ patches.suse/0001-dm-convert-DM-printk-macros-to-pr_-level-macros.patch
patches.drivers/hns-0005-net-hns-Fix-a-skb-used-after-free-bug.patch
patches.drivers/net-mlx5e-Initialize-CEE-s-getpermhwaddr-address-buf.patch
patches.drivers/bnxt_en-Fix-race-conditions-in-.ndo_get_stats64.patch