lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170823132337.517466-3-arnd@arndb.de>
Date:   Wed, 23 Aug 2017 15:22:53 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Ping-Ke Shih <pkshih@...ltek.com>,
        Larry Finger <Larry.Finger@...inger.net>,
        Yan-Hsuan Chuang <yhchuang@...ltek.com>,
        Birming Chiu <birming@...ltek.com>,
        Shaofu <shaofu@...ltek.com>,
        Steven Ting <steventing@...ltek.com>,
        Arnd Bergmann <arnd@...db.de>, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] staging: rtlwifi: simplify logical operation

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@...db.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ