summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordds <dds@FreeBSD.org>2006-06-01 14:06:32 +0000
committerdds <dds@FreeBSD.org>2006-06-01 14:06:32 +0000
commit09c5e71a920349c560fde8a79bfcc14924f257c9 (patch)
treea864cbe2ad5ea527a417a09f4c3a40ce8b1aac2c
parent0a5ee5e4dbfb38f156866b0155451c25dd38336a (diff)
downloadFreeBSD-src-09c5e71a920349c560fde8a79bfcc14924f257c9.zip
FreeBSD-src-09c5e71a920349c560fde8a79bfcc14924f257c9.tar.gz
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.
-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 444f2dc..d9c88c9 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);
OpenPOWER on IntegriCloud