From patchwork Mon Dec 16 17:03: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: 11294763 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 B8E941580 for ; Mon, 16 Dec 2019 17:08:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D6F720717 for ; Mon, 16 Dec 2019 17:08:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ZzdRgnS1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727941AbfLPRHB (ORCPT ); Mon, 16 Dec 2019 12:07:01 -0500 Received: from mail-eopbgr690050.outbound.protection.outlook.com ([40.107.69.50]:60371 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727875AbfLPRG7 (ORCPT ); Mon, 16 Dec 2019 12:06:59 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T6dDRQMJcxnyau95z8FRcsmyfTRU5Vxv+yWQjH7Go7NoXvK4iwGL9EHr3O2OkZo3lT1obKjlP8yfJLWcyeopA69QWCHa3CyVZyiHMd7ywHPsQB0RJatB9nVlVtgvV98iemnZ9XVeTqN35O6nWKZG5+E+EraQWtqDwcuD5D/yBSzFA4TAo7CZZKzZIjiWuN8wrCxfOnEL7dq/3cmZKoRLpS2wv5Tvq3VW8IOYA5k1GjxSbLU5ZooKEa4zn0A0Ydfy+D5ANrITDhNYX16tPIFkcNM3qafvLF5R9Qvm+u9hebSACPX7pYWjT5C50y13mplpp/jDg8OcV9o3B//UVKhvcA== 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=3I6uLtCmTopaYKhwbNqFgFvT0LPiGRjr3lx3yDmpLLA=; b=DJf1b3VmDrtI6UCJofoDQ9z1veavzEPhqmL3X9NjnuY2b2FpG8XhP8/YCAOXLgLoJ1lDWJiY1CwDjy7eS/NpWi5QI2ZJFksUJvlEEh2v8jHmrU2rLDVV5mYeUwO9y5ov/LloCoIFhfVteNa7ReFX/J+0U6TaX6KLWnYDqzfXi2JdZzgmSAECIj6jKi6SXV5zOEEhlo0RI2TIOq2xZiBu31eMjBiCb0rAAuq1N3zr2Se+hABbZbb3XYs2oDbWjSRmv4uBtN34T/oveBsDO55LaxZKNNPK5DLBucI5rRwlxgfcqp4jwfllwSqGmAiSmOdVO/88Si0q02eqTrPuTTQYVA== 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=3I6uLtCmTopaYKhwbNqFgFvT0LPiGRjr3lx3yDmpLLA=; b=ZzdRgnS1IM7RT44xBfrKTf0BjDU7GYQYmGnaTQ0iR26udhI1Al1CFRhEp7SE4m9XJRMQhiv8qDxQErLFDdWpvTq6UVS/KCOgJJhHI46wCS9zUej+mPnTEBgs61CZ2GC1ZfFyI93W1t+DwCLC78rGnvv11oM9mdBUt6Cz/O9emoI= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4142.namprd11.prod.outlook.com (20.179.149.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.15; Mon, 16 Dec 2019 17:06:45 +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:06:45 +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 44/55] staging: wfx: hif_scan() never fails Thread-Topic: [PATCH 44/55] staging: wfx: hif_scan() never fails Thread-Index: AQHVtDLNDPsXBjorwEOj2oBe9WWPaA== Date: Mon, 16 Dec 2019 17:03:56 +0000 Message-ID: <20191216170302.29543-45-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: 0e7b4041-f3e9-48a3-3f52-08d7824a549e x-ms-traffictypediagnostic: MN2PR11MB4142: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 02530BD3AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(396003)(346002)(136003)(376002)(39850400004)(199004)(189003)(6512007)(71200400001)(91956017)(6486002)(8676002)(2906002)(54906003)(81166006)(81156014)(186003)(76116006)(478600001)(36756003)(85182001)(85202003)(6666004)(66556008)(66476007)(66446008)(64756008)(1076003)(316002)(2616005)(4326008)(6506007)(26005)(8936002)(110136005)(5660300002)(107886003)(66946007)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4142;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: +PD8z0tQUSse1vZLwKaHJeg6ymZItvjB2cDQUy3ycOpTZaY7ao/YSERs9mhy4d5pxGNwdCPHMbS0QmsWQEUaXfzzRnkKOwk9S0lNCdiD6vt8CoD7xGKS7QAOcTB4cdon41GfpNCzgrAobrAxZxGXZWbPGnKf3t5uc3L7xTfaVM+MGs9ZqlQ4e4WxaV2VyG4d93+s5EH29o7/SqbYRK+j/iRJO1bNQShOKE2YrBgNd6elHkOHZ/XkZnDcKu+vOrTs134Ci8hr2LF/zp6TIoyeB5yXVVymuZy8NRnac2onyCTRw8pdGDBniqe44uZ14DZTieb0ZPNlcDmpNryhUnZuY02vXtUdffCczzW5O0coUJFXDApkPF9suLvVgVKsHbS7igM9xDx8ApHq4A6uEAaGxmBwVxyYy96dkWMIo612R9FavaPeucgxpV6sLCQL7SHI Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e7b4041-f3e9-48a3-3f52-08d7824a549e X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:56.2211 (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: EGbLEvmmDrcLNXh4C6lVK7KOvXFY1TpRv2OQmKmSrm1wj20HNcr0uEmI6+5mo3hIVZhBaYxfwLaOFQzKJoJp5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4142 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller If scan fails, status is returned in hif_ind_scan_cmpl. hif_scan always return a success. So, we can simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/scan.c | 20 ++------------------ drivers/staging/wfx/scan.h | 1 - 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 4b95e6a97df7..cdccb67cb30e 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -36,7 +36,6 @@ static void wfx_scan_restart_delayed(struct wfx_vif *wvif) static int wfx_scan_start(struct wfx_vif *wvif, struct wfx_scan_params *scan) { - int ret; int tmo = 500; if (wvif->state == WFX_STATE_PRE_STA) @@ -48,15 +47,8 @@ static int wfx_scan_start(struct wfx_vif *wvif, struct wfx_scan_params *scan) atomic_set(&wvif->wdev->scan_in_progress, 1); schedule_delayed_work(&wvif->scan.timeout, msecs_to_jiffies(tmo)); - ret = hif_scan(wvif, scan); - if (ret) { - wfx_scan_failed_cb(wvif); - atomic_set(&wvif->scan.in_progress, 0); - atomic_set(&wvif->wdev->scan_in_progress, 0); - cancel_delayed_work_sync(&wvif->scan.timeout); - wfx_scan_restart_delayed(wvif); - } - return ret; + hif_scan(wvif, scan); + return 0; } int wfx_hw_scan(struct ieee80211_hw *hw, @@ -245,14 +237,6 @@ static void wfx_scan_complete(struct wfx_vif *wvif) wfx_scan_work(&wvif->scan.work); } -void wfx_scan_failed_cb(struct wfx_vif *wvif) -{ - if (cancel_delayed_work_sync(&wvif->scan.timeout) > 0) { - wvif->scan.status = -EIO; - schedule_work(&wvif->scan.timeout.work); - } -} - void wfx_scan_complete_cb(struct wfx_vif *wvif, const struct hif_ind_scan_cmpl *arg) { diff --git a/drivers/staging/wfx/scan.h b/drivers/staging/wfx/scan.h index c7c0ab178c87..e71e5f0f522e 100644 --- a/drivers/staging/wfx/scan.h +++ b/drivers/staging/wfx/scan.h @@ -38,6 +38,5 @@ void wfx_scan_work(struct work_struct *work); void wfx_scan_timeout(struct work_struct *work); void wfx_scan_complete_cb(struct wfx_vif *wvif, const struct hif_ind_scan_cmpl *arg); -void wfx_scan_failed_cb(struct wfx_vif *wvif); #endif /* WFX_SCAN_H */