From patchwork Mon Mar 2 16:22:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 11415831 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 DBFEA14B7 for ; Mon, 2 Mar 2020 16:23:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1C6221D56 for ; Mon, 2 Mar 2020 16:23:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="qvagVzF1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727357AbgCBQXq (ORCPT ); Mon, 2 Mar 2020 11:23:46 -0500 Received: from esa6.microchip.iphmx.com ([216.71.154.253]:46612 "EHLO esa6.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727092AbgCBQXp (ORCPT ); Mon, 2 Mar 2020 11:23:45 -0500 Received-SPF: Pass (esa6.microchip.iphmx.com: domain of Ajay.Kathat@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="Ajay.Kathat@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa6.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa6.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa6.microchip.iphmx.com; spf=Pass smtp.mailfrom=Ajay.Kathat@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: v5lr9xtu25vVRLLWg/AvLkuSS0SIpOalp4y/krk9bltdPRe5kQut2Dxbt+dRzibuwGFWgzbU5n yw2ClOSUmkaEIOXMlFMsKYXbr9foToOSJZdxWJlaHt5HIjIgYi5pbUhU73+h5NhJlCV3a5VTEz IBB+p3YRMZ9lMrlpuvWGUlYbuHK7LDEofag1mazuMR5glq0avuxU6xYooExAXPpomdBgNResyH bLRHG17e5rfSf+EREvbvD+Mbv3WXdF/YcFDtlhYAXCx3SZA76+vVcLtkCFoqaL2vAl6y5Qvsrr MNI= X-IronPort-AV: E=Sophos;i="5.70,507,1574146800"; d="scan'208";a="4185725" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Mar 2020 09:23:43 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 2 Mar 2020 09:23:37 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 2 Mar 2020 09:23:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fAaa2nxuAuBGVdp6LafEXCfrAuTCNtBbsR9wwlGJJzcT+iB5w4R/ZNd9bY2I5FVSvNZSp/2V+Iyd4PIZhd8IsNIqWO8i8PKdUdE+vVAKn+hzC635vv6aTfNqqMFC2XbKgjz9ZirYPEHF3erutwl/JgSCCEPCkTBaY7XYilwXwUGnmGB/W+vyJC9gh9dHxj81DAhVAsxL6mdavUCIVm3oayMRdq00aFrk/mNTgx+zDxq7EYPepqcEyN5vxqNTMesEWUSZhZMq+fjqthk339AbaQmqPJARk2mBaCfJfOd2t7BE7FCtjaUoinK1q8PaZpb6whbip4Cqc7a2PRMoXZP5jg== 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=qxmJSIOVMZZhvvGK8yX8a3H4S3q9aUKGumnmcy8MXbU=; b=db1msw87NV3c7wI4IQ5hdKTJ6ifsj0t2+1clmTAJMWZulAqoiW7qdgX+yo7XiU8sCvejOKtOKVYASy39wccIEKUZGfIzxKqqrItC/HTO3ZvjdAvNh4Y5ltDzOUtoKSMeLClCB/dRl2kxuA9cgAOZhu6fw4BKXHIcwt71a+qgqGUrgsAMKXS07shYYUunkB80bHQKJr0jgLkSpN8af2CFWMk1Zkmq/o6eCZJEIq0ln1EM6DwzBzYIvGFUc62HpFQR5X/oKx+U5IYLR42dD4r4qtmNW5mOlo3id6fYrXShT9/zYcWHqyZRIzVH4Ly0qmB67t9vneIUkdRUWlyz83dPaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qxmJSIOVMZZhvvGK8yX8a3H4S3q9aUKGumnmcy8MXbU=; b=qvagVzF1rNlyevkr1h+fJTenl30JaEdNUxSd7HRboySDGDWPtvLzq9RpASn0OIbgRvBgYX0npmRzSupYVRt5go66J8xVklgXvQB8WGpmy2aGrj5SFLDq3ZkxGMAf0udDC7Red1AW08nTxbjIw2HAuqmHqDpRuX4EyWSmUV3xjOA= Received: from BN6PR11MB3985.namprd11.prod.outlook.com (2603:10b6:405:7b::14) by BN6PR11MB1426.namprd11.prod.outlook.com (2603:10b6:405:b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.14; Mon, 2 Mar 2020 16:22:35 +0000 Received: from BN6PR11MB3985.namprd11.prod.outlook.com ([fe80::ec62:e7fd:f17c:dfd4]) by BN6PR11MB3985.namprd11.prod.outlook.com ([fe80::ec62:e7fd:f17c:dfd4%3]) with mapi id 15.20.2772.019; Mon, 2 Mar 2020 16:22:35 +0000 From: To: CC: , , , , Subject: [PATCH 1/3] staging: wilc1000: use correct data for memcpy in wilc_hif_pack_sta_param() Thread-Topic: [PATCH 1/3] staging: wilc1000: use correct data for memcpy in wilc_hif_pack_sta_param() Thread-Index: AQHV8K7ITTVQLLkPjkS6GqGFdSMyEQ== Date: Mon, 2 Mar 2020 16:22:35 +0000 Message-ID: <20200302162226.4196-2-ajay.kathat@microchip.com> References: <20200302162226.4196-1-ajay.kathat@microchip.com> In-Reply-To: <20200302162226.4196-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-originating-ip: [121.244.27.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f5316479-2b30-451e-a90c-08d7bec5eadb x-ms-traffictypediagnostic: BN6PR11MB1426: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2276; x-forefront-prvs: 033054F29A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(376002)(346002)(366004)(39860400002)(136003)(189003)(199004)(966005)(5660300002)(66556008)(186003)(26005)(66476007)(64756008)(66446008)(6916009)(478600001)(6486002)(6506007)(6512007)(107886003)(86362001)(66946007)(91956017)(76116006)(316002)(8936002)(71200400001)(1076003)(81166006)(81156014)(4744005)(8676002)(54906003)(2616005)(2906002)(36756003)(4326008);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1426;H:BN6PR11MB3985.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jXHBRh+XKUFu/TCJ+Qed4UG4z0/SBrCKmwkARqeId8rtaENc51JijHAiBTsx6xpKhSjwm+L5c+HHbsAqxaVWI3G78POvunh4U0gCt7nCeshdvpgTNsAQRXnOQyBbJTWnwFLYVyCoRWRR/vLxKpWxA1Gu4mN9211Y8NWEDv1A7iPfYm0ybjE3FCQPoDtZ+Hs3uv816QwsUBuRlk4iMpHD2eZuHq+ch6CjjW4ZKTaCJZkYNVA+FYBMrpcMz2TIoWXNiX9R2z1os9+n7KTcow6xYukz0esZotIxhqYSc/sGHc8O0qGnB66yAhwuuXHVpn3hlvOit1/89SduOpafR8YGY2wfBypHyaT3zgDUTpYuiO+Lca90v8D/HqfqX6SIpi9pOsXnLQUGvYJb+ZpAbHG3B7wO12B/Ud/xTuyRvoe7J+iztLCvYiEbWSP2XXKz9YJpN3XHLFBKlCqM7Jb4LLE8viyxJNF/wWAVwkxJaFFZ7x1OrPePVvGSC+SZJ0AlnRU0PO2r7C8te1PhfxlLbzQhnw== x-ms-exchange-antispam-messagedata: tE2ESaqgb+pj7D1X/wqPj7++umPtWw9farP4twoEggW7FLSF7RnZ+6nXBbO6UVp+XljBqPTlf8gF5z1RZv0CCV6s3pvMI5pvfhJykp30GvjW/b2e7GHamkZ9ArEz/QoRtGhUYow+apGgv+7q5Je+ew== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f5316479-2b30-451e-a90c-08d7bec5eadb X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Mar 2020 16:22:35.2694 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /tTTdfc+nOoR1b5qQrgD0MDepEQHd/RKRSIb8w/AxMfRyJohWYa/owyhXVQQcHWECAGWpGwpIowxZRsQRPdis88Ro5TzcMyGSId+CK4qJS0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1426 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Use correct data for memcpy in wilc_hif_pack_sta_param(). Its reported by Smatch static code analyser tool as discussed in [1]. [1]. https://lore.kernel.org/linux-wireless/20200302092346.GA24308@kadam/ Suggested-by: Dan Carpenter Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/hif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wilc1000/hif.c b/drivers/staging/wilc1000/hif.c index c8c41c2df4ec..6c7de2f8d3f2 100644 --- a/drivers/staging/wilc1000/hif.c +++ b/drivers/staging/wilc1000/hif.c @@ -801,7 +801,7 @@ static void wilc_hif_pack_sta_param(u8 *cur_byte, const u8 *mac, if (params->ht_capa) { *cur_byte++ = true; - memcpy(cur_byte, ¶ms->ht_capa, + memcpy(cur_byte, params->ht_capa, sizeof(struct ieee80211_ht_cap)); } else { *cur_byte++ = false; From patchwork Mon Mar 2 16:22:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 11415827 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 1E86014E3 for ; Mon, 2 Mar 2020 16:23:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9215222C4 for ; Mon, 2 Mar 2020 16:23:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="Pzm+uNgS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727305AbgCBQXi (ORCPT ); Mon, 2 Mar 2020 11:23:38 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:59180 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726946AbgCBQXi (ORCPT ); Mon, 2 Mar 2020 11:23:38 -0500 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Ajay.Kathat@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="Ajay.Kathat@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Ajay.Kathat@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: RuZYtSUifZ0w9rsxmR092xcv10TFTRViUj/QXkQEyd5TFhYfPbSa8SEDfVvJTcM9nsZhcHdWcN YvNFBkRGeLxUDk5DDlWhH14scN5/iEj6TbC99675gHPE3cEzQj8JO39BSQ9iiH58ReNf2LIS/H aUwbbb8XJwssWkdJa2+CVIpmmpZ70sGKB/Z+j54QwTHX5C91sjlSGZPdaWaQvKBHcTisxNqAwA kP2u/8suirz/hdVpD8JZRZ+FhWwuMCocPnK/+lfn5+4B1tohTdGzlhI9KZ0OTJOMJ8mkqVKrxR KaQ= X-IronPort-AV: E=Sophos;i="5.70,507,1574146800"; d="scan'208";a="65862660" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Mar 2020 09:23:37 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 2 Mar 2020 09:23:50 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 2 Mar 2020 09:23:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oDBGBw9dkhxrTuXS41NCLkWWNRKRrqwMfRdcpTnTNg9MDUdA3kVhbFky97uvCAWkI9Yfi6tiBbaRtqvoOkEBVRkNNl5hGbwKx2UOPBPpZc1mcJQZKXpMPHIEVRvXdjLYO67H+RWG+npWIL06Qs1v0WeWp1yxRz3EXIsQQkP8vLyqIXfob/wITovMBbI5445pvJxU/We/nQCgpmQWithUdTUmAm5j+vC8NeEwxxH3qdKs0Oo877nAoH7xhA3IcQXSXtbzoF4FW1lj4Jn6dC+0hAKOoB1L+T3xeU0xfh+TRUqBnEh4ctZ7uE2gQ2RRD1DGSX2FVPNPbJUa4rAZOVXIwA== 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=M0T4qkDjuLZw+qtc10X2x4gNCeVnU/NWefbyunAGQ5c=; b=ZbaOqFtO147738rpLDQAGdAKUPEjJAc0mB7SWK3NU8rsnCmvoo/8doRbqPbN/z7TKq2/0K/CWX1KRZk4buEex/NVTt/Z0kcVx6+xaUGYJn6VaLasu5KeEQzij3v2/nRSSYfD0G0dHM7lbQo6j9oNdIzUtp1rQTWHzcIUvE7dMatsSDqG/9v2WzYcLQ+W5IH16IpUh4LaGeO7Yi0ST+24t8z6gtK4hz3V49Vi9PgXD+NyKUw5ZbygDWkQytt+NNB6oINpeYYdpoUohmYGvsqRKHjsK2XYjxgY9E20Y2LvSRkUMioEu8JrIY9Mq1urNVWLmEt+xtj1JMOidJGrSYRqbw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M0T4qkDjuLZw+qtc10X2x4gNCeVnU/NWefbyunAGQ5c=; b=Pzm+uNgSlR6L1Ajst5lWB8oWVGDx/onTxVBTQ5yu9V8bxzy6yJeYWZkWy588f16uaL1Xnd0O8DcgkNRtba0eYEAIAA/LgUOQp7oN/t84+/TjLlymzOExd4glRgMfyHasCyZ8BaEP/7ltl1R1sHcshN54p5cP3N1rwwdjMRGGqT8= Received: from BN6PR11MB3985.namprd11.prod.outlook.com (2603:10b6:405:7b::14) by BN6PR11MB1426.namprd11.prod.outlook.com (2603:10b6:405:b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.14; Mon, 2 Mar 2020 16:22:36 +0000 Received: from BN6PR11MB3985.namprd11.prod.outlook.com ([fe80::ec62:e7fd:f17c:dfd4]) by BN6PR11MB3985.namprd11.prod.outlook.com ([fe80::ec62:e7fd:f17c:dfd4%3]) with mapi id 15.20.2772.019; Mon, 2 Mar 2020 16:22:35 +0000 From: To: CC: , , , , Subject: [PATCH 2/3] staging: wilc1000: remove unnecessary always true 'if' conditions Thread-Topic: [PATCH 2/3] staging: wilc1000: remove unnecessary always true 'if' conditions Thread-Index: AQHV8K7IwDsMZBV4z0mZivbYZpT6/A== Date: Mon, 2 Mar 2020 16:22:35 +0000 Message-ID: <20200302162226.4196-3-ajay.kathat@microchip.com> References: <20200302162226.4196-1-ajay.kathat@microchip.com> In-Reply-To: <20200302162226.4196-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-originating-ip: [121.244.27.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e91d57e3-42eb-44ce-5d97-08d7bec5eb31 x-ms-traffictypediagnostic: BN6PR11MB1426: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 033054F29A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(376002)(346002)(366004)(39860400002)(136003)(189003)(199004)(966005)(5660300002)(66556008)(186003)(26005)(66476007)(64756008)(66446008)(6916009)(478600001)(6486002)(6506007)(6512007)(107886003)(86362001)(66946007)(91956017)(76116006)(316002)(8936002)(71200400001)(1076003)(81166006)(81156014)(8676002)(54906003)(2616005)(2906002)(36756003)(4326008);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1426;H:BN6PR11MB3985.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wZN4S2/56F1ApZsMVDY1UWauf5PYLjpJWfgnbGmXvpk1nf3wYyegVQcQq4Lx9C7mD6C+fX5nlQVaUv8I3TwAbHJTLUheeoA9LYX61+P+kQZG6MnbTUiukTBQEpWfIm3xFfDALWxB/UfFUPWav4dJ+tuiJVtFj9wjroG5cxiDVt9r7skAO6uUob1Io9NW3UnsNq1PEE6xj2DpeoMnnSkOjz3SBPaF8/GEzcgkyOBnxUK8MMt1TRiE4ZDimyeIiGlfs9vlLUky3r3FY/YI9nx/TGyci9x+F1DwlWWoauDQbCCJbV6UEtLZUmaZUyUJIo1Yc9UACn9ABBxthwkcLQnr1lwuB7vTkdrWwxNxvw7xcMV14rIggqWJUYJsL8ANCkF6QyVPM7ITd5lIIDoO7nI0Xb+GbXwKtKQmjQbLdZWkK3MgNvozpFugL5hfIPb8Hj/NwpdyhOKGecqJ+naX/f0x7sK7Z/1i7mlxuzG7Jf6NY0F9wjbIz2q5/sBd8xE4aW9XFx5R1ntV0ePEv/GoPgw8ig== x-ms-exchange-antispam-messagedata: sPtzICTNsXVPMRNmsmFh0EpmV7JRLSQAo18pTZqsBgfB66TNZs2rcE9pVFRf+CxjCLe5b/nm38TA+KFUn+Xms1ss3irEAKtODBz7FWfyMBMgq8jQ6O3ZtaQuPg/+K3JbMPR62UEFXNV8hNby1V5i1A== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e91d57e3-42eb-44ce-5d97-08d7bec5eb31 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Mar 2020 16:22:35.8371 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Iji25J9bAAEUtPTxbIJeXM4TzWR3CUzNOwZdhvxMqSWWi6ZGVguFaLcuIMUmMur5tOXAGJuyvvs9oo/YCUgphI9QAzE03jLzIPHmscp9+rQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1426 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Remove the unnecessary always true 'if' conditions and simiplifed the logic as suggested in [1]. [1]. https://lore.kernel.org/linux-wireless/20200302092346.GA24308@kadam/ Suggested-by: Dan Carpenter Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/cfg80211.c | 26 ++++++++++++-------------- drivers/staging/wilc1000/wlan.c | 6 ++---- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wilc1000/cfg80211.c b/drivers/staging/wilc1000/cfg80211.c index 5d8faa01337d..54e02807cebf 100644 --- a/drivers/staging/wilc1000/cfg80211.c +++ b/drivers/staging/wilc1000/cfg80211.c @@ -888,7 +888,6 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev, struct cfg80211_pmksa *pmksa) { u32 i; - int ret = 0; struct wilc_vif *vif = netdev_priv(netdev); struct wilc_priv *priv = &vif->priv; @@ -901,21 +900,20 @@ static int del_pmksa(struct wiphy *wiphy, struct net_device *netdev, } } - if (i < priv->pmkid_list.numpmkid && priv->pmkid_list.numpmkid > 0) { - for (; i < (priv->pmkid_list.numpmkid - 1); i++) { - memcpy(priv->pmkid_list.pmkidlist[i].bssid, - priv->pmkid_list.pmkidlist[i + 1].bssid, - ETH_ALEN); - memcpy(priv->pmkid_list.pmkidlist[i].pmkid, - priv->pmkid_list.pmkidlist[i + 1].pmkid, - WLAN_PMKID_LEN); - } - priv->pmkid_list.numpmkid--; - } else { - ret = -EINVAL; + if (i == priv->pmkid_list.numpmkid) + return -EINVAL; + + for (; i < (priv->pmkid_list.numpmkid - 1); i++) { + memcpy(priv->pmkid_list.pmkidlist[i].bssid, + priv->pmkid_list.pmkidlist[i + 1].bssid, + ETH_ALEN); + memcpy(priv->pmkid_list.pmkidlist[i].pmkid, + priv->pmkid_list.pmkidlist[i + 1].pmkid, + WLAN_PMKID_LEN); } + priv->pmkid_list.numpmkid--; - return ret; + return 0; } static int flush_pmksa(struct wiphy *wiphy, struct net_device *netdev) diff --git a/drivers/staging/wilc1000/wlan.c b/drivers/staging/wilc1000/wlan.c index 3aeca882f431..6a82fb2f283e 100644 --- a/drivers/staging/wilc1000/wlan.c +++ b/drivers/staging/wilc1000/wlan.c @@ -703,10 +703,8 @@ static void wilc_wlan_handle_rx_buff(struct wilc *wilc, u8 *buffer, int size) wilc_wfi_mgmt_rx(wilc, buff_ptr, pkt_len); } else { if (!is_cfg_packet) { - if (pkt_len > 0) { - wilc_frmw_to_host(wilc, buff_ptr, - pkt_len, pkt_offset); - } + wilc_frmw_to_host(wilc, buff_ptr, pkt_len, + pkt_offset); } else { struct wilc_cfg_rsp rsp; From patchwork Mon Mar 2 16:22:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Singh X-Patchwork-Id: 11415825 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 B16C814B7 for ; Mon, 2 Mar 2020 16:23:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 78CA8222C4 for ; Mon, 2 Mar 2020 16:23:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="HUySdHC6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727309AbgCBQXj (ORCPT ); Mon, 2 Mar 2020 11:23:39 -0500 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:59180 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727092AbgCBQXi (ORCPT ); Mon, 2 Mar 2020 11:23:38 -0500 Received-SPF: Pass (esa4.microchip.iphmx.com: domain of Ajay.Kathat@microchip.com designates 198.175.253.82 as permitted sender) identity=mailfrom; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="Ajay.Kathat@microchip.com"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 mx a:ushub1.microchip.com a:smtpout.microchip.com -exists:%{i}.spf.microchip.iphmx.com include:servers.mcsv.net include:mktomail.com include:spf.protection.outlook.com ~all" Received-SPF: None (esa4.microchip.iphmx.com: no sender authenticity information available from domain of postmaster@email.microchip.com) identity=helo; client-ip=198.175.253.82; receiver=esa4.microchip.iphmx.com; envelope-from="Ajay.Kathat@microchip.com"; x-sender="postmaster@email.microchip.com"; x-conformance=spf_only Authentication-Results: esa4.microchip.iphmx.com; spf=Pass smtp.mailfrom=Ajay.Kathat@microchip.com; spf=None smtp.helo=postmaster@email.microchip.com; dmarc=pass (p=none dis=none) d=microchip.com IronPort-SDR: kagiaPlFkpoYGoLXISb8GDJrO6govNm0wsf5tbpGBnw/PLYDFiL3NFb+4L/Y96RGHjx8RG5DE0 ntm6XsmHz0TdUAfAXD9mhh4alLkiUCcqb1wsEZ3aRRokQ5MLFGLTx8FtCV+3IhyN9hbIEisesc SuaBdlZX0Yx5fgHdo+2Bi09B9ib7TWt/UMMt37XuLn9CK5KAUvngRPmYuhCCcWfVQKW0etFrrW oKWFV6xl4rl1s/8o8BqHTUQfvZgVruPF7X8ttrwv3ws19gIcYny6tpuZMYHa9HOFoC77MnGGgs YfQ= X-IronPort-AV: E=Sophos;i="5.70,507,1574146800"; d="scan'208";a="65862665" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Mar 2020 09:23:37 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 2 Mar 2020 09:23:50 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 2 Mar 2020 09:23:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZK16NNkIijz0T4cMm7sJGhdr1MPA5xVz+i5Ms0NdsaDWzSU4wciCrr72Go2L0qgCQ5q50x1eSZ/ok+4mvUoFHoej2a3IX5+c7vYCP6pFOyozUsBNCAfyB04uKZYlzVyUxEJWa7pYbXL1NVeorI3JVmNKhDYhp962ZTNn8qn4VxGLQwD3THS8NwK8/foRFGljQiJpfL2OcO+bWkmISYEe6bLedWnyZMzsNBX9R2L4bbVXF3wn7w2g57vh8Le/JO/T8HSNErqs6IuuhDZj65QZO/La10dh145Kd4xhdy2H7geB9pm5vZV1Bzd9r2C+ma0k+ySaCLCkKOD9DGK5LJ9znQ== 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=KX+s6FJZuYWu1AlpwG6z1zfLYBTWzDWcBmcSyXLx4WY=; b=E3t+Adko0aC7mvdLqXy4dRNDR90SgVwlkuzFqE7nT3RcFsGB8v98wL7DkGC/aaZBSgx6UHhA/o3JYIEyVGqcHc+I7IT8Kw8Dq4bUs5cJTa2S7Qb6Cymqkxwq1Ah3PY4ZFXYcyFQ0FS4PjvK3sEwjMvJR8zgSJ7Q2nw92A7Cl9JKOJRWwmXmtKDzInA5sp3Vls52u5r2mLHXVP0KDcdXzylYnUHlyzVV7MJrmv9sy/HjK93na0KegZMhLhI0fXHPhqUTwqOkpRIbQsaoc2TWtI86I993LxG2PDV6zNTuuBqX7l8HIHf9iDllLjK/T+5ogS1gSWTaPjAgPN3rTreTv3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KX+s6FJZuYWu1AlpwG6z1zfLYBTWzDWcBmcSyXLx4WY=; b=HUySdHC6HO7DNJIq+yV6Dz7jffQJMNvL0bwN59g186udoCod/HtXmEOJLCpB/HdqiY8og9gAM5wY+U+3ujTjDDOodltb2RJmx5Ms3gRZZWH2LYYHgjlOlpkRSqc8H2ipepmRoTucgFFrU+HCL2Yb0k0YfbbIFVoHROqHWiTcfUY= Received: from BN6PR11MB3985.namprd11.prod.outlook.com (2603:10b6:405:7b::14) by BN6PR11MB1426.namprd11.prod.outlook.com (2603:10b6:405:b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.14; Mon, 2 Mar 2020 16:22:36 +0000 Received: from BN6PR11MB3985.namprd11.prod.outlook.com ([fe80::ec62:e7fd:f17c:dfd4]) by BN6PR11MB3985.namprd11.prod.outlook.com ([fe80::ec62:e7fd:f17c:dfd4%3]) with mapi id 15.20.2772.019; Mon, 2 Mar 2020 16:22:36 +0000 From: To: CC: , , , , Subject: [PATCH 3/3] staging: wilc1000: use flexible-array member instead of zero-length array Thread-Topic: [PATCH 3/3] staging: wilc1000: use flexible-array member instead of zero-length array Thread-Index: AQHV8K7IU+7nSOdvhEKdBtpqQZdAGg== Date: Mon, 2 Mar 2020 16:22:36 +0000 Message-ID: <20200302162226.4196-4-ajay.kathat@microchip.com> References: <20200302162226.4196-1-ajay.kathat@microchip.com> In-Reply-To: <20200302162226.4196-1-ajay.kathat@microchip.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-originating-ip: [121.244.27.38] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f62bf998-28b6-4d79-6037-08d7bec5eb87 x-ms-traffictypediagnostic: BN6PR11MB1426: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:499; x-forefront-prvs: 033054F29A x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(376002)(346002)(366004)(39860400002)(136003)(189003)(199004)(966005)(5660300002)(66556008)(186003)(26005)(66476007)(64756008)(66446008)(6916009)(478600001)(6486002)(6506007)(6512007)(107886003)(86362001)(66946007)(91956017)(76116006)(316002)(8936002)(71200400001)(1076003)(81166006)(81156014)(8676002)(54906003)(2616005)(2906002)(36756003)(4326008);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR11MB1426;H:BN6PR11MB3985.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wKxnekkO+ZmBlofgg7iAEcgGgKOewewNdSUjujcIjxdbzBpSU2Hyr9sli5KrDD09Tnbif4+MCxFci4xfbMZfhCL1TV1v6y6WiVwMsb0goI1F8S80XahrWWqYzz5Rn2yDr0LNshg0639vVrgpMuPav85jR7J6qZLJZbTNI4ZPwSyHT4gvBZA8QGO0zATT8/Glt2JP/bkWngfRavtrZ9PL4SQt+0ttr/t/oGy2UeX12Ptsp+pz1OuHODpRjheTYgN3ysmoLAmCl1OUQzVUeIRNIVtCjT1v8Sdu/EtOoOTbidonDFluWmJ+aDdLf3ZPg3eFxIGTqvYh+jwykxaxCw0+d4Nqa5SJSWC26M6mNgFcAtRYJacuMzfCz4HimBpxGV4AsuT1Cu2D4YDUmcYkzZIy4V429e9B5aZW1RcrXi+S1W+NM3m4ADAc8djJC7Qf6witWBM468rMMuMqumS7QrFZP36WO72qHQPrcNRPGMSy/pGcAS0ah7Cvr2KrWQtuZTi+aPzigZn3cSC+IQ8eaCCutA== x-ms-exchange-antispam-messagedata: E7jsAF+oZ4Ha0r9Njx7b87h31WW0XZvU5dlpH1xxxQaEEOZzgohkC0yD55l7jy6gPKHBuVA2GbUPioPIHRyWDAeduaU1uIN+cks3BY4LWim/Btiq7RCgsZX1hseIKM8XwX0Cx9iZoRC4/YTdtw89EQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f62bf998-28b6-4d79-6037-08d7bec5eb87 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Mar 2020 16:22:36.3688 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: O7Q2k+eKj5EX5oxiS18TT3LmTFG/k9rXhmuK3X7NNDd4k3IppIXU6PPRwtq66uD9ZLcHdvvMRpHnP+Mnw2u8n0Lt3Zjxj9QKTHk9WnzeJQ8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1426 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ajay Singh Use flexible-array member introduced in C99 instead of zero-length array. Most of zero-length array was already taken care in previous patch [1]. Now modified few more cases which were not handled earlier. [1]. https://patchwork.kernel.org/patch/11394197/ Signed-off-by: Ajay Singh --- drivers/staging/wilc1000/spi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/spi.c b/drivers/staging/wilc1000/spi.c index 11653ac118cd..dfd25df75780 100644 --- a/drivers/staging/wilc1000/spi.c +++ b/drivers/staging/wilc1000/spi.c @@ -109,27 +109,27 @@ struct wilc_spi_cmd { union { struct { u8 addr[3]; - u8 crc[0]; + u8 crc[]; } __packed simple_cmd; struct { u8 addr[3]; u8 size[2]; - u8 crc[0]; + u8 crc[]; } __packed dma_cmd; struct { u8 addr[3]; u8 size[3]; - u8 crc[0]; + u8 crc[]; } __packed dma_cmd_ext; struct { u8 addr[2]; __be32 data; - u8 crc[0]; + u8 crc[]; } __packed internal_w_cmd; struct { u8 addr[3]; __be32 data; - u8 crc[0]; + u8 crc[]; } __packed w_cmd; } u; } __packed;