From patchwork Tue Dec 17 16:14:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 11298169 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C1CA17F0 for ; Tue, 17 Dec 2019 16:19:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2DAF2064B for ; Tue, 17 Dec 2019 16:19:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="LZprxSUL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728766AbfLQQPI (ORCPT ); Tue, 17 Dec 2019 11:15:08 -0500 Received: from mail-eopbgr680046.outbound.protection.outlook.com ([40.107.68.46]:59543 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728743AbfLQQPH (ORCPT ); Tue, 17 Dec 2019 11:15:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QwNYF/bF5oDB5qaqo6aemRRlhWCospW5t/XsyrUCUL6LivIpbzOzgvr0TVy9GhQiqaRZEPzFph/JkFvnsMkQ6Ip06TD6EWfCixMQtChWzRWvpYwdfISTc+Z6nfOHBlljg+waxTKnhE0ZBUBVSCZ2ZYBYqyC/1Pf0/uJLJm9wFYxP8i3RDWDyKxh0hBXFCTaQgdo88bpmsvXbPyoxRe6UV7nzPcxodBoHAHYKkSU1s0yrCqecVJ+ZKt26QmUqXAULufXA5Ww8kjyUhkf3AtEX+CIHArNIK6h9a89DOPEhdNsL7GjV8+oL6scCfnRTECPRFKIN9gfcXyXOluCIy2Q9KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+GTFV5SWac53s1xD0x1J89lUpDsz6huBwnt1RPa61zg=; b=dLL6Hw9KGuP2Ye1A/0LbH0qMC3P5PJUersOZWtztV0aFgg2YX6X1q4NmOC8KE94kQL0Kx3dqaEAIQlZvq8L9vM7Ky0GRguto71DD7mtEZlROhjV8sUVVGM1CccbpYndG9pLd7QvmaJhRgF1pqUyeeiRokcp3hFUT09FXU+g7t1LNIEG4f8IIH7AZO5kDbuzeo3L5HISP32jB+6xsshVNvDNJ0FkGi+VQIHkhTlESRBp6jYEIN4PuDAdMh6yBTtOsDGtCNRik/nICzI+ozvwVM7c5i1sbdiGxQP/55OsnhVg2cwi99sl7YcYHi5hVU36Qc+/Zqz8YkbZsYKKom/89zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+GTFV5SWac53s1xD0x1J89lUpDsz6huBwnt1RPa61zg=; b=LZprxSUL9GjvEbQPv5hp380zmIxQWE47uSeZ9Vlw+CjaS15htlH8HEbznoFWY/J7nVw6u3Wj6PBA+u3pkX/+1jcvT2AbQWDAxvui9b9oNjiaoUt8wrHhD245d6SB9qe0Ip/6i1xgbVZH7Ris3mzkp84Puu/aVkQHpKvDJ5TjVfM= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3791.namprd11.prod.outlook.com (20.178.254.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.18; Tue, 17 Dec 2019 16:14:57 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2538.019; Tue, 17 Dec 2019 16:14:57 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH v2 20/55] staging: wfx: make conditions easier to read Thread-Topic: [PATCH v2 20/55] staging: wfx: make conditions easier to read Thread-Index: AQHVtPUftxWFpzusskSHUCZVHaED9g== Date: Tue, 17 Dec 2019 16:14:56 +0000 Message-ID: <20191217161318.31402-21-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6559ceaa-b93a-4a9c-adf6-08d7830c4216 x-ms-traffictypediagnostic: MN2PR11MB3791: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:376; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(2906002)(52116002)(107886003)(2616005)(86362001)(478600001)(6486002)(4326008)(64756008)(66556008)(66476007)(81156014)(66946007)(6506007)(1076003)(316002)(66446008)(8936002)(71200400001)(81166006)(5660300002)(36756003)(26005)(186003)(8676002)(85202003)(66574012)(85182001)(110136005)(54906003)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB3791;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: dR4TK0TLOEnTC9pFYokQA2cyqyZexjdKpF3hL2bWU3mZw92uCYtLAKaUkYpNXqG1rXkCIS0boD9j/XmhEkjZNSTrudc5anqMdlJPKa8AMxH5pvZmIU+Kq8kfuiulmrZikKPyDmkFRuhfbs1LiNmmjF8ZW8u3B1cmPro8CrEIh76UVeXxsUBEbE2AfQHPfUEUlicMUVfC32YDAle17KzBMlMHAGlzhYLJnVI+PWPRFtmcRVcGTvZR9BlYt1YFqdoR+Rn76AkbnUPz7w4YmWPbWIq2prpxKIvjdKMK9NnOxFroAUHvZLDG5YI1ApWXxot9w8zO/8jYrqm6UtDrXWGIvKtPdurvV6zPhIIIIOs286b5t4UhtaZSD0YP10QCca3BiHP7qg6su/moS8GLltnPIY8Y5QW7cD96lPl3zwPfv+78r/UiXWOdhPZhW4LMjCsQ Content-ID: <79F9E7C7A4645F45BCD9BE37D25F2B13@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6559ceaa-b93a-4a9c-adf6-08d7830c4216 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:56.9842 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Hpw7gcpxV2c0/oG6ojV1Oep1ntQVkNdXm8WnfAtwMW7FDXhkmK0fTLTIuia2pMimpZIFTOhRWHo9OBVkuNbXEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3791 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller We prefer series of simple boolean conditions than computing bitmasks. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 471dd15b227f..7f4eaa8e6d84 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -1055,9 +1055,11 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, } } - if (changed & - (BSS_CHANGED_BEACON | BSS_CHANGED_AP_PROBE_RESP | - BSS_CHANGED_BSSID | BSS_CHANGED_SSID | BSS_CHANGED_IBSS)) { + if (changed & BSS_CHANGED_BEACON || + changed & BSS_CHANGED_AP_PROBE_RESP || + changed & BSS_CHANGED_BSSID || + changed & BSS_CHANGED_SSID || + changed & BSS_CHANGED_IBSS) { wvif->beacon_int = info->beacon_int; wfx_update_beaconing(wvif); wfx_upload_beacon(wvif); @@ -1095,10 +1097,11 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_BSSID) do_join = true; - if (changed & - (BSS_CHANGED_ASSOC | BSS_CHANGED_BSSID | - BSS_CHANGED_IBSS | BSS_CHANGED_BASIC_RATES | - BSS_CHANGED_HT)) { + if (changed & BSS_CHANGED_ASSOC || + changed & BSS_CHANGED_BSSID || + changed & BSS_CHANGED_IBSS || + changed & BSS_CHANGED_BASIC_RATES || + changed & BSS_CHANGED_HT) { if (info->assoc) { if (wvif->state < WFX_STATE_PRE_STA) { ieee80211_connection_loss(vif); @@ -1120,9 +1123,9 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, } /* ERP Protection */ - if (changed & (BSS_CHANGED_ASSOC | - BSS_CHANGED_ERP_CTS_PROT | - BSS_CHANGED_ERP_PREAMBLE)) { + if (changed & BSS_CHANGED_ASSOC || + changed & BSS_CHANGED_ERP_CTS_PROT || + changed & BSS_CHANGED_ERP_PREAMBLE) { u32 prev_erp_info = wvif->erp_info; if (info->use_cts_prot) @@ -1139,10 +1142,10 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, schedule_work(&wvif->set_cts_work); } - if (changed & (BSS_CHANGED_ASSOC | BSS_CHANGED_ERP_SLOT)) + if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_ERP_SLOT) hif_slot_time(wvif, info->use_short_slot ? 9 : 20); - if (changed & (BSS_CHANGED_ASSOC | BSS_CHANGED_CQM)) { + if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_CQM) { struct hif_mib_rcpi_rssi_threshold th = { .rolling_average_count = 8, .detection = 1,