From patchwork Wed Jan 15 13:55:13 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: 216631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44D98C33CB3 for ; Wed, 15 Jan 2020 13:58:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 112702465A for ; Wed, 15 Jan 2020 13:58:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="QBbAUnZ+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729789AbgAON6Y (ORCPT ); Wed, 15 Jan 2020 08:58:24 -0500 Received: from mail-eopbgr770084.outbound.protection.outlook.com ([40.107.77.84]:58049 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729075AbgAONze (ORCPT ); Wed, 15 Jan 2020 08:55:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NfOsHrQmjMO1ADDTnK6A2GG0Cc0SBk2Wnf1ZrDD7i2wXxPX7yahbsqB+xrLjYL6JSXTHyqwOf5dshbC2l+gm/YxK/tkh2jgdegd5BKXffbgr4/ZfM9Z3V6mBTki4VJ/ibD1mw5RTlnwyB6dptFErE2XQ9Q/XcqySqNDpV8vkk6ZaX5KsYIbqjPoGpA2H7A1QU47iWbf9EHrpjRfQj3HQgYgwA2AF0Ka/FQ2GkFPL+wbGGTDZb0kcMzfD2LUwaVVtAjS0enuoIXEvakr9aQAH2i+YpZ1QvanBShCrTw0FS2//TXJPqF/69F8Z4Y2zZVuLAkpCsXIIgvNls9ShH9px4Q== 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=uOrtloGiHZH4CTUw4jIxstqp+7GcIHe3HODqlIzlH9s=; b=eNGI5gf+hJ0JJkbUitqzw9dTh3sFOtMOiHM042Wpx4CnZlFkNjQull/wKrzwLEHQhLInrr/sfoKtzTOediCnPhemWUjXKl40xUXRxisUgLMBjByMjReDD2gt0/ebxOgIq0G36xFYXMV9A7f5/pISJQ+3HnpPZYUSfnL058D50j6Qcu77fqfrLpOvp7pjrRLuI2Y7XQzwk5B6hVyZwILTMRdDsxuvmTqThuWsPyKYJ99nA7QhgDp04bwB55y+lv1bvaI4YQLoKLXKCGRm6eV6KNJft47i5p9JaKDW0lnC4HQlrUfXY0J6bP4Mrkf99+3ZyJEtA89v+nlNn/1kPd6bGg== 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=uOrtloGiHZH4CTUw4jIxstqp+7GcIHe3HODqlIzlH9s=; b=QBbAUnZ+feraB74fEIZCNZGwjwBooQYuv8yZI+4rHDTEt3nDXsFDZZILppmSKPpzmUZ3VM3GSLBmOIzcvCLATFttM84SFE4/7ip3n3XRekkxLY29SmHGDUB53QQmOitAEz+Bk5OGNAze9pXjtnjzf0nwYZp1uOQt1QMfHTf7Loc= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:26 +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 13:55:26 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) 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 13:55:12 +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?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 49/65] staging: wfx: simplify wfx_set_tim_impl() Thread-Topic: [PATCH v2 49/65] staging: wfx: simplify wfx_set_tim_impl() Thread-Index: AQHVy6to64KLHnVd/UOnhm2uzYO07g== Date: Wed, 15 Jan 2020 13:55:13 +0000 Message-ID: <20200115135338.14374-50-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) 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: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fe3d4db7-065e-4b63-f32a-08d799c28b55 x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1227; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; 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: +oyFicVEaw66J00ZXBB3+LDRnAVvjMnIYxzdehau5zKaVSSzy3AnV28NRB9Ha+NJIJ9gqIgzEzb/VlSjYq1AYG4KLEN4/WlU5CWbAAMLv1LP8xkv+sypQsXH5pQJtQMTX1PJNQ0k+x6TlbZBh0Uo1AHFATQPRbbreYnCZ6DIBOdgEMjgcnYqTZoKweq8VcKB7cdJEigKbo1/ctaTou4ydcAckVjLMsR/bxhpMKC9MU3pD7HWzacw7/2bJBsqJ3/yTBwptZOiaKZAf1Za/AjqpoUPgsxnCWaBiujYBTPWzv5D6EjjPMZjvgNgwuZuthXSwA6Q9f3oLrqJG/lBgd1skGe15g68kFi1Z8Fcw3P8fBFD+f+K5IUXjRFJ1iTvRwLxsSSkwRX/dgPZUR5Fyeqxc7BT6jY1Zdzz3ozvj3AcjzYlZu7YGR+TZyNGmkJtqRTC Content-ID: <769C4D71AC69FF418590A4766EE137D5@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe3d4db7-065e-4b63-f32a-08d799c28b55 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:13.8304 (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: XNuJQVENEDK9XUQuGOzw4vgPOcvH5DpcH4LmlZiSw7nBd9DPlVreCZZ/PlK/IU9JkjXI0+73g6RuizuFu/U91w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Argument provided to wfx_set_tim_impl() is always wvif->aid0_bit_set and there is no reason to provide another argument. Also rename wfx_set_tim_impl() into wfx_update_tim() to reflect the new behavior. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 18 +++++++++--------- drivers/staging/wfx/wfx.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index cc72877a090f..b7d21540d9a2 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -895,7 +895,7 @@ void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, wfx_ps_notify(wvif, notify_cmd, sta_priv->link_id); } -static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) +static int wfx_update_tim(struct wfx_vif *wvif) { struct sk_buff *skb; u16 tim_offset, tim_length; @@ -916,7 +916,7 @@ static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) tim_ptr[2] = 0; /* Set/reset aid0 bit */ - if (aid0_bit_set) + if (wvif->aid0_bit_set) tim_ptr[4] |= 1; else tim_ptr[4] &= ~1; @@ -928,11 +928,11 @@ static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) return 0; } -static void wfx_set_tim_work(struct work_struct *work) +static void wfx_update_tim_work(struct work_struct *work) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, set_tim_work); + struct wfx_vif *wvif = container_of(work, struct wfx_vif, update_tim_work); - wfx_set_tim_impl(wvif, wvif->aid0_bit_set); + wfx_update_tim(wvif); } int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) @@ -941,7 +941,7 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) struct wfx_sta_priv *sta_dev = (struct wfx_sta_priv *) &sta->drv_priv; struct wfx_vif *wvif = wdev_to_wvif(wdev, sta_dev->vif_id); - schedule_work(&wvif->set_tim_work); + schedule_work(&wvif->update_tim_work); return 0; } @@ -955,8 +955,8 @@ static void wfx_mcast_start_work(struct work_struct *work) cancel_work_sync(&wvif->mcast_stop_work); if (!wvif->aid0_bit_set) { wfx_tx_lock_flush(wvif->wdev); - wfx_set_tim_impl(wvif, true); wvif->aid0_bit_set = true; + wfx_update_tim(wvif); mod_timer(&wvif->mcast_timeout, jiffies + tmo); wfx_tx_unlock(wvif->wdev); } @@ -971,7 +971,7 @@ static void wfx_mcast_stop_work(struct work_struct *work) del_timer_sync(&wvif->mcast_timeout); wfx_tx_lock_flush(wvif->wdev); wvif->aid0_bit_set = false; - wfx_set_tim_impl(wvif, false); + wfx_update_tim(wvif); wfx_tx_unlock(wvif->wdev); } } @@ -1118,7 +1118,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) INIT_DELAYED_WORK(&wvif->link_id_gc_work, wfx_link_id_gc_work); spin_lock_init(&wvif->ps_state_lock); - INIT_WORK(&wvif->set_tim_work, wfx_set_tim_work); + INIT_WORK(&wvif->update_tim_work, wfx_update_tim_work); INIT_WORK(&wvif->mcast_start_work, wfx_mcast_start_work); INIT_WORK(&wvif->mcast_stop_work, wfx_mcast_stop_work); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index f56a91ea082d..cb359150e2ad 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -96,7 +96,7 @@ struct wfx_vif { u32 sta_asleep_mask; u32 pspoll_mask; spinlock_t ps_state_lock; - struct work_struct set_tim_work; + struct work_struct update_tim_work; int beacon_int; bool filter_bssid;