提交 9aa4aee3 编写于 作者: J Johannes Berg 提交者: John W. Linville

mac80211: make CALL_TXH a statement

The multi-line code in this macro wasn't wrapped
in do {} while (0) so we cannot use it in an if()
branch safely in the future -- fix that.
Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 86c34fe8
...@@ -1200,23 +1200,25 @@ static int invoke_tx_handlers(struct ieee80211_tx_data *tx) ...@@ -1200,23 +1200,25 @@ static int invoke_tx_handlers(struct ieee80211_tx_data *tx)
struct sk_buff *skb = tx->skb; struct sk_buff *skb = tx->skb;
ieee80211_tx_result res = TX_DROP; ieee80211_tx_result res = TX_DROP;
#define CALL_TXH(txh) \ #define CALL_TXH(txh) \
res = txh(tx); \ do { \
if (res != TX_CONTINUE) \ res = txh(tx); \
goto txh_done; if (res != TX_CONTINUE) \
goto txh_done; \
CALL_TXH(ieee80211_tx_h_check_assoc) } while (0)
CALL_TXH(ieee80211_tx_h_ps_buf)
CALL_TXH(ieee80211_tx_h_select_key) CALL_TXH(ieee80211_tx_h_check_assoc);
CALL_TXH(ieee80211_tx_h_michael_mic_add) CALL_TXH(ieee80211_tx_h_ps_buf);
CALL_TXH(ieee80211_tx_h_rate_ctrl) CALL_TXH(ieee80211_tx_h_select_key);
CALL_TXH(ieee80211_tx_h_misc) CALL_TXH(ieee80211_tx_h_michael_mic_add);
CALL_TXH(ieee80211_tx_h_sequence) CALL_TXH(ieee80211_tx_h_rate_ctrl);
CALL_TXH(ieee80211_tx_h_fragment) CALL_TXH(ieee80211_tx_h_misc);
CALL_TXH(ieee80211_tx_h_sequence);
CALL_TXH(ieee80211_tx_h_fragment);
/* handlers after fragment must be aware of tx info fragmentation! */ /* handlers after fragment must be aware of tx info fragmentation! */
CALL_TXH(ieee80211_tx_h_stats) CALL_TXH(ieee80211_tx_h_stats);
CALL_TXH(ieee80211_tx_h_encrypt) CALL_TXH(ieee80211_tx_h_encrypt);
CALL_TXH(ieee80211_tx_h_calculate_duration) CALL_TXH(ieee80211_tx_h_calculate_duration);
#undef CALL_TXH #undef CALL_TXH
txh_done: txh_done:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册