[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190409212517.7321-3-linux@rasmusvillemoes.dk>
Date: Tue, 9 Apr 2019 23:25:09 +0200
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Jason Baron <jbaron@...mai.com>, linux-kernel@...r.kernel.org,
Rasmus Villemoes <linux@...musvillemoes.dk>,
netdev@...r.kernel.org
Subject: [PATCH 02/10] linux/net.h: use unique identifier for each struct _ddebug
Changes on x86-64 later in this series require that all struct _ddebug
descriptors in a translation unit uses distinct identifiers. Realize
that for net_dbg_ratelimited by generating such an identifier via
__UNIQUE_ID and pass that to an extra level of macros.
No functional change.
Cc: netdev@...r.kernel.org
Acked-by: Jason Baron <jbaron@...mai.com>
Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
---
include/linux/net.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/net.h b/include/linux/net.h
index c606c72311d0..828e0db1e63a 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -266,7 +266,7 @@ do { \
#define net_info_ratelimited(fmt, ...) \
net_ratelimited_function(pr_info, fmt, ##__VA_ARGS__)
#if defined(CONFIG_DYNAMIC_DEBUG)
-#define net_dbg_ratelimited(fmt, ...) \
+#define _net_dbg_ratelimited(descriptor, fmt, ...) \
do { \
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
if (DYNAMIC_DEBUG_BRANCH(descriptor) && \
@@ -274,6 +274,8 @@ do { \
__dynamic_pr_debug(&descriptor, pr_fmt(fmt), \
##__VA_ARGS__); \
} while (0)
+#define net_dbg_ratelimited(fmt, ...) \
+ _net_dbg_ratelimited(__UNIQUE_ID(ddebug), fmt, ##__VA_ARGS__)
#elif defined(DEBUG)
#define net_dbg_ratelimited(fmt, ...) \
net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
--
2.20.1
Powered by blists - more mailing lists