Skip to content

Commit

Permalink
staging: rtl8192u: fix a macro expansion bug
Browse files Browse the repository at this point in the history
Clang detected this macro expansion bug:
drivers/staging/rtl8192u/r8192U_core.c:2384:76: warning: operator '?:'
	has lower precedence than '+'; '+' will be evaluated first
	[-Wparentheses]

The line from the .c file looks like this:
	u1bAIFS = qos_parameters->aifs[i] * ((mode&(IEEE_G|IEEE_N_24G)) ?9:20) + aSifsTime;

We need to put parenthesis around the entire macro to fix the bug.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Oct 22, 2012
1 parent 3e5e624 commit cbf2f54
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/staging/rtl8192u/ieee80211/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ enum _ReasonCode{



#define aSifsTime ((priv->ieee80211->current_network.mode == IEEE_A)||(priv->ieee80211->current_network.mode == IEEE_N_24G)||(priv->ieee80211->current_network.mode == IEEE_N_5G))? 16 : 10
#define aSifsTime ((priv->ieee80211->current_network.mode == IEEE_A || \
priv->ieee80211->current_network.mode == IEEE_N_24G || \
priv->ieee80211->current_network.mode == IEEE_N_5G) ? \
16 : 10)

#define MGMT_QUEUE_NUM 5

Expand Down

0 comments on commit cbf2f54

Please sign in to comment.