From 4c7da0f6dbcde2431d773ce03cde5e7abede54e0 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Wed, 21 Sep 2016 09:23:50 +0200 Subject: 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 Signed-off-by: Simon Wunderlich --- net/batman-adv/main.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'net/batman-adv/main.h') diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h index 6a2328d17709..daddca94feb8 100644 --- a/net/batman-adv/main.h +++ b/net/batman-adv/main.h @@ -199,8 +199,8 @@ struct packet_type; struct seq_file; struct sk_buff; -#define BATADV_PRINT_VID(vid) ((vid & BATADV_VLAN_HAS_TAG) ? \ - (int)(vid & VLAN_VID_MASK) : -1) +#define BATADV_PRINT_VID(vid) (((vid) & BATADV_VLAN_HAS_TAG) ? \ + (int)((vid) & VLAN_VID_MASK) : -1) extern struct list_head batadv_hardif_list; -- cgit v1.2.3