From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [patch] staging: rtl8192u: fix a macro expansion bug
Date: Tue, 02 Oct 2012 08:26:04 +0000 [thread overview]
Message-ID: <20121002082604.GC12398@elgon.mountain> (raw)
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>
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index 13f45c3..502bfdb 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -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
reply other threads:[~2012-10-02 8:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121002082604.GC12398@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox