From: Arnd Bergmann <arnd@arndb.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ping-Ke Shih <pkshih@realtek.com>,
Larry Finger <Larry.Finger@lwfinger.net>,
Yan-Hsuan Chuang <yhchuang@realtek.com>,
Birming Chiu <birming@realtek.com>, Shaofu <shaofu@realtek.com>,
Steven Ting <steventing@realtek.com>,
Arnd Bergmann <arnd@arndb.de>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] staging: rtlwifi: simplify logical operation
Date: Wed, 23 Aug 2017 15:22:53 +0200 [thread overview]
Message-ID: <20170823132337.517466-3-arnd@arndb.de> (raw)
In-Reply-To: <20170823132337.517466-1-arnd@arndb.de>
gcc notices a very complicated way to check a value
for being equal to one, and warns about it:
drivers/staging/rtlwifi/btcoexist/halbtc8822b1ant.c: In function 'halbtc8822b1ant_set_ext_ant_switch':
drivers/staging/rtlwifi/btcoexist/halbtc8822b1ant.c:2105:9: error: '~' on a boolean expression [-Werror=bool-operation]
~switch_polatiry_inverse :
^
drivers/staging/rtlwifi/btcoexist/halbtc8822b1ant.c:2105:9: note: did you mean to use logical not?
~switch_polatiry_inverse :
^
This simplifies this expression to make it more readable
and to make gcc happy.
Fixes: 56bde846304e ("staging: r8822be: Add existing rtlwifi and rtl_pci parts for new driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/staging/rtlwifi/btcoexist/halbtc8822b1ant.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/rtlwifi/btcoexist/halbtc8822b1ant.c b/drivers/staging/rtlwifi/btcoexist/halbtc8822b1ant.c
index 933d188d52b4..157395b85405 100644
--- a/drivers/staging/rtlwifi/btcoexist/halbtc8822b1ant.c
+++ b/drivers/staging/rtlwifi/btcoexist/halbtc8822b1ant.c
@@ -2101,9 +2101,7 @@ static void halbtc8822b1ant_set_ext_ant_switch(struct btc_coexist *btcoexist,
* 0xcbd[1:0] = 2b'01 => Ant to BTG,
* 0xcbd[1:0] = 2b'10 => Ant to WLG
*/
- switch_polatiry_inverse = (rfe_type->ext_ant_switch_ctrl_polarity == 1 ?
- ~switch_polatiry_inverse :
- switch_polatiry_inverse);
+ switch_polatiry_inverse = rfe_type->ext_ant_switch_ctrl_polarity == 1;
switch (pos_type) {
default:
--
2.9.0
next prev parent reply other threads:[~2017-08-23 13:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170823132337.517466-1-arnd@arndb.de>
2017-08-23 13:22 ` [PATCH 2/3] staging: rtlwifi: add MAC80211 dependency Arnd Bergmann
2017-08-23 15:44 ` Randy Dunlap
2017-08-23 23:19 ` Greg Kroah-Hartman
2017-08-23 23:29 ` Greg Kroah-Hartman
2017-08-24 19:23 ` Larry Finger
2017-08-24 23:59 ` Greg Kroah-Hartman
2017-08-23 13:22 ` Arnd Bergmann [this message]
2017-08-24 19:06 ` [PATCH 3/3] staging: rtlwifi: simplify logical operation Larry Finger
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=20170823132337.517466-3-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=Larry.Finger@lwfinger.net \
--cc=birming@realtek.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pkshih@realtek.com \
--cc=shaofu@realtek.com \
--cc=steventing@realtek.com \
--cc=yhchuang@realtek.com \
/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
all inboxes | Powered by JetHome®