summaryrefslogtreecommitdiff
path: root/net/batman-adv/log.h
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2016-09-21 10:23:50 +0300
committerSimon Wunderlich <sw@simonwunderlich.de>2016-10-19 09:37:54 +0300
commit4c7da0f6dbcde2431d773ce03cde5e7abede54e0 (patch)
tree74cca95977875552284b882a393ef10fc5d94115 /net/batman-adv/log.h
parent507b37cf71c86b7ceaebf333b8ae488a600f5afd (diff)
downloadlinux-4c7da0f6dbcde2431d773ce03cde5e7abede54e0.tar.xz
batman-adv: Avoid precedence issues in macros
It must be avoided that arguments to a macro are evaluated ungrouped (which enforces normal operator precendence). Otherwise the result of the macro is not well defined. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/log.h')
-rw-r--r--net/batman-adv/log.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/batman-adv/log.h b/net/batman-adv/log.h
index e0e1a88c3e58..ab47acf2eb01 100644
--- a/net/batman-adv/log.h
+++ b/net/batman-adv/log.h
@@ -71,12 +71,12 @@ int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...)
__printf(2, 3);
/* possibly ratelimited debug output */
-#define _batadv_dbg(type, bat_priv, ratelimited, fmt, arg...) \
- do { \
- if (atomic_read(&bat_priv->log_level) & type && \
- (!ratelimited || net_ratelimit())) \
- batadv_debug_log(bat_priv, fmt, ## arg);\
- } \
+#define _batadv_dbg(type, bat_priv, ratelimited, fmt, arg...) \
+ do { \
+ if (atomic_read(&(bat_priv)->log_level) & (type) && \
+ (!(ratelimited) || net_ratelimit())) \
+ batadv_debug_log(bat_priv, fmt, ## arg); \
+ } \
while (0)
#else /* !CONFIG_BATMAN_ADV_DEBUG */
__printf(4, 5)