From patchwork Mon Dec 16 17:03:43 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: 11294699 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 D2B13930 for ; Mon, 16 Dec 2019 17:04:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5AF8206EC for ; Mon, 16 Dec 2019 17:04:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="GtiYvdsP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727425AbfLPREt (ORCPT ); Mon, 16 Dec 2019 12:04:49 -0500 Received: from mail-eopbgr700045.outbound.protection.outlook.com ([40.107.70.45]:49121 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727101AbfLPRD7 (ORCPT ); Mon, 16 Dec 2019 12:03:59 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dY77xjOTH6+vmiBbtzsxb9rL4ulBpD6bbx/kQ8eykVQZdIDPZMZqHMxsxdn7iapUpMwQPZUZVYoiL2aaceVGuoQZ2S7KHPuXWPII1mXeWP+nTv57o0IJQCFCzdret5ohgzn5pNeimRY1CN0Ffq1UY6MZagP6VewuaEMzSdWXGEXkMJzHd6sPxrbobD0f7d9knQTNLRe6JyXMoOZ4EKqusG7lpsFHeOChFf7DOgIPIluRQqtXuzc/D/gu15eiw6pGJSEae+RHF/W2BbJQlBS95lt/dU23DoanvKgFJHNPLS8uYyItWydjji8sWADcP2/6/jySOxYffm4zMyz06yr2sA== 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=euFpjFGMFrP1rz1eUi+D/CNOMsvPYPcV3xsIVRhW5Ok=; b=mAL2eKmXUBmkoqDEa0l+AuYrlkjI0H23eFyBY+jpFgnyhmF40wRjswT1DUmCbbKIEMNuFXM8dn63hHDCgBm/FVAzB3GuUFP4lY5tXfilQbcLbvptOrj1iQTV1RVDBRPTLPFuksCAexrV11ScyDNV60l5ss/3h6UNHk9yAES42d2vSIvLL5PQB3AQVayUBaWKkkYlKbF5CUkk8B9tz7sGABHpcqSiksXLK417+Rl/venroBMECqe7iuCWJapJFw4MetxJTUTSXs4A++6N5f5x6XKp/sbfqjuDx8wC8LuliTl5BdU5wQ10KnhJu+xXQ92Te/KVZEMa+zyvm3zksV/FBQ== 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=euFpjFGMFrP1rz1eUi+D/CNOMsvPYPcV3xsIVRhW5Ok=; b=GtiYvdsPBuTvKGquLSLWH/nYdyTOgl5GZEirueDXxi44HBukhcT+gZkEnxrzi64pyQGsh2X+0dHiRsDJfpQHZ264zkLMDtBkysZwXQmzPyxw+cKTy5XGxFZpwkAQTZIVs3nJR3n6kSGYEdijCD3K6kx3w+omk8Yn0kw0OuGdtic= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4351.namprd11.prod.outlook.com (52.135.39.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.19; Mon, 16 Dec 2019 17:03:51 +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; Mon, 16 Dec 2019 17:03:51 +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 20/55] staging: wfx: make conditions easier to read Thread-Topic: [PATCH 20/55] staging: wfx: make conditions easier to read Thread-Index: AQHVtDLFk8cqtPACM0yZr2FsSKTnFg== Date: Mon, 16 Dec 2019 17:03:43 +0000 Message-ID: <20191216170302.29543-21-Jerome.Pouiller@silabs.com> References: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0a50ccfe-7b09-440f-0a8e-08d78249ed03 x-ms-traffictypediagnostic: MN2PR11MB4351: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:376; x-forefront-prvs: 02530BD3AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(376002)(346002)(396003)(39860400002)(199004)(189003)(66556008)(66446008)(64756008)(66476007)(76116006)(85202003)(91956017)(66946007)(54906003)(107886003)(4326008)(478600001)(110136005)(71200400001)(6512007)(81156014)(8676002)(81166006)(186003)(36756003)(2906002)(85182001)(6666004)(66574012)(1076003)(316002)(6506007)(5660300002)(86362001)(26005)(2616005)(6486002)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4351;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX: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: 445iGWctoeVkMqCcBgkl2VBTww+nXwSKAB4HbhsDsKlUnfME216ja+01uK8gF4K4VJlMCYmvCn7PLh0YRBJSq09RpFYbBilCBlksmNNP5Vf+IwG/eQ9oxwi7mTxbm4zRrJMRKt2s8mSE5hi3nIViwvqvtOQ46wEcDy+dWGeyryFdDoPUQshQCC8dIl9I/HsABjIhTVIQjM16lunOJxAmnNg9LEzbqw/XBMsd/GaVZYy+ZwDoBLpnhOnd/Z86NjomK+iA6OPytzZjc+oNwkRh0QGbCocbVGVjizeAjFAZ1oi6zF7zCPM9+XEcBW82aoOlMiY38OmGjJqOwGcc/nLRN1YHxD5EPqWhlHLTWj01CMbou2LZSHrOliTDVHCULTWrP3guLHReI/RQZTtTeZkrm6Sd64mOQiY4/oLSu0qKsPse9DtAKVMD/sUCc0mF33K/ Content-ID: <9271E5A608BE4A45A3A9D7255EB85666@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a50ccfe-7b09-440f-0a8e-08d78249ed03 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:43.8712 (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: +/8ca0NSd7yzhvBxtXiLQqMDlQyZbD7ws3X7Ab6TKGlsiro1s+9s9URd4FaGu66fPSZp/9qdKoYMW5UzWSce8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4351 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,