From patchwork Wed Jan 15 12:13:26 2020 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: 11333919 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 D1BCA109A for ; Wed, 15 Jan 2020 12:14:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A634E222C3 for ; Wed, 15 Jan 2020 12:14:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Lbo3DgIA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731825AbgAOMN4 (ORCPT ); Wed, 15 Jan 2020 07:13:56 -0500 Received: from mail-bn7nam10on2064.outbound.protection.outlook.com ([40.107.92.64]:33252 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731736AbgAOMNt (ORCPT ); Wed, 15 Jan 2020 07:13:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SkAph8WeGD/jFYrP/74XIq9c3cdFOa47TK8VNxJ9NQ0pPS7JbpWApn3c2yHsYBd5ZyQiolj0u2O50F+muaZW+Rel7V8/pw3WzjORHC4a4Bc3aZo4wsSMtOHCsHHlBReUgLx4SdmUmzW5rMatm7YbhHnfG2EBAFezxk1BnO/KUBOBi5hlDfbcFc/jhkRySH7aLVkATfUi0JJXccCbhG6Xca3FydocH9XY6OSZLenuHz0iXBn3pj7g958OjpGrpl4r/O9mBC7wR+BB7c+Xz58DE2nPGN05uW/zvct0Mb1wwiktEnSN9JA3g3WLK3XwMu0R88oShYvoQZOp9pLNJ3RDLA== 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=KdY34f6/5pVjPW8ktmpJGZ8wwaxZNv+zB55DXZmEGhY=; b=b888WijhZhKliOhj/Qbh8oXL2QXkiWZVVW57j+0587T644L8SDcYLCfSyMYtC6MXTZOTJS+tGoMYtpdS3DIHWFNJ35Vx2592VUgJ6rI8TWKOqozUBPqOJoVzyGAvdngkXZwRJ+JxD+HWi6i9N2/A8gDqCs2FEMbDlnTta/E9vxy90jvQ8aCcqqg6xuslf8YmaxPri6py0vsvl5b36ZrQEFbfZCeVYdlyGUqj2qPS4Mt2HBIAb24hn/0OWQAs2k7SwC1bYOXI3oxhd56b2bGZe5OT+XSzi7Qv9Nj1Ddf7eJeIZyGiyoDrTq0uJwzq0O1dYomd1ytX6/3Ol1tjyCyvpQ== 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=KdY34f6/5pVjPW8ktmpJGZ8wwaxZNv+zB55DXZmEGhY=; b=Lbo3DgIAbqmtTTuD7u+FpTv5kbiAmAjah08gd2TrmH/84aI87703NfpDa58V3QeFBCWCjApyWF2Fh//WWWiZeT+1EgpV9oyJf3YnvAHFjr446pJI4GJsy1xwqAyj8wvqq8hoDUBQVE90Nn/D1kzYFCfYKsDZb7+ZD+Foder5o1Y= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:13:36 +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.2623.018; Wed, 15 Jan 2020 12:13:36 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 12:13:25 +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 58/65] staging: wfx: simplify wfx_ps_notify_sta() Thread-Topic: [PATCH 58/65] staging: wfx: simplify wfx_ps_notify_sta() Thread-Index: AQHVy50w6TEiPc00BUGEr/tp+4T/ew== Date: Wed, 15 Jan 2020 12:13:26 +0000 Message-ID: <20200115121041.10863-59-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) 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.25.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 810c92fb-a78c-46ac-e74f-08d799b45316 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1051; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB3934;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: 1o3AqzSkuwd3sVk/94c9kPZQLlZn/jaNlyNm8yMA019UzRlHciWykY6coaKVmFKMJBGEMvVtOpMj/mgDb4BgEz3d/4qFG44KADM1wXEFZ4BzGvt963Mey6EtTShvMgeLqHgpQqeb6p5vQdtzj4IhQyPVlUbWJg9k9YS4tXRAjOrztsxZRdWockAwez2kyFCxi9A+QbNjdDr203M36mtoj1AnaOveC2HjnM0wUQ5KhM6quHOLEpvHT0+4sIzya3zluhiwaHaa2GyTXhHDTz8izQdUYusFwKAj7Z/8Xq9rZfgjQjaAcF/gJCPS+wqZezwNO1D7sKMnS8bHp9xEmoKSbUCElYIzgEsHafsZ/I91iC5smIVZrQu5W9JaeoWko55NU3Nq5lFcQvdrW/03ATfdzJQ/tFCbmKInSHPQDuWOK8RRJ5xTZ87Zf+ZpaLL9LDmQ Content-ID: <465800C37CFC0E4DABCD93C50CD4D0B8@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 810c92fb-a78c-46ac-e74f-08d799b45316 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:26.5506 (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: 4O42KUlctC+cQN+TYEFimTvRYOGjLIkRW1fyPjxO7hfOi2anwphmUeqzjDeMHDXM1AtHs7fjQSYtiqwMvi0g4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_ps_notify_sta() is too complex compared to the task it do. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 01eee06a1ef4..726884091706 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -842,26 +842,14 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, static void wfx_ps_notify_sta(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd, int link_id) { - u32 bit, prev; - spin_lock_bh(&wvif->ps_state_lock); - bit = BIT(link_id); - prev = wvif->sta_asleep_mask & bit; - - switch (notify_cmd) { - case STA_NOTIFY_SLEEP: - if (!prev) { - wvif->sta_asleep_mask |= bit; - } - break; - case STA_NOTIFY_AWAKE: - if (prev) { - wvif->sta_asleep_mask &= ~bit; - wfx_bh_request_tx(wvif->wdev); - } - break; - } + if (notify_cmd == STA_NOTIFY_SLEEP) + wvif->sta_asleep_mask |= BIT(link_id); + else // notify_cmd == STA_NOTIFY_AWAKE + wvif->sta_asleep_mask &= ~BIT(link_id); spin_unlock_bh(&wvif->ps_state_lock); + if (notify_cmd == STA_NOTIFY_AWAKE) + wfx_bh_request_tx(wvif->wdev); } void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,