From patchwork Thu Nov 8 21:50:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adham Abozaeid X-Patchwork-Id: 10675045 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C5381709 for ; Thu, 8 Nov 2018 21:50:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED7D52E5E1 for ; Thu, 8 Nov 2018 21:50:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E15B92E5EF; Thu, 8 Nov 2018 21:50:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B2AF2E5E1 for ; Thu, 8 Nov 2018 21:50:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726962AbeKIH1x (ORCPT ); Fri, 9 Nov 2018 02:27:53 -0500 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:2002 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725922AbeKIH1x (ORCPT ); Fri, 9 Nov 2018 02:27:53 -0500 X-IronPort-AV: E=Sophos;i="5.54,480,1534834800"; d="scan'208";a="22879527" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 08 Nov 2018 14:50:27 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Thu, 8 Nov 2018 14:50:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lEhbYjPu1w3y79Lc8Hi9WLBo8mJODf0/K0v5NvbLAtc=; b=l6T/FBfVouxU6knmeGiNlQ9f/BuZGvpL1CdsA8gk5bC/QTLvw0AKYEHFiaYAy8o1OjUpMJE39Oi4cKhguKHyrL7fcn1wUxL43xCi9lxlciPd65FSIAkzVZV9jmlSmWFfT5N7U31+ZJVCEgnbg134MpcPQV0smAKV1o8C9yBB6xY= Received: from SN6PR11MB3407.namprd11.prod.outlook.com (52.135.111.96) by SN6PR11MB3488.namprd11.prod.outlook.com (52.135.112.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.30; Thu, 8 Nov 2018 21:50:25 +0000 Received: from SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::7d22:c5b8:9e2e:2281]) by SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::7d22:c5b8:9e2e:2281%2]) with mapi id 15.20.1294.034; Thu, 8 Nov 2018 21:50:25 +0000 From: To: CC: , , , , , Subject: [PATCH v4 1/3] staging: wilc1000: validate cfg parameters before scheduling the work Thread-Topic: [PATCH v4 1/3] staging: wilc1000: validate cfg parameters before scheduling the work Thread-Index: AQHUd60OPPKaRhG55ECM4r3T1Ef7vA== Date: Thu, 8 Nov 2018 21:50:25 +0000 Message-ID: <20181108214915.3733-2-adham.abozaeid@microchip.com> References: <20181108214915.3733-1-adham.abozaeid@microchip.com> In-Reply-To: <20181108214915.3733-1-adham.abozaeid@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [198.175.253.81] x-clientproxiedby: BYAPR07CA0013.namprd07.prod.outlook.com (2603:10b6:a02:bc::26) To SN6PR11MB3407.namprd11.prod.outlook.com (2603:10b6:805:bd::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Adham.Abozaeid@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SN6PR11MB3488;6:GvAquuirBpQ3WORDLWHxzoLsWbSCsprlgDwOfqe6IaA6necZykdvwZRGabtisbrxjin+d0t4GnmAojM99shbQTz6I9eWQbW9l+uDhXgybERXbhVarn5ANY9kHuQE7vYTXCkog4EoDCulZ+Fc6nY70BHE45Lv6tz7rkxCeoftieHnDz0GSTNbB6+YxelhnmMfYSJkLlEXYQvm0iIkjhV7UNHu99PIakD1bFHLM5S67FSwExYfSZo2oe0LfetyPfkjdcDEA1ql8YXI/r413a6y7zJ8Gb+ZozbZBghCbEjjewoeApM7t0tNI6LI4GbA3TdEFxoJz6jKu2MWmcf0gPjvfLHY0jBhNwnkLm8Ym7TLLjbV8vCPowM16Oltylt7286jSVPT1FKdQn+ldy55c6K4dCnHIAFs1lfWqxYHnEiNJQB0PI/6aKLopdu/qt70Xe/v5NmMsXboV3RfKCx1ke222g==;5:BybZuY0VpkmHpEZQqCzBK/iim75O0XGs++ANCzdb7C/KXVgrxH7XnN8oNpD95Pm3zS1WC30WvNcufhs2jp+ZKVoaw4oAbjSFOza3Lzfmroo//ppusT6GWy5hAzVLO1RyfSZO0wfmPFAd/9uj+bH7Co5qhFNJI4ak7jDpeiyyPPs=;7:4JaLRjARlHaki7RTOFVSB04Em1PiOb5suAUJluxbtgXnVG4ZHGhWYeWqLEr1r3K2ewvCXmDle0vEhJLs4e9Ya/N63ozIVdsqk5X6rB2mKWIttZRCkR/Rf09IGCUaU8Sk0SCNBxxzKbbsfgYbs2UHaw== x-ms-office365-filtering-correlation-id: 275bca13-4d13-42da-470a-08d645c43097 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:SN6PR11MB3488; x-ms-traffictypediagnostic: SN6PR11MB3488: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:SN6PR11MB3488;BCL:0;PCL:0;RULEID:;SRVR:SN6PR11MB3488; x-forefront-prvs: 0850800A29 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(366004)(396003)(39860400002)(136003)(376002)(199004)(189003)(5640700003)(52116002)(76176011)(386003)(6506007)(1076002)(6436002)(14454004)(6486002)(25786009)(7736002)(6916009)(99286004)(305945005)(6512007)(81156014)(81166006)(66066001)(8676002)(186003)(8936002)(478600001)(68736007)(97736004)(26005)(2501003)(5660300001)(53936002)(3846002)(6116002)(102836004)(15650500001)(4326008)(106356001)(71200400001)(71190400001)(476003)(105586002)(2351001)(2616005)(54906003)(316002)(14444005)(486006)(86362001)(256004)(446003)(2906002)(36756003)(72206003)(2900100001)(11346002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR11MB3488;H:SN6PR11MB3407.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: QcTxEnxN14pJKXrLmHXbatnQ60qPernQyuphnnC4p22WbQ1oE3H+l+ALE/cfmCPRDiFet+3V/Z4G1pIsBsgrR+qZH/3mPRzPRJKtzdDX9jJ9BD+zJAAEeevWSnmTUEvnVrUVzWvkms/ogdW6+SHydqfiIQTSOCrp94Bv/nDdENva7DFgyupW4554er74zxOMFnoWKAlwxYKR+yPoU4ta85vJnrQYoiTiaaMMeC8mYkwYMAyf+2lWODyfxPM6lkfCdC+SjjTL5NhyHo6SApHKw6OhXgbB9jyrYo2pFTAnBTL6WFe2XvA8gXK+GDzMI7Jni5w9G2JcwcPxMv4HM4Vhxegc6azj4T3OH1ubq0Y6hJg= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 275bca13-4d13-42da-470a-08d645c43097 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2018 21:50:25.2818 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3488 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Adham Abozaeid From: Adham Abozaeid Validate cfg parameters after being called by cfg80211 in set_wiphy_params before scheduling the work executed in handle_cfg_param Signed-off-by: Adham Abozaeid --- drivers/staging/wilc1000/host_interface.c | 61 ++++++------------- .../staging/wilc1000/wilc_wfi_cfgoperations.c | 32 ++++++++-- 2 files changed, 48 insertions(+), 45 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b89116c57064..c1215c194907 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -377,61 +377,41 @@ static void handle_cfg_param(struct work_struct *work) if (param->flag & RETRY_SHORT) { u16 retry_limit = param->short_retry_limit; - if (retry_limit > 0 && retry_limit < 256) { - wid_list[i].id = WID_SHORT_RETRY_LIMIT; - wid_list[i].val = (s8 *)¶m->short_retry_limit; - wid_list[i].type = WID_SHORT; - wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.short_retry_limit = retry_limit; - } else { - netdev_err(vif->ndev, "Range(1~256) over\n"); - goto unlock; - } + wid_list[i].id = WID_SHORT_RETRY_LIMIT; + wid_list[i].val = (s8 *)¶m->short_retry_limit; + wid_list[i].type = WID_SHORT; + wid_list[i].size = sizeof(u16); + hif_drv->cfg_values.short_retry_limit = retry_limit; i++; } if (param->flag & RETRY_LONG) { u16 limit = param->long_retry_limit; - if (limit > 0 && limit < 256) { - wid_list[i].id = WID_LONG_RETRY_LIMIT; - wid_list[i].val = (s8 *)¶m->long_retry_limit; - wid_list[i].type = WID_SHORT; - wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.long_retry_limit = limit; - } else { - netdev_err(vif->ndev, "Range(1~256) over\n"); - goto unlock; - } + wid_list[i].id = WID_LONG_RETRY_LIMIT; + wid_list[i].val = (s8 *)¶m->long_retry_limit; + wid_list[i].type = WID_SHORT; + wid_list[i].size = sizeof(u16); + hif_drv->cfg_values.long_retry_limit = limit; i++; } if (param->flag & FRAG_THRESHOLD) { u16 frag_th = param->frag_threshold; - if (frag_th > 255 && frag_th < 7937) { - wid_list[i].id = WID_FRAG_THRESHOLD; - wid_list[i].val = (s8 *)¶m->frag_threshold; - wid_list[i].type = WID_SHORT; - wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.frag_threshold = frag_th; - } else { - netdev_err(vif->ndev, "Threshold Range fail\n"); - goto unlock; - } + wid_list[i].id = WID_FRAG_THRESHOLD; + wid_list[i].val = (s8 *)¶m->frag_threshold; + wid_list[i].type = WID_SHORT; + wid_list[i].size = sizeof(u16); + hif_drv->cfg_values.frag_threshold = frag_th; i++; } if (param->flag & RTS_THRESHOLD) { u16 rts_th = param->rts_threshold; - if (rts_th > 255) { - wid_list[i].id = WID_RTS_THRESHOLD; - wid_list[i].val = (s8 *)¶m->rts_threshold; - wid_list[i].type = WID_SHORT; - wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.rts_threshold = rts_th; - } else { - netdev_err(vif->ndev, "Threshold Range fail\n"); - goto unlock; - } + wid_list[i].id = WID_RTS_THRESHOLD; + wid_list[i].val = (s8 *)¶m->rts_threshold; + wid_list[i].type = WID_SHORT; + wid_list[i].size = sizeof(u16); + hif_drv->cfg_values.rts_threshold = rts_th; i++; } @@ -441,7 +421,6 @@ static void handle_cfg_param(struct work_struct *work) if (ret) netdev_err(vif->ndev, "Error in setting CFG params\n"); -unlock: mutex_unlock(&hif_drv->cfg_values_lock); kfree(msg); } diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 4fbbbbd5a64b..a6f4fad43bf7 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -1149,21 +1149,45 @@ static int set_wiphy_params(struct wiphy *wiphy, u32 changed) cfg_param_val.flag = 0; if (changed & WIPHY_PARAM_RETRY_SHORT) { + netdev_dbg(vif->ndev, + "Setting WIPHY_PARAM_RETRY_SHORT %d\n", + wiphy->retry_short); cfg_param_val.flag |= RETRY_SHORT; cfg_param_val.short_retry_limit = wiphy->retry_short; } if (changed & WIPHY_PARAM_RETRY_LONG) { + netdev_dbg(vif->ndev, + "Setting WIPHY_PARAM_RETRY_LONG %d\n", + wiphy->retry_long); cfg_param_val.flag |= RETRY_LONG; cfg_param_val.long_retry_limit = wiphy->retry_long; } if (changed & WIPHY_PARAM_FRAG_THRESHOLD) { - cfg_param_val.flag |= FRAG_THRESHOLD; - cfg_param_val.frag_threshold = wiphy->frag_threshold; + if (wiphy->frag_threshold > 255 && + wiphy->frag_threshold < 7937) { + netdev_dbg(vif->ndev, + "Setting WIPHY_PARAM_FRAG_THRESHOLD %d\n", + wiphy->frag_threshold); + cfg_param_val.flag |= FRAG_THRESHOLD; + cfg_param_val.frag_threshold = wiphy->frag_threshold; + } else { + netdev_err(vif->ndev, + "Fragmentation threshold out of range\n"); + return -EINVAL; + } } if (changed & WIPHY_PARAM_RTS_THRESHOLD) { - cfg_param_val.flag |= RTS_THRESHOLD; - cfg_param_val.rts_threshold = wiphy->rts_threshold; + if (wiphy->rts_threshold > 255) { + netdev_dbg(vif->ndev, + "Setting WIPHY_PARAM_RTS_THRESHOLD %d\n", + wiphy->rts_threshold); + cfg_param_val.flag |= RTS_THRESHOLD; + cfg_param_val.rts_threshold = wiphy->rts_threshold; + } else { + netdev_err(vif->ndev, "RTS threshold out of range\n"); + return -EINVAL; + } } ret = wilc_hif_set_cfg(vif, &cfg_param_val); From patchwork Thu Nov 8 21:50:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adham Abozaeid X-Patchwork-Id: 10675049 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BFEE9109C for ; Thu, 8 Nov 2018 21:50:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF8CA2E5E1 for ; Thu, 8 Nov 2018 21:50:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3E2B2E5EB; Thu, 8 Nov 2018 21:50:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 307042E5E1 for ; Thu, 8 Nov 2018 21:50:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727080AbeKIH1y (ORCPT ); Fri, 9 Nov 2018 02:27:54 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:31324 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726834AbeKIH1x (ORCPT ); Fri, 9 Nov 2018 02:27:53 -0500 X-IronPort-AV: E=Sophos;i="5.54,480,1534834800"; d="scan'208";a="22570809" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 08 Nov 2018 14:50:27 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.37) with Microsoft SMTP Server (TLS) id 14.3.352.0; Thu, 8 Nov 2018 14:50:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zzpIAdbhOE52KmbDJxdPd0Pa7aLWv1G2ZBzX24foXSQ=; b=bam4xG0f64TL0rFkxpna1ZBmjIYWIF+uJ/yhFqik2vPt+/el1q7wQxMOgD9qZL4fq7YyZ0U57PVdh0vSSdmBSRsHUpRcYg3y/ivhrEhxJj3wq59HoJgKQwGonsrgaq9np8TX+r1JW+QIefPSJ9UGiJZLqiRcrUpTHmYMnmdZofM= Received: from SN6PR11MB3407.namprd11.prod.outlook.com (52.135.111.96) by SN6PR11MB3488.namprd11.prod.outlook.com (52.135.112.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.30; Thu, 8 Nov 2018 21:50:26 +0000 Received: from SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::7d22:c5b8:9e2e:2281]) by SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::7d22:c5b8:9e2e:2281%2]) with mapi id 15.20.1294.034; Thu, 8 Nov 2018 21:50:26 +0000 From: To: CC: , , , , , Subject: [PATCH v4 2/3] staging: wilc1000: Don't keep a copy of wiphy parameters in the driver Thread-Topic: [PATCH v4 2/3] staging: wilc1000: Don't keep a copy of wiphy parameters in the driver Thread-Index: AQHUd60Ox6nih17oSEq0nQPk5STKLg== Date: Thu, 8 Nov 2018 21:50:26 +0000 Message-ID: <20181108214915.3733-3-adham.abozaeid@microchip.com> References: <20181108214915.3733-1-adham.abozaeid@microchip.com> In-Reply-To: <20181108214915.3733-1-adham.abozaeid@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [198.175.253.81] x-clientproxiedby: BYAPR07CA0013.namprd07.prod.outlook.com (2603:10b6:a02:bc::26) To SN6PR11MB3407.namprd11.prod.outlook.com (2603:10b6:805:bd::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Adham.Abozaeid@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SN6PR11MB3488;6:Z6hd6bGkx4kmiuY7VlrnptT0O19TTg/Dfe2oqS5aURFZ/lLCrjPA2dgTshJPL+oEFTd7zaqPgPJ8ppHAK6q7+C9H3Tqf5M4B7EX7eMWe0CIkalX6OI7JDnU+6xlTgaI/rHqPvebiro93bdZDGxMlktkSFLAhAUpW3BBVaNfD9ApjvAmdlSyuTIeYSkPSLoaip0eep2xOFrr47ZEIXx9vT4Pma7akcKsJxGVIxDhT0Ed3N7wUNYxT109e7TSInmnPGT3PpA5mtzeF1haOMkb0SKUpConYhk6HGadt5qTU4EUdtGYKwPHrPpOMq4JfUBqM8e4uTIpBomKMWgjA7wXTiR9HrdX5Y1173C/zGFhS9jgmdwmp4DXlZFtcbKYh8rgimSyb0TseKnPOVBK6IIy/2PhzrVZq+Y2AI3O4gRFnoWSrmqNb6TXATw+/y9GfsURiRCWQKwj9jsXgiGF1eDXWOg==;5:H+P/h3hbt0DPcAH7zRu17UO5KjojF/jBbPHF/bDcQ1qAmFLTOuVC0O5cSU8aivWtwJqxQn8emELD1SSCfp2iqwjWQWTjt9Cvn9OijGat31LaKMffnLr5C6Fwg7v47xwqDBGNbG3Y4FGeHrJ0noVr+k6gmRxLiBtYbeIS4+l1+0A=;7:QaefpSpkPdwuwQMnTi4S5GDBUSCxpaIzLr6m4v2OtNGF6IYf3XpT5t9gVEF77+9gKad0ulqVQMVvH6vRliCZJKSl5qQBGqOTV6Rl7skKV/tCtdDFbFf6epCyJmIz9iGTIu1PdZIGwtL5BpZuWEPF6Q== x-ms-office365-filtering-correlation-id: 80644751-5e3f-45da-a457-08d645c43115 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:SN6PR11MB3488; x-ms-traffictypediagnostic: SN6PR11MB3488: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:SN6PR11MB3488;BCL:0;PCL:0;RULEID:;SRVR:SN6PR11MB3488; x-forefront-prvs: 0850800A29 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(366004)(396003)(39860400002)(136003)(376002)(199004)(189003)(5640700003)(52116002)(76176011)(386003)(6506007)(1076002)(6436002)(14454004)(6486002)(25786009)(7736002)(6916009)(99286004)(305945005)(6512007)(81156014)(81166006)(66066001)(8676002)(186003)(8936002)(478600001)(68736007)(97736004)(26005)(2501003)(5660300001)(53936002)(3846002)(6116002)(102836004)(4326008)(106356001)(71200400001)(71190400001)(476003)(105586002)(2351001)(2616005)(54906003)(316002)(14444005)(486006)(86362001)(256004)(446003)(2906002)(36756003)(72206003)(2900100001)(11346002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR11MB3488;H:SN6PR11MB3407.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: GSek9Us83DG7ovFcJarbTllaXlMqaWN334O0Ui6Ewp/WgPUxcP8DFaJkgE5piAxFl7OwWpXTelj2/2aXA3qbN43f0t1D9njZgo2EqZC6tMfA5yogVyJ0oFs+GCtm8k/9kAAL2XMRZXasctNUDhreMyUzbvCTi+yaniuEV5WhSvZkJF6h+5xWa4pfUyYxR/xOrXPLNkwP/Wn1hOhv1rDqhg61miX4HgfhbU6YsulOAQIzOaAnZRxaZNUPImOmnF1bmOIZG3zwEXe9TTcAmWp3UbO8Yavwbd+rNYcC7yCrxy8Aa2YK2qL2pxnZqWTRwjkkZqJoZ9YS3qgHfTjGDrDS7UMbgwQnocHRr1SRzXvbfxo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 80644751-5e3f-45da-a457-08d645c43115 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2018 21:50:26.1099 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3488 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Adham Abozaeid From: Adham Abozaeid host_if_drv.cfg_values is a write only member, and can be removed Signed-off-by: Adham Abozaeid --- drivers/staging/wilc1000/host_interface.c | 13 ------------- drivers/staging/wilc1000/host_interface.h | 1 - 2 files changed, 14 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c1215c194907..8d1142776310 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -375,43 +375,31 @@ static void handle_cfg_param(struct work_struct *work) mutex_lock(&hif_drv->cfg_values_lock); if (param->flag & RETRY_SHORT) { - u16 retry_limit = param->short_retry_limit; - wid_list[i].id = WID_SHORT_RETRY_LIMIT; wid_list[i].val = (s8 *)¶m->short_retry_limit; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.short_retry_limit = retry_limit; i++; } if (param->flag & RETRY_LONG) { - u16 limit = param->long_retry_limit; - wid_list[i].id = WID_LONG_RETRY_LIMIT; wid_list[i].val = (s8 *)¶m->long_retry_limit; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.long_retry_limit = limit; i++; } if (param->flag & FRAG_THRESHOLD) { - u16 frag_th = param->frag_threshold; - wid_list[i].id = WID_FRAG_THRESHOLD; wid_list[i].val = (s8 *)¶m->frag_threshold; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.frag_threshold = frag_th; i++; } if (param->flag & RTS_THRESHOLD) { - u16 rts_th = param->rts_threshold; - wid_list[i].id = WID_RTS_THRESHOLD; wid_list[i].val = (s8 *)¶m->rts_threshold; wid_list[i].type = WID_SHORT; wid_list[i].size = sizeof(u16); - hif_drv->cfg_values.rts_threshold = rts_th; i++; } @@ -3256,7 +3244,6 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) mutex_lock(&hif_drv->cfg_values_lock); hif_drv->hif_state = HOST_IF_IDLE; - hif_drv->cfg_values.scan_source = DEFAULT_SCAN; hif_drv->p2p_timeout = 0; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index df9fc33be094..1e2e50e91f76 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -293,7 +293,6 @@ struct host_if_drv { enum host_if_state hif_state; u8 assoc_bssid[ETH_ALEN]; - struct cfg_param_attr cfg_values; /*lock to protect concurrent setting of cfg params*/ struct mutex cfg_values_lock; From patchwork Thu Nov 8 21:50:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adham Abozaeid X-Patchwork-Id: 10675047 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5D6D117D4 for ; Thu, 8 Nov 2018 21:50:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D3CD2E5EB for ; Thu, 8 Nov 2018 21:50:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DA4F2E5EA; Thu, 8 Nov 2018 21:50:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82B982E5EA for ; Thu, 8 Nov 2018 21:50:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727171AbeKIH1y (ORCPT ); Fri, 9 Nov 2018 02:27:54 -0500 Received: from esa5.microchip.iphmx.com ([216.71.150.166]:26825 "EHLO esa5.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725922AbeKIH1y (ORCPT ); Fri, 9 Nov 2018 02:27:54 -0500 X-IronPort-AV: E=Sophos;i="5.54,480,1534834800"; d="scan'208";a="20876584" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 08 Nov 2018 14:50:29 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.49) with Microsoft SMTP Server (TLS) id 14.3.352.0; Thu, 8 Nov 2018 14:50:28 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T3KObEkbPz4jccTL7w80AmdFDKQ9xwpHj6KxIZY+mWU=; b=N0rLpImo5te73geRz23VcowLAzYOcDZ682G6qNI48oLmGNMkGJR8Nk5Amvw9lptaYY16FS6HAwEkF9GkGnmryZHS6bGaLbFhiNFNQ9ofnbFbyYy8U/mR0IIj+0mukl6lX2bmftZFpfIl0NeZfXxiVOhR3Pt6PwdPlffO8ydEWkE= Received: from SN6PR11MB3407.namprd11.prod.outlook.com (52.135.111.96) by SN6PR11MB3488.namprd11.prod.outlook.com (52.135.112.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.30; Thu, 8 Nov 2018 21:50:27 +0000 Received: from SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::7d22:c5b8:9e2e:2281]) by SN6PR11MB3407.namprd11.prod.outlook.com ([fe80::7d22:c5b8:9e2e:2281%2]) with mapi id 15.20.1294.034; Thu, 8 Nov 2018 21:50:27 +0000 From: To: CC: , , , , , Subject: [PATCH v4 3/3] staging: wilc1000: Remove unused mutex cfg_values_lock Thread-Topic: [PATCH v4 3/3] staging: wilc1000: Remove unused mutex cfg_values_lock Thread-Index: AQHUd60PoDvgX4MtM0y06vbKZOtDFA== Date: Thu, 8 Nov 2018 21:50:26 +0000 Message-ID: <20181108214915.3733-4-adham.abozaeid@microchip.com> References: <20181108214915.3733-1-adham.abozaeid@microchip.com> In-Reply-To: <20181108214915.3733-1-adham.abozaeid@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [198.175.253.81] x-clientproxiedby: BYAPR07CA0013.namprd07.prod.outlook.com (2603:10b6:a02:bc::26) To SN6PR11MB3407.namprd11.prod.outlook.com (2603:10b6:805:bd::32) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Adham.Abozaeid@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SN6PR11MB3488;6:VbLndyoShiBNWoYUnBmHhjSOlQQ2LmOZVIP0rMP4lc3TGSQRJiIF96w8iMM6+fErgvxpBkFC/iVS9IEygW7AxHoO+1QfNrb+ZPbEK3hVXc2y37kwM5c5Ofb3KZpF89sztvNYfgxJBYc+iiIwUvIGrZU/kQimqqY5H1iAycxtd/9RWzTiZ8Bd75mh9QvIr28YTljKgu9UQSN8w9AMRCQCnL5K7Gzxvjb6o4+rLXgx/Y+ebMQmAADyCU00da1MusunTxfzovxsWMbrSGeMb8bhRNXhmZZwyW7tqjJpue+x2X9va8SU8HL8dlVy7QVvEfu3QBuaMCfbI7QvPl9qtAzRmWRnCwpREbupeHtgAieCbUj9F1clKXGBi6Zr4Z/t77vhIGEPGLiS1W0PDsrIMkSdubUpu+yPZV4Sr0l1216uX574nldTaLiRVwPqQWpG3/FyA0tq3LZJ7iVJM5Gw7pVuzw==;5:hI94xUrByOj+02JXK4vHJTAPx4XxugrqbuJNsMAezmRcocHnUV8TDxpZOb1zOZVH3WNewAz13A2RNpiX2fHWkK4U4o/MuGfkXnS/ii1Cx3fuE2/fjFom8sTawnmfcrWMpbefOKP3IR3/8fjZPGNcv1yb7vpFLpe/T6mZSLSEYDo=;7:QknZDx1iFDBdNSLkYA6Xtk88aPMI4yBO3TTesZ8AcRo+DeSTr1iPz1joiWt8WWTQzhfJG4pqRMCMl9gEDNUk3s2wIhze6jZ5I/CUed7ArQXP7HhcNZsNkskUmv5pznBu6sE5bxXA357HxvHvQZPpIw== x-ms-office365-filtering-correlation-id: cf3bd9cc-2b9f-45f5-6429-08d645c43196 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:SN6PR11MB3488; x-ms-traffictypediagnostic: SN6PR11MB3488: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(21532816269658); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:SN6PR11MB3488;BCL:0;PCL:0;RULEID:;SRVR:SN6PR11MB3488; x-forefront-prvs: 0850800A29 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(366004)(396003)(39860400002)(136003)(376002)(199004)(189003)(5640700003)(52116002)(76176011)(386003)(6506007)(1076002)(6436002)(14454004)(6486002)(25786009)(7736002)(6916009)(99286004)(305945005)(6512007)(81156014)(81166006)(66066001)(8676002)(186003)(8936002)(478600001)(68736007)(97736004)(26005)(2501003)(5660300001)(53936002)(3846002)(6116002)(102836004)(4326008)(106356001)(71200400001)(71190400001)(476003)(105586002)(2351001)(2616005)(54906003)(316002)(14444005)(486006)(86362001)(256004)(446003)(2906002)(36756003)(72206003)(2900100001)(11346002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR11MB3488;H:SN6PR11MB3407.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: tnPlV/c7zsRFYwSCyciz0FH1Vm/t95fLv8uKvtAgIWVq9smzOfSW2vUFo9tYjrxJmbmXCSx2mNg2oJfgPCguQvLNxcbN53ctvSZGhY/j1llVb5oMnQpUksqu6WR0sKaWd/jFxPHZrmKvZyx9GSlOspNuOGGu7B+GzID98IRW9pgeA/bFIE/EoQogw4X8Hnvf4jdOsakrbM+DA7dGZ9BjiAGdulnm0vGN/lNtq2L3VbrwmtxCwr5NLDBbE2VeyV56hDgE68s++Wb08qE6bE0nfQwBojUGOy7ov7KTIjZ9GNUTGM1gDhhxtRsCmUVznfuJuV2+agU3voOY5vBZvKrr+eIBsAARcXmf2H4adViw7n4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: cf3bd9cc-2b9f-45f5-6429-08d645c43196 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2018 21:50:26.9537 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3488 X-OriginatorOrg: microchip.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Adham Abozaeid From: Adham Abozaeid After removing cfg_values member, cfg_values_lock that was used to protect it can also be removed. Signed-off-by: Adham Abozaeid --- drivers/staging/wilc1000/host_interface.c | 9 --------- drivers/staging/wilc1000/host_interface.h | 2 -- 2 files changed, 11 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 8d1142776310..2bf91df1ded1 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -369,11 +369,8 @@ static void handle_cfg_param(struct work_struct *work) struct cfg_param_attr *param = &msg->body.cfg_info; int ret; struct wid wid_list[32]; - struct host_if_drv *hif_drv = vif->hif_drv; int i = 0; - mutex_lock(&hif_drv->cfg_values_lock); - if (param->flag & RETRY_SHORT) { wid_list[i].id = WID_SHORT_RETRY_LIMIT; wid_list[i].val = (s8 *)¶m->short_retry_limit; @@ -409,7 +406,6 @@ static void handle_cfg_param(struct work_struct *work) if (ret) netdev_err(vif->ndev, "Error in setting CFG params\n"); - mutex_unlock(&hif_drv->cfg_values_lock); kfree(msg); } @@ -3240,15 +3236,10 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) timer_setup(&hif_drv->connect_timer, timer_connect_cb, 0); timer_setup(&hif_drv->remain_on_ch_timer, listen_timer_cb, 0); - mutex_init(&hif_drv->cfg_values_lock); - mutex_lock(&hif_drv->cfg_values_lock); - hif_drv->hif_state = HOST_IF_IDLE; hif_drv->p2p_timeout = 0; - mutex_unlock(&hif_drv->cfg_values_lock); - wilc->clients_count++; return 0; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 1e2e50e91f76..523b46bfb488 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -293,8 +293,6 @@ struct host_if_drv { enum host_if_state hif_state; u8 assoc_bssid[ETH_ALEN]; - /*lock to protect concurrent setting of cfg params*/ - struct mutex cfg_values_lock; struct timer_list scan_timer; struct wilc_vif *scan_timer_vif;