aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDiomidis Spinellis <dds@FreeBSD.org>2006-06-01 14:06:32 +0000
committerDiomidis Spinellis <dds@FreeBSD.org>2006-06-01 14:06:32 +0000
commit132142c5723d85ee2230f29625b7ad28adf9de30 (patch)
treea864cbe2ad5ea527a417a09f4c3a40ce8b1aac2c /sys
parent55ba40bfe2d77bd178ff5924ce9930044ed9d355 (diff)
downloadsrc-132142c5723d85ee2230f29625b7ad28adf9de30.tar.gz
src-132142c5723d85ee2230f29625b7ad28adf9de30.zip
Move conditional preprocessing out from the IEEE80211_DPRINTF macro
invocation. Per C99 6.10.3 paragraph 11 preprocessing directives appearing as macro arguments yield undefined behavior.
Notes
Notes: svn path=/head/; revision=159139
Diffstat (limited to 'sys')
-rw-r--r--sys/net80211/ieee80211_node.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index 444f2dc1996a..d9c88c91d0d6 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -59,6 +59,12 @@ __FBSDID("$FreeBSD$");
#define IEEE80211_AID_ISSET(b, w) \
((w)[IEEE80211_AID(b) / 32] & (1 << (IEEE80211_AID(b) % 32)))
+#ifdef IEEE80211_DEBUG_REFCNT
+#define REFCNT_LOC "%s (%s:%u) %p<%s> refcnt %d\n", __func__, func, line
+#else
+#define REFCNT_LOC "%s %p<%s> refcnt %d\n", __func__
+#endif
+
static struct ieee80211_node *node_alloc(struct ieee80211_node_table *);
static void node_cleanup(struct ieee80211_node *);
static void node_free(struct ieee80211_node *);
@@ -1513,13 +1519,7 @@ ieee80211_find_node_with_channel(struct ieee80211_node_table *nt,
ni->ni_chan == chan) {
ieee80211_ref_node(ni); /* mark referenced */
IEEE80211_DPRINTF(nt->nt_ic, IEEE80211_MSG_NODE,
-#ifdef IEEE80211_DEBUG_REFCNT
- "%s (%s:%u) %p<%s> refcnt %d\n", __func__,
- func, line,
-#else
- "%s %p<%s> refcnt %d\n", __func__,
-#endif
- ni, ether_sprintf(ni->ni_macaddr),
+ REFCNT_LOC, ni, ether_sprintf(ni->ni_macaddr),
ieee80211_node_refcnt(ni));
break;
}
@@ -1569,13 +1569,7 @@ ieee80211_find_node_with_ssid(struct ieee80211_node_table *nt,
if (ni != NULL) {
ieee80211_ref_node(ni); /* mark referenced */
IEEE80211_DPRINTF(ic, IEEE80211_MSG_NODE,
-#ifdef IEEE80211_DEBUG_REFCNT
- "%s (%s:%u) %p<%s> refcnt %d\n", __func__,
- func, line,
-#else
- "%s %p<%s> refcnt %d\n", __func__,
-#endif
- ni, ether_sprintf(ni->ni_macaddr),
+ REFCNT_LOC, ni, ether_sprintf(ni->ni_macaddr),
ieee80211_node_refcnt(ni));
}
IEEE80211_NODE_UNLOCK(nt);