From patchwork Wed Jan 15 12:13:34 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: 11333931 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 AA799138D for ; Wed, 15 Jan 2020 12:14:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7F45F2467E for ; Wed, 15 Jan 2020 12:14:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ekIaZ0jn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732483AbgAOMOi (ORCPT ); Wed, 15 Jan 2020 07:14:38 -0500 Received: from mail-co1nam11on2064.outbound.protection.outlook.com ([40.107.220.64]:28929 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730768AbgAOMOe (ORCPT ); Wed, 15 Jan 2020 07:14:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W8kqNxPIcq8FIgQMhXfRZTbmbl+b57UYRLkQ3nhHNr5jP19eekiuogZt1EoEMFwxvvc3G6oI8dk2LVEkWgv9YZJ8KCR9M/2SPoEei6k06SCvvbonxSIyXEHWJTUosfV0dhqXb/oVCIzaTtacjzr36pslZIFR5q4HJ88g+SvsTb2BTg1at6FAfaDU1rmZ0ldgdLusuUYyzJA/nvt02riplEGL0iRv1Y79xQqxhb4I71ltGOY/iVm3rv1+mGiyKyoUfKngWjdJx0a/TZruXv5JBOrDZQYPVcyFk5SIMLGjJkxAGMKssDNXzgDAtLbqRLv8rhpiYtQFlYBPXaMhrD+QwQ== 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=p3u2E2RuWsPeDBspbS1BYQcNKcjt+UuC5v4vUdV+0qA=; b=R5xWqPPiiuq5J4xSRQqyg1281YzaewpXdOlimKhZVD8zXwuZ7bNOj3x5r2RWnWS/s8WC2vGoZtymnhi/KXNZUzxuY7bmvHCuG25AXwP0O7yrWS796gxfVlO+hvt8DhmXOojhyoEl1Z7JYo+A+1kfZEXY3N6MgRy3AGXasAfLG6SeYwMfHCCpe33stCarA9ICW73j6A4g/IzETM4cdXkUY11LSwC0A0WQyzaLclhXZUyRvmkW5/vZpVNSYAXvGV8kJ8VRWad3GU5bY75WFDbVPRRJdbMU4vQMFb1HEMjR8vYit/SeIDfHfYwbflXZ62771JXJ9vpqgwPEi3UIrDXzWg== 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=p3u2E2RuWsPeDBspbS1BYQcNKcjt+UuC5v4vUdV+0qA=; b=ekIaZ0jn/Wx920JY77/vQ24RBFqswYeoQGs5xPVMf6mxuQjpZKFakV7QNKzfHN4wc219qyW4ei8ctoisAaYM1TMd+ezbfMj1bNPzEdE07qj0ofF0YhTfcOihMwGUrKP8OKoUX04GOVRBEmqsaw8xD9o8GjY7yMYRR+iRijQIhNM= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:14:11 +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 12:14:11 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) 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 12:13:33 +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 64/65] staging: wfx: simplify hif_multi_tx_confirm() Thread-Topic: [PATCH 64/65] staging: wfx: simplify hif_multi_tx_confirm() Thread-Index: AQHVy501HoKuGDgN9ECTgXQynTSwOA== Date: Wed, 15 Jan 2020 12:13:34 +0000 Message-ID: <20200115121041.10863-65-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) 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: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ea5a3e45-74cf-46cb-9f22-08d799b45817 x-ms-traffictypediagnostic: MN2PR11MB3934: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39850400004)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(85182001)(66476007)(85202003);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB3934;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: K0W22SMnn9wpOAfLMOBkFjS/42B6Yao1R3MDOzqbU9dOrgMKAkJR3JxPbarY7HBviKj53qhTWIGXnQQaF99xBUD676O48eD69YMy36cl2pEOqD9dURab4SuHX84e2vzLFi/h4jMt8rZKlzTY/HYdUxkqoT7LZJcicz5VhWNdIbQbHu/zHihrnV30Y2I47IosZ9Hd3pOa+nrv9Wi02X5FZBAJOwg95wpBxRwMd2jSobaJa1vc9Mrs8bpnRd/so+4d4k43Fk4OzBw9BepviYOeoCU5Bd0O6VwR21BrYnrPjmH7MoQdF7zxzuJx/va7+5ojhvoySy0JhSLg/APIQgwZvcj9v8cbHu21AYSELOAqTtkGuRRVoLAjCc8CM4E5EAghpvLMDCSbqS5A7WGJ1WLgICMj/bZkKfmwTTjNNW0ZsgqqJBbvyHfXfysu3WN0G0WI Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea5a3e45-74cf-46cb-9f22-08d799b45817 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:34.9299 (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: ePdqJJWqWZL1kW1cz+v/TH+xYMPJmmBBTTVpm7X66kSDmaSaWpXn2CgmUX4lTV4F0dliNnFo1XRF3hVKWQJ35w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Usage of the "buf_loc" variable does not simplify the function. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index f798cd6973b6..33c22c5d629d 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -77,21 +77,16 @@ static int hif_multi_tx_confirm(struct wfx_dev *wdev, const struct hif_msg *hif, const void *buf) { const struct hif_cnf_multi_transmit *body = buf; - const struct hif_cnf_tx *buf_loc = - (const struct hif_cnf_tx *)&body->tx_conf_payload; struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); - int count = body->num_tx_confs; int i; - WARN(count <= 0, "corrupted message"); + WARN(body->num_tx_confs <= 0, "corrupted message"); WARN_ON(!wvif); if (!wvif) return -EFAULT; - for (i = 0; i < count; ++i) { - wfx_tx_confirm_cb(wvif, buf_loc); - buf_loc++; - } + for (i = 0; i < body->num_tx_confs; i++) + wfx_tx_confirm_cb(wvif, &body->tx_conf_payload[i]); return 0; }