diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2012-11-07 19:41:26 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2012-11-07 19:41:26 +0000 |
commit | 37426984f51b3fca3d9a358981c9c9090ce1b03e (patch) | |
tree | fbcfa307ef5cea3f046cd034c40f064d0c7f8837 /sys/net80211 | |
parent | 24dbc2cb9241754b20d1fdc126fe7d020556b1e3 (diff) |
Make the ieee80211_node_incref() macro a static inline function, as its
siblings already are. And fix return value of ieee80211_node_decref()
which should be unsigned but was signed.
diff originally from dhill; ok kettenis reyk
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_node.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index d3105a6a0f5..d08fb270b35 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_node.h,v 1.42 2012/01/21 19:42:16 stsp Exp $ */ +/* $OpenBSD: ieee80211_node.h,v 1.43 2012/11/07 19:41:25 stsp Exp $ */ /* $NetBSD: ieee80211_node.h,v 1.9 2004/04/30 22:57:32 dyoung Exp $ */ /*- @@ -253,17 +253,22 @@ struct ieee80211_node { RB_HEAD(ieee80211_tree, ieee80211_node); -#define ieee80211_node_incref(ni) \ - do { \ - int _s = splnet(); \ - (ni)->ni_refcnt++; \ - splx(_s); \ - } while (0) +static __inline void +ieee80211_node_incref(struct ieee80211_node *ni) +{ + int s; + + s = splnet(); + ni->ni_refcnt++; + splx(s); +} -static __inline int +static __inline u_int ieee80211_node_decref(struct ieee80211_node *ni) { - int refcnt, s; + u_int refcnt; + int s; + s = splnet(); refcnt = --ni->ni_refcnt; splx(s); |