From patchwork Tue Dec 17 16:15:28 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: 11298131 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 CE5BD14B7 for ; Tue, 17 Dec 2019 16:18:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A235824679 for ; Tue, 17 Dec 2019 16:18:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Mq++CyPp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728888AbfLQQSI (ORCPT ); Tue, 17 Dec 2019 11:18:08 -0500 Received: from mail-dm6nam12on2072.outbound.protection.outlook.com ([40.107.243.72]:33729 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729013AbfLQQPy (ORCPT ); Tue, 17 Dec 2019 11:15:54 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D9fymUrmZlaRhDthp6CRECFfOpT22K5ON5Mtda0sgr8oaIfIswnaGUYerPSDcm3GYbN7ck3LTStG0durbPt5FOZeHp2ZzHCN/RGIzNR6qnRrMO8t9UCcPiu8Jv3F09FeeJ/qIPz5FVTJi9tCtQkW3T3F6a19ccIHWrpy6RDgQxADCBHwvtDwMeEG6ACiu7sRiUPHwaxNyK15GupzmFvy78Xn5dpYv4d6R2apsc5MuVQ4GWSRaNpG6Te0+mm2zpKBy+FXckt8PmKtpOYfaHzsWBEVPbKSN1PD11FCGtLo4qVa2zWu/WjHIgYOxW3lN+SaLKWuWZhFZ+dLgx5DrO6bJw== 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=Me8/rbIanGxpbYOTeZgvzL3WSGozBd3Rm0cYjOm2ft0=; b=H5kweVL8y1gsvAjwqRWBwtyFoqq/LjRNJzfI0fejaCvOfkiH8e3jDxsNN0CpVchWl8AWyeXW1ySZ4ndP+03wwkIsOABLbKn9t6Rtx+iUUQ2AxPtNdeBNR7U5uN1bXA22RFUAhAw5WPY7Dj9e0yHQIB8Gyw3UkP5QKgWZvArsC7G6WTZ0vctdYqKIZ5O6hR/u25Fas5BsBM5KIkUvIO1qbZMv7TFbY0LQtJuDAx+JWvwrXSEe4OvuDKyg8QrB5f2nENQ9cZHA8kBRpjq7ryl7cw38iuharf0TQJ7yP2fsxL0c3V3uaVft2V9gkmx3pdtzcjPjreXmqIng0KPAiLkBAA== 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=Me8/rbIanGxpbYOTeZgvzL3WSGozBd3Rm0cYjOm2ft0=; b=Mq++CyPpBSPdRhLNSyVR70Pm0Md7AO4FM6bKa4ATzgjnyg/Qnf5nQY3fU5rMJi1+WUSNou/BpOCTtE6K4WOnJ1ZnYE5QRNi9qVyIjPiWaP4Q1vgLGdTlxBMqYBpw/UXblZpq8GORTrjVkXyZ/3+W+djod6rAPl8+PpfPqJ/Rmmk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4477.namprd11.prod.outlook.com (52.135.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Tue, 17 Dec 2019 16:15:48 +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:15:48 +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 44/55] staging: wfx: hif_scan() never fails Thread-Topic: [PATCH v2 44/55] staging: wfx: hif_scan() never fails Thread-Index: AQHVtPUyvEYYGiAvQkWgAuq5fP/76Q== Date: Tue, 17 Dec 2019 16:15:28 +0000 Message-ID: <20191217161318.31402-45-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: e69c46a4-94cd-44f1-5385-08d7830c54c7 x-ms-traffictypediagnostic: MN2PR11MB4477: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(1076003)(186003)(107886003)(8676002)(6506007)(86362001)(478600001)(85182001)(5660300002)(81156014)(26005)(4326008)(6486002)(8936002)(316002)(110136005)(54906003)(64756008)(66446008)(66946007)(2616005)(66556008)(66476007)(85202003)(36756003)(6512007)(2906002)(52116002)(6666004)(71200400001)(81166006);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4477;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: 0eIBLABmbMQrdiVPf3o/CLEvTVYUhBW35a0h0GKqbyd43sNGJ8j3yV4Fa9k9sIqHrJnbDuFiKCnGBpWXedDAXEqgF7f2Ikm59nuTzMQJMUM8O0hBgbsnUGvZ6ZbnZqdDXfa611gJRrfQiVRLcJoLHC6Kv/KlnfwqOG8yJLTnL14EBV6MK5kjoafOD4U4VmkvTrAjgE4xU65hVST/MT3PxwG6Lo3CZwUVjkYsd1s4ocEU4vNBFW34LAjGaUsWRJ5NVnobclj7wNX8U/cN1a8ZEGUbAMymsyds6KEjQ3hir2q00OuNA9AkCTVk+2nmo1DwFHe1aPR0hG68Z4yVkp2ApevTQhYXP0m0hSmYWjJ3pRwJaCsl+ss4udFHx/JlgX73suiW0nxeEvkN4IDEy9+nbbYKdYkToko/RgWvq4oqTPFgXsfxDGpqvWlXjupwc/qj Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e69c46a4-94cd-44f1-5385-08d7830c54c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:15:28.2919 (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: 3UHIqdDLykm3GyqZmhRKhFyGBpw2mVA8i3TQ+Fcu3MgqjP6/vXd3Xq+cla6c2ZnC2kmlQj8jYxS8qMBeGLlS7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4477 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 */