提交 38bdb650 编写于 作者: F Felix Fietkau 提交者: John W. Linville

mac80211: fix the for_each_sta_info macro

Because of an ambiguity in the for_each_sta_info macro, it can
currently only be used if the third parameter is set to 'sta'.
Fix this by renaming the parameter to '_sta'.
Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 78c4653a
......@@ -427,20 +427,20 @@ void for_each_sta_info_type_check(struct ieee80211_local *local,
{
}
#define for_each_sta_info(local, _addr, sta, nxt) \
#define for_each_sta_info(local, _addr, _sta, nxt) \
for ( /* initialise loop */ \
sta = rcu_dereference(local->sta_hash[STA_HASH(_addr)]),\
nxt = sta ? rcu_dereference(sta->hnext) : NULL; \
_sta = rcu_dereference(local->sta_hash[STA_HASH(_addr)]),\
nxt = _sta ? rcu_dereference(_sta->hnext) : NULL; \
/* typecheck */ \
for_each_sta_info_type_check(local, (_addr), sta, nxt), \
for_each_sta_info_type_check(local, (_addr), _sta, nxt),\
/* continue condition */ \
sta; \
_sta; \
/* advance loop */ \
sta = nxt, \
nxt = sta ? rcu_dereference(sta->hnext) : NULL \
_sta = nxt, \
nxt = _sta ? rcu_dereference(_sta->hnext) : NULL \
) \
/* compare address and run code only if it matches */ \
if (memcmp(sta->sta.addr, (_addr), ETH_ALEN) == 0)
if (memcmp(_sta->sta.addr, (_addr), ETH_ALEN) == 0)
/*
* Get STA info by index, BROKEN!
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册