From patchwork Mon May 11 15:49:16 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: 215650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B099C54E90 for ; Mon, 11 May 2020 15:51:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5238020722 for ; Mon, 11 May 2020 15:51:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="RSge3H3L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730541AbgEKPuC (ORCPT ); Mon, 11 May 2020 11:50:02 -0400 Received: from mail-mw2nam12on2062.outbound.protection.outlook.com ([40.107.244.62]:10442 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730453AbgEKPtx (ORCPT ); Mon, 11 May 2020 11:49:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FjGDyIlt5PZogRTy1g9Tt0HgUcLORMv4zmHHbTrx4LpKVEXx3CUxWThJxXxtENSn1908kLPPtkMa7wUgvqfMHu8G7QJzXo8rdcBOZlODSOCFpU5mQX9l4BJrZ8hMWinoIBRd1RZuGEap5O47S5SB7JBVekvyrfgPBhdiCBYNil1JUoMmtRAHn6m2qZOlH1Y6VQHkOhXYy23l0KYBjxTjQtjx1O/T1cZsKTYLpies2z3hyvfvlw0Cqjt/MWAL9YF7izL8OxNkpL1czYTJsxqyIBp8fe9b/6D/4NzwCUTZtX4txTeUQHpX2AagVlwLYyqj3/9EwxgwAZm7bX0Jhi9q2A== 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=+EkGpEd85h4vR2Ni4US7JJOSHnUAz2lbZZenwSq/nkY=; b=WL0k6bxk71f0gMlbR2FKIfgb/MUypEJSPPrpUVjmLuYEFq7X6+NhzNh+W5YhimCSHYKYA1KHKMj1AIqFywg60WPKrjkKFSbe9yHf3Nfi4GjG8ym8D3rO4PfVy7kNmdi3P38i5qsFIxlmgaAgTPqVF9GGAvOdgQ/NDCpvvpedFq8MaViXtC8mlGwsZljs6kkbK0bM5ZLeSYl9tCHcFsneyTNP6qnJ5G1S58oliXvGg6PeegxjvP14j2AguO4AVWZs3ijZr0GirJS/HD7GP5ifg+wiUdrKMteFK7peSK95gmiAI4FR8usH56BFaalCeQ0Aw6dbExrRr7PdClLTHFcF7Q== 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=+EkGpEd85h4vR2Ni4US7JJOSHnUAz2lbZZenwSq/nkY=; b=RSge3H3LRJTu7rUt1lpIp4H47TnVInx6IQgz9YlUFbZql1obLV9jdgucDn0UEQSBa4eo49QDUsnrhH8RfnXSTKzJytkPQbYfQnpsdZQDMLFEYRYJ7clYEMCaTBIbO5thJxIQV0SK0nvqJmHk0fOd0GAz/ijceV+0yhkydM2jQw0= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Mon, 11 May 2020 15:49:51 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.2979.033; Mon, 11 May 2020 15:49:51 +0000 From: Jerome Pouiller 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 03/17] staging: wfx: fix cast operator Date: Mon, 11 May 2020 17:49:16 +0200 Message-Id: <20200511154930.190212-4-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> References: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (82.67.86.106) by SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Mon, 11 May 2020 15:49:49 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52b0ec6e-52c6-4e84-8f82-08d7f5c2f0ab X-MS-TrafficTypeDiagnostic: MWHPR11MB1968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-Forefront-PRVS: 04004D94E2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cw9TZMIPlvqeGwfUIr6hCqqwqJNWgqtm2Gi/7YX8HRKdUmuDgMoYrCp6stS0lVM9f8nXWi5ONGywS3nZT7P92ZUqKhLLGdOBMNER/glt0yWlV6iPwxPUNn4X1tZ5DdrSVfQ1XNVmbzNUZSl+fhfTo1AY2Cpal19hbQNiQ9Hlh/tR0XZ2TWx+nEqQXe6CztFnPC+7LeoG7lno5XaoWwo1usiYIk83SmIbAhLxMaXS665nQIpB6AvYxEFG3hPp3MpnQ3Au3HM0sfyQNNiJzEIQCtI4kJ1/63AgS0+JZuyV6GLyQoLXjLDbl9mgP0m3HxU/okr4sgzlJboCjJm7+2D3DvGdsfUWgBFThODzAydqgzfYXXEKeydFwdNGhVHKHUBYtMnFpIYp8qceBfVyRwBrrbkdAh+ALYyqSlkdR8d7D1rmSBRj7lTE0tZydqoi+qzeZYZ80/gi1IEzS9aeeqsVMAdRkdFLFEq4fwkVnslVzUQL9AXcYISizEXwgctouAUylCBbmYi/NlcnbtwWXdZbYw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39850400004)(346002)(136003)(396003)(376002)(366004)(33430700001)(186003)(52116002)(86362001)(316002)(5660300002)(7696005)(6486002)(33440700001)(478600001)(54906003)(6666004)(4326008)(107886003)(36756003)(16526019)(26005)(8936002)(956004)(2616005)(8676002)(1076003)(66476007)(66946007)(66556008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: DI0Ykxo9OXBVfoOImVa2kwPKXcKf5+rSUrrU9o2LdMdalcBZekv/DVimhhqm4ineRc0jbbI0tkq7PcegDzpRDta5CvLOLBivviIzUhnuoOs969x52VW6Dj6zL0q7hhaWNwDzpLv7+RmKFbxCpAtar28d36Fitq9d7GojTkHe20AhVXQwzhpNV7seHYhzvClf4usq0bZpUKCRhdugj9aerzjFLImCJRaJcep3vYaYbnXbNmU/mT5e2jJhAosXl6oFQIyOf+mquHNMOwZ8BbfmYN6RNN3bld2aJtKGmGEUq0SzM2Ppf/WnzOBsYJMbjHAXquKfWeKxMdZnGWUmd1RcTjHQ5f3e8Sr75x4Rj92UtWqjAnhlwev3DhwU0Q2Hb7PFJzA6oHj/lafW5uvY4yunWhS9O1tYXyuCgbCqTAcTcvYreFKvUplD6P0njt9Scat7kzKxBsgj/UjWsM7tWUigjNhkmKAF3uyQeJU0/DIS8NM= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52b0ec6e-52c6-4e84-8f82-08d7f5c2f0ab X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2020 15:49:50.9279 (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: 9sCLXY6M3wolpKTPTXEA/UbyB0ceDTzBRDMQ8pyBbi832RnCQKiGSiKeNmkQF6pzQgRgScvJSlYrxhPx7GcQfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1968 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Sparse detects that le16_to_cpup() expects a __le16 * as argument. Change the cast operator to be compliant with sparse. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 2 +- drivers/staging/wfx/traces.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index 2572fbcf1a33..55724e4295c4 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -70,7 +70,7 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) if (wfx_data_read(wdev, skb->data, alloc_len)) goto err; - piggyback = le16_to_cpup((u16 *)(skb->data + alloc_len - 2)); + piggyback = le16_to_cpup((__le16 *)(skb->data + alloc_len - 2)); _trace_piggyback(piggyback, false); hif = (struct hif_msg *)skb->data; diff --git a/drivers/staging/wfx/traces.h b/drivers/staging/wfx/traces.h index bb9f7e9e7d21..c78c46b1c990 100644 --- a/drivers/staging/wfx/traces.h +++ b/drivers/staging/wfx/traces.h @@ -184,7 +184,7 @@ DECLARE_EVENT_CLASS(hif_data, if (!is_recv && (__entry->msg_id == HIF_REQ_ID_READ_MIB || __entry->msg_id == HIF_REQ_ID_WRITE_MIB)) { - __entry->mib = le16_to_cpup((u16 *) hif->body); + __entry->mib = le16_to_cpup((__le16 *)hif->body); header_len = 4; } else { __entry->mib = -1; From patchwork Mon May 11 15:49:18 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: 215649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94D8BC47255 for ; Mon, 11 May 2020 15:51:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6FAD6206DB for ; Mon, 11 May 2020 15:51:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="XbKHY8+J" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730795AbgEKPvh (ORCPT ); Mon, 11 May 2020 11:51:37 -0400 Received: from mail-mw2nam12on2062.outbound.protection.outlook.com ([40.107.244.62]:10442 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726687AbgEKPuB (ORCPT ); Mon, 11 May 2020 11:50:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fpmAOMO7aTGca2MXgrBjUHg7x/ffmIDGbGPB++NEuqu3jNxOlVK5sbzOYkI5Ev0n9P92Zz6uMzLHnyMSsCriFTDQbx8fUS41GTyfcqx8GUXOIqan+8ORupQsaQpdtf5OKUuXHkDRyNOfwyI1AXlWZ98zE3849ZXtNin5pLqVgIwQddQg8uYA/WWF+NzqHyheWtXxpDNQDHfH7PFhUcatPB3JV4w+ECz4HExLLwS4jPwLOkBRTT9Zj+piO0vzHkw4u9pU0cp0tQfeOKRbpW5ftVKwp94nwxYK1wV+lt0IG4lYHoCTSkbgbez83DF1tIK5JQjRuk2Mk2gRmz00eEeJfg== 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=Q94uY3wIDAIJbStr9gu9gHlUoS5rWPgP9Bsj/iZkXP4=; b=epBE1kciHwXmym6xGqAbE5i2fdsuqZXm9PItDfpAM4BLXF1OWbL7Tmc3i63XlF6cY/wtN5AgTiLuV2M8y7KDedklbd6Dqp4MgarRU4P6u7w/E/0fMr8wLQFG4BYB2HmTEAUPcWQ2YTtjsRoe/ALO6HeciHj8N0l+WvStYyixtc5No9i5nySjXrM1rFoq8WQnhOM/kTk4j0TgerFeUN5dYoWnWJj7l/NeOEfauSwOkrpFUtwXvoqUY0lzg4apgDpU2ppbtc4UXdDBPpsqWyh6AjKENbqvT1pI39qWnHZCCkRV3RqfDbmjZYDUcWVB4jwKFvhy494aMIxH4BAPJtztyA== 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=Q94uY3wIDAIJbStr9gu9gHlUoS5rWPgP9Bsj/iZkXP4=; b=XbKHY8+JaIv3QCUpsbwo7Z/CVXk5UPSyYKIh/jQkmqL9wwc01rhLZEe5honf1A/KERizKuM2BClA//YBQZ6I8XpKNbbWhWVKks9Ty4PaaajbXnc7RYo8xKW6q6DUPH1QuNKwV8ArCvLZG5Xtpi5CiPFn7IFA/W7cOax/VbaAWa8= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Mon, 11 May 2020 15:49:55 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.2979.033; Mon, 11 May 2020 15:49:55 +0000 From: Jerome Pouiller 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 05/17] staging: wfx: fix output of rx_stats on big endian hosts Date: Mon, 11 May 2020 17:49:18 +0200 Message-Id: <20200511154930.190212-6-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> References: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (82.67.86.106) by SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Mon, 11 May 2020 15:49:53 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19d212c8-81cf-4553-db22-08d7f5c2f332 X-MS-TrafficTypeDiagnostic: MWHPR11MB1968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:339; X-Forefront-PRVS: 04004D94E2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5a3JDhFbB53BHdIi+W/XdJbJ77PWNSBqf3jN9r6lHWd26gLd8maZf5F9HjP/yI3+eiAVIXjxmVAxvtEnGvHaAJC7aDdpITwS+kyh14pgDylhxdKZv84nYqGC6hgJAP+EnnHvVcyAVQvTVP649+Z34h2hxY5Wnk9IeLdHM6kyTz9VujFhzHVoGdffY7hAgCTYqNhpM/mb6zkjVG4Z00eU9XGxh2dEu3aVUdOyR6ZnDyxghVlUtp9fMTmFRrxzcXf2+FmgUrhh6UC2KZH5hsRNtRZ5+DKNTuKNL3913n1rJzI444DVPxAoATYvlfaR+ee0j/4IigZaNrPfHllSpDZ7AHZrawnOTqJOAW9OT0HbbWaf0LIcfM3pRRaoGkfm4uXAeiAwXx0xzm+8BXPShcsbIgARkD5/pNoGHNfkoZmbRbt4PiP9cmQnxpi2fpDJYf3zpVaQpy9J/fd6fBWDGJKCiK4o746JoCdyow1aO8kxNPzQPYJFwSgva23+DlJvJXE6f43YFpdDwVBubaskRJ8oVQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39850400004)(346002)(136003)(396003)(376002)(366004)(33430700001)(186003)(52116002)(86362001)(316002)(5660300002)(7696005)(6486002)(33440700001)(478600001)(54906003)(6666004)(4326008)(107886003)(66574014)(36756003)(16526019)(26005)(8936002)(956004)(2616005)(8676002)(1076003)(66476007)(66946007)(66556008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: pAcGrC/zLoRa7wiJ4cPea55oy1sa2w94inHy5LmamKfwO42J5bhQXysjkf6LmK0lZrke3OACrAw0q+HvNPbGpBgrIjGUmnubPJRLpduQ+hqITSeDLjHVavOKGvsKHde69BKzM/Fr7dYxuV/GtLkEAJJ77XmJ0vnHSBTVE7cQ6uqlakiOnYsrjnvDciZLK8a6kye5bPj+SOyr4m27whOQ0XKzYx2SMf22M1fGst9iNepCpSIjjM16pR/29QCUzF0TIE392Yoy5ONQcBwifFVX+E6TneIXEcFvUjM39A8Ut6V3vsC9IlmAYx/GkNnFqC0daO58SbfWmDZNPIbgdxuPzctc2TpzC+HSHxljteKAqnnDqkIES1iHynvUuSzEqFdZ5WMEdXWmhkqVFBnUdWqVrQ8CGBV/P4ltDAT0GHDGrrnm5ZrKfDyRJyvXkExVQi37rFiStzNyweHfNgs0kSKdvVLI8293fUpHhlMZX4Zmr6M= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19d212c8-81cf-4553-db22-08d7f5c2f332 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2020 15:49:55.1740 (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: XqSy2d1Fa8hekHvoJsrV3wwQL51xm4ZZlJdvNTBJK/46sbxGeLwA7IzMf0BZ6K7FXyZvqZ8yYw2Km7wZFcU2EA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1968 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The struct hif_rx_stats contains only little endian values. Thus, it is necessary to fix byte ordering before to use them. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c index 2fae6c913b01..846a0b29f8c9 100644 --- a/drivers/staging/wfx/debug.c +++ b/drivers/staging/wfx/debug.c @@ -155,7 +155,7 @@ static int wfx_rx_stats_show(struct seq_file *seq, void *v) mutex_lock(&wdev->rx_stats_lock); seq_printf(seq, "Timestamp: %dus\n", st->date); seq_printf(seq, "Low power clock: frequency %uHz, external %s\n", - st->pwr_clk_freq, + le32_to_cpu(st->pwr_clk_freq), st->is_ext_pwr_clk ? "yes" : "no"); seq_printf(seq, "Num. of frames: %d, PER (x10e4): %d, Throughput: %dKbps/s\n", @@ -165,9 +165,12 @@ static int wfx_rx_stats_show(struct seq_file *seq, void *v) for (i = 0; i < ARRAY_SIZE(channel_names); i++) { if (channel_names[i]) seq_printf(seq, "%5s %8d %8d %8d %8d %8d\n", - channel_names[i], st->nb_rx_by_rate[i], - st->per[i], st->rssi[i] / 100, - st->snr[i] / 100, st->cfo[i]); + channel_names[i], + le32_to_cpu(st->nb_rx_by_rate[i]), + le16_to_cpu(st->per[i]), + (s16)le16_to_cpu(st->rssi[i]) / 100, + (s16)le16_to_cpu(st->snr[i]) / 100, + (s16)le16_to_cpu(st->cfo[i])); } mutex_unlock(&wdev->rx_stats_lock); From patchwork Mon May 11 15:49:20 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: 215651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6186BC54E8D for ; Mon, 11 May 2020 15:51:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3BFAF206DB for ; Mon, 11 May 2020 15:51:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="gdufEXDG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730582AbgEKPuG (ORCPT ); Mon, 11 May 2020 11:50:06 -0400 Received: from mail-mw2nam12on2062.outbound.protection.outlook.com ([40.107.244.62]:10442 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730563AbgEKPuF (ORCPT ); Mon, 11 May 2020 11:50:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lFJh27cAKHZHiuwywCap2fJw7IwwNo1Y1Dsix5bPh+cs+b3w6EPlINUBcraRqv9KoEvIditJ7i/5fVGnJII5VZwrD/fjIfRWpvIp+rN6qQFqE46r6bja9iJEiFeFNm0yi064dqqUjtGviZRG8c/9m6aOEy7+2vfUmLCDqJELEmGCLNngXHnstt7oZC51HZNC3tJUiw3B7Xc8WLMyk2uBnYAWCG7p8pp/gP7cdETle2eMBR2/f8dNkHbb0WPeqdPaadiwJP8FD2gorNH2SwnvkaPTOUeuLpjYQ7md5Tnbn/ybKbiAorT9Sr/5MkNHDMaSG427WvWG/AxOy5UDFEQwQw== 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=C5n0cjqebCL4J+gINvDozGWmeH0y5pJkM7iroi6BcrY=; b=CDKttffmkY7chrbSBq3DltTExCo/R/yA8qRkUqL6cwiqzHztxLn5oUAu5JmV4AJnrA4XcINB4L0LplPSeAWJOAN8YE7Zj3hxYfF2X6zP5JK1UYNpdmzj1E1f2KRyyZGEu96FAt74h+qhIbZmHediHjVrVdRfUUvP9CspDLMFdzGE2zrpdI9Sl0rpDrhLKD6uXqNxhTyeLeb4E8oMUIpN4BBiyc1IPqRBbUF/IwegrnJRds1O+l1JGcPeydVC/Q3MOUx3dVxovAhX5h5axWutCPaBfyFknMRewY8bEQi2kq4qE4CLvCWofBJc2pxojmrHs1gwzcnm/mgAVMf57ZDPAg== 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=C5n0cjqebCL4J+gINvDozGWmeH0y5pJkM7iroi6BcrY=; b=gdufEXDGCmIKb1I/sXEXJnjMMEhK50z2E6V1HNlJPFsFTFTFGKnuK/F5DEelebGvr+T5/DFwdcHRetp/VjlgzbNZNMgrk07hPTmHuR9gvaVU5LtEfYw3pGfPv52UZNv4bkhrdfDj0xxicXqyAihl8lVY3H+ygjjJV8K+0MjE3G4= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Mon, 11 May 2020 15:49:59 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.2979.033; Mon, 11 May 2020 15:49:59 +0000 From: Jerome Pouiller 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 07/17] staging: wfx: fix endianness of hif_req_read_mib fields Date: Mon, 11 May 2020 17:49:20 +0200 Message-Id: <20200511154930.190212-8-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> References: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (82.67.86.106) by SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Mon, 11 May 2020 15:49:57 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4e703613-7df4-4c51-b5bc-08d7f5c2f5c0 X-MS-TrafficTypeDiagnostic: MWHPR11MB1968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:163; X-Forefront-PRVS: 04004D94E2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: I86yrXcvOI6UWTAuDFFcdXP3lGdvgs/LeG6Xt7J4d07xhK1+gZg1/TB8o3m8yVYOMzmHSbQyt9tT2Bct/Rqenk3gqM0uLr6shZD+Mdn9TJtP/R1/imhS1JFgy5izzULp3AUwPcYfyw0r3129BtvqN0pgbIAp1+6RjIiNjTg3QGZSayGoqRZB7ontoHOguYF4PSj+tnzAH/jXDJsQCg4+WFKs5A6gVOyvQRuJLZerZti4fD9UJmBZdtrSRl6ym88AwBUI+oMG1wVjhQJYr6sOzGedsyuAQFGkC2iHnzXHJzNLEpIg55Cj+0Q107DQwkFWTJLB7zqh1Sn/QMuSxjvoVhHJRFD0jVb+gHkx3fhfCO5p8w5lj8U7un10CZW87EOJ8Pi5N4z5iFmAxmO3oUYh8hdkkmZ627EOO3i/CZL/ZGLj9fCoxDQvaOY5ohZLGCieiEV9GxOa1BmELNFdVnpJZvYpbKC9ElZ4zE8urZmd3mC3sgmECBeuyrPQ0B69Wp0niL51uDTr33M5ZJMANc/Qlw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39850400004)(346002)(136003)(396003)(376002)(366004)(33430700001)(186003)(52116002)(86362001)(316002)(5660300002)(7696005)(6486002)(33440700001)(478600001)(54906003)(6666004)(4326008)(107886003)(66574014)(36756003)(16526019)(26005)(8936002)(956004)(2616005)(8676002)(1076003)(66476007)(66946007)(66556008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: /LkFsSB071M+5tohCfR2PMypGS06CAbq84axijkH1NLl/URkKEAHvHCHLoy3BlX86T999MXvUvu1o68dUfGoOi2Ip4PCyKelOuRryyHLkCBWF3GwxIOqAYUWIJLNMONJ3ZAtGM7P+MdGjrnOqHfO5rUdfu/wFQ+Kf0Gmjo68/zN/iEJYFfKzRFGejghWRudnPU2y+WoBqL/cwN/soIY+oJcxuzC1Akls1unSxkexrNMXED3Ewhao/9I/d5OtyNmHx3x5OTutb8MW6NtsjwcazQDkkZLr2qFWXyCCBfOm1ncwmMFS801O/mn3x1h8gOIlX94C7Jnr2WCHJuXRSiib1IEupeGR5iEG2c32X+I39EL56QRWEtDAZebrpjcCyxJKV06lUx81rNI4K0tq1h0RtKGObUeON/t7pcSdzTDJjPZnSOhuNf/t3qdV/RfD4mnTCB49GF/pjRGrVAZswSzZcJpFTNc9b8j9KZGRBA0xDJU= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e703613-7df4-4c51-b5bc-08d7f5c2f5c0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2020 15:49:59.5000 (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: MWC3QhMVS0nPeV7Uaeqq7RYO+MBT4k00FuEMhUuvYAH8/yRDdA5m4NTcucssSwFsWiZNiSnqtcnMvDS8AXw8LA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1968 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The structs hif_{req,cnf}_read_mib contain only little endian values. Thus, it is necessary to fix byte ordering before to use them. Especially, sparse detected wrong accesses to fields mib_id and length. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 58013c019192..490a9de54faf 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -189,17 +189,17 @@ int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, wfx_fill_header(hif, vif_id, HIF_REQ_ID_READ_MIB, sizeof(*body)); ret = wfx_cmd_send(wdev, hif, reply, buf_len, false); - if (!ret && mib_id != reply->mib_id) { + if (!ret && mib_id != le16_to_cpu(reply->mib_id)) { dev_warn(wdev->dev, "%s: confirmation mismatch request\n", __func__); ret = -EIO; } if (ret == -ENOMEM) - dev_err(wdev->dev, - "buffer is too small to receive %s (%zu < %d)\n", - get_mib_name(mib_id), val_len, reply->length); + dev_err(wdev->dev, "buffer is too small to receive %s (%zu < %d)\n", + get_mib_name(mib_id), val_len, + le16_to_cpu(reply->length)); if (!ret) - memcpy(val, &reply->mib_data, reply->length); + memcpy(val, &reply->mib_data, le16_to_cpu(reply->length)); else memset(val, 0xFF, val_len); kfree(hif); From patchwork Mon May 11 15:49:22 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: 215652 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B21F1C54E8D for ; Mon, 11 May 2020 15:51:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 92DF8206D7 for ; Mon, 11 May 2020 15:51:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="LqtQqBEw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730453AbgEKPuM (ORCPT ); Mon, 11 May 2020 11:50:12 -0400 Received: from mail-mw2nam12on2062.outbound.protection.outlook.com ([40.107.244.62]:10442 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730610AbgEKPuK (ORCPT ); Mon, 11 May 2020 11:50:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l4T5a4TPQjdKXa/UggiSqLvTa1Q9kQ2KUndvUvPNyICNxiGrkKS5bXypfno8aEqwcGPgwSsLb2U4A0fviP9ohWmFqqYqDLxXYaHkvBHuJc0WZyFvlcvLWC4hwQb4nUFa47MuCM7taef5ltMOMmoyJHQ1egRDWp4aaX2FreqNMrNxrcQs/w25ELFYwdtklX8gDzpC7KJ8VhrreSiE3wOSOlHqDsY5aEibBZeB5mnMDez50+oi+o4jGKfHnC5NKRup/yvzXGvSzn4cD7TM+SixEsdfivGJFPPFO7KJyr9O+B73cvE4xTfPAqDimuYH63dMBExhaMfkGwlCdyPBr8q76A== 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=Xt3E2OZVeFnb8bWFymkk46zKKa9H026w3su1lI1HuKI=; b=ihSo3+3hX3EkKOWlganB/mhyXrldf9ElXob+z6YdyhPMArpzet04B5ggM0Ibx9jq9zRvGo6LljHlwN8FK8+Gl7x9/dUHxN9m5jK0v3wkebne+YJ4phVxSIYLMmD8hQWD8n3URwyYV6M6thSKq59BYhpVI2e+BumGk0xudSYnlh8/x76agqgw2GiefjmuMUEm3XM6oYgw9Vow4fomtHyGjm9rhonLsPq2mh/aaiv6U0m2uh2j5cBSGlclN+a9xF9v6yPy5v5Pkyil59yZr/FAWzMktwnrUzejX6MoftdPaYAQDAI22Or/Al34VFDsu48HvOQ8Ktr2MFmJyDmTD3837g== 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=Xt3E2OZVeFnb8bWFymkk46zKKa9H026w3su1lI1HuKI=; b=LqtQqBEwtIvF58AzOKpPbMIrBVQnFOPHF5qgT/Wb69cTZ71ZfsRQsU5+crFVWFBlnZMCa8u2bPTleDsN/k6nUHu/6915reWNkq698vkJXDGFG56+/uOxlJTL5fy0SH86o1ECSWCBpe7HEwT/n5TyjR0hFEg4gM8s1KDQ1+zbbrU= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Mon, 11 May 2020 15:50:04 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.2979.033; Mon, 11 May 2020 15:50:03 +0000 From: Jerome Pouiller 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 09/17] staging: wfx: fix access to le32 attribute 'event_id' Date: Mon, 11 May 2020 17:49:22 +0200 Message-Id: <20200511154930.190212-10-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> References: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (82.67.86.106) by SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Mon, 11 May 2020 15:50:01 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45edf3fc-7bc9-411c-a1a3-08d7f5c2f84f X-MS-TrafficTypeDiagnostic: MWHPR11MB1968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2331; X-Forefront-PRVS: 04004D94E2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JNkIkl3NeiRXulrps/JJdGL/pbfbahCfnV9X2Yy0kNzT0l2KypOlgzKxMw1dH50iTq3Q0d4Wu3VH63WTeU6dBliCLf1jjBFIwcuMU51Lx6o3aBRx/BrmRBk4EsGWuZf+mpfLmh561EYWqPKzMvXH0VYiPeWNdTyN6t5BSpmtJIkuZK9GkA2dFWUiN37S3S+O/JEoqgataYwY1pw0LqeT6ByU5lyyS6wmXjNMf3Bz7Gj/JXT8QHSNM2osRc3jx+7F/y4pQuc0hpo+1W3eO6nZN41EWIiXkbIyz/OZnMnSo0zavMXRX35c6Tj9FpTxh8SJwapcCDb3dT3Ee6koAouoYmiToFQhWTqExFJmXHrtJG7E0UJn0uEWVyMxAR4lqAERIBnqqj44QWMkt97tIxsp8BCMHEs3jpJCk1kwPh9UI5n+RpKrUCgN7TUzxIcYXmScIj+tr/vBABvJsvRt67QIRKuMwBn5umJinkDorzzTCJ/fu6v3+uPr0JjFqOHlTDL1r6Z7CVcIAi/cdo/FQ20CSw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39850400004)(346002)(136003)(396003)(376002)(366004)(33430700001)(186003)(52116002)(86362001)(316002)(5660300002)(7696005)(6486002)(33440700001)(478600001)(54906003)(6666004)(4326008)(107886003)(66574014)(36756003)(16526019)(26005)(8936002)(956004)(2616005)(8676002)(1076003)(66476007)(66946007)(66556008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: LqBmWiZcP+hM2KsFYyrt1TT9o0G9DjQQe6yCZkDsvhCiGt0+DAtnF5h+r91WuAd2zDoSdJlgoznLSmOydKYJA6EnYjno8Vsduu+XpJM0sYo/jiuHMFl6OfSZaa2UYVUL8rwjtGN8hyPIMPHoL3/6haWN+SXUp6VUWDgS6NPH0sqxKM0ELrr5SJS1TpZuiQXqIm/ZAqIzIu2JoGuYye2jbUH/i9bl48bCm7yaEyZ+RV81nbHuEd05c2kJxYBipQk7jTf4UtA9ajyuffHWKPb69QBYyUo77S2QWlA2oucQCdnrbCTO84IK/2x/24hquk7zskiLd7lJEtA8ZLpipmQGOpBx3/1TLhOKKFykOj1+4+sRlDrSW9uaPi8F1j2kg1oab9SSujQBjFtyAzklH+pFi+uzbVFpHimff4K1ujABLQJs1cZill8vqsD3OyZBL77pKtP7y0J+XG1ndJe2SmQ/FXzOZrRR3wJgQ0vayg/juEQ= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45edf3fc-7bc9-411c-a1a3-08d7f5c2f84f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2020 15:50:03.7612 (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: R/GTqtj8JecA6YXKLxK0N6TY4vIKu3+HEORSpwhsmh/HcbFfPkOOcxfyxGmXFepBXB1RzjEHUsUmp5Lg2RbvIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1968 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The attribute event_id is little-endian. We have to take to the endianness when we access it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 87d5107a7757..966315edbab8 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -158,6 +158,7 @@ static int hif_event_indication(struct wfx_dev *wdev, { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); const struct hif_ind_event *body = buf; + int type = le32_to_cpu(body->event_id); int cause; if (!wvif) { @@ -165,7 +166,7 @@ static int hif_event_indication(struct wfx_dev *wdev, return 0; } - switch (body->event_id) { + switch (type) { case HIF_EVENT_IND_RCPI_RSSI: wfx_event_report_rssi(wvif, body->event_data.rcpi_rssi); break; @@ -187,7 +188,7 @@ static int hif_event_indication(struct wfx_dev *wdev, break; default: dev_warn(wdev->dev, "unhandled event indication: %.2x\n", - body->event_id); + type); break; } return 0; From patchwork Mon May 11 15:49:24 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: 215656 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D9DCC54E8D for ; Mon, 11 May 2020 15:50:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EDFCB206DB for ; Mon, 11 May 2020 15:50:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="SXAtrsTd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730674AbgEKPuT (ORCPT ); Mon, 11 May 2020 11:50:19 -0400 Received: from mail-mw2nam12on2062.outbound.protection.outlook.com ([40.107.244.62]:10442 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730648AbgEKPuO (ORCPT ); Mon, 11 May 2020 11:50:14 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n9iPaf0cevTYGFsIEZ9mxBPevuzUjZ3/7ogYekWyJZRxrZHdpIW/PhiNPjFEAkPGAMbK8DRgu1UzFyxbM5p24hb4v2+CqqYDemvD2PHUh/k0onK5zNOMT5GXnZJ3nQV/wFXEQnXqRQU761MEO2wCJNBM42AsKMa+4kBEyWr9Jaq8gY7dWV0H5qNKka4pjFte7KmiBjWSj5+mFl4mCtUcO+RzlBYY2xQDkziRIVjSv6bHmcBGdF80T9vwW2pw8BLIQoj1jU79hl+4MSbA203WJL89bnUkOuyTZk/cgIipUXPuTEx22vM74A740IUINaRxJVQB5teukLe8JfkSOLWRGw== 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=lMU9prHPQ5lHqZN+StG88B7rwQkzvC3y06Aj7lGDv00=; b=iPGIV2+LYqhxlkdDKUC5sEEFCIFOz3wTonvaISrwwEftlaMzY+TylF1YDEKOQ5/M8tR68W0JplrlC32SsBFhFqxWTjunJdWtajnDqmKWo7BI8TtxLQVgkxsdVWl/KQqsoQCiKzoU3XFBz0pghpc+y8eNKIVS+cwPVsnfx3ULoEn6pAniaRMb5PFyrGB+1LEn4Aro/ovXUWMJweKXeGpBiFG02xSUUatiHnbYT44W3D5up7l7HMECribTL5ahQiU8mT7/cFLWy4wuXn4WBTCSk3r37dQJ6GJlC469mBhUfUrAKDRe3IX16pwrAkhcoHaBqCA2WkBTrD8zqLzg+7L2zg== 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=lMU9prHPQ5lHqZN+StG88B7rwQkzvC3y06Aj7lGDv00=; b=SXAtrsTdtvQ2Fo4h/G/jOxqaHmhFBHHkU2jhk+J1QVeZFGd/OQLBFdWFRIHVjvMqDPbMztTyMpM+p5aIBMVnB92aNP9zBk7ohiMpxwkkBIZpw8YYqplINPq9RWUvAMV09xNm9VCqDYWKKpKgqFuQBwXnLEMi29IY4TMZJQiB9EU= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Mon, 11 May 2020 15:50:08 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.2979.033; Mon, 11 May 2020 15:50:08 +0000 From: Jerome Pouiller 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 11/17] staging: wfx: declare the field 'packet_id' with native byte order Date: Mon, 11 May 2020 17:49:24 +0200 Message-Id: <20200511154930.190212-12-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> References: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (82.67.86.106) by SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Mon, 11 May 2020 15:50:06 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0a933d4a-8e47-44b0-dc03-08d7f5c2fad5 X-MS-TrafficTypeDiagnostic: MWHPR11MB1968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 04004D94E2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DDnYAjkdSwaLWMJj82Gl3JqDQBMukebqdFsaZsQm600YlpXkhsNF5N3uNiwm0E3lNYuOrt/zUlyL3FIaz7R4qI+Q6Lw56dE8U7m5yBREeExEZbZptzrqr9Jr7fqfAVPGHToFeGGEshVzoCE2/tTcCh7GfvS218eeF5iOfAiJTqCU6PYq5eEQGAzP6pSDLv9OEO3CRbHnobpTOSBhZD0K+GZEfKT8c/NKAHMoNZRkb4k/fwjj2c4M78x+Oi1SIgvpo9HtFmHYdhjQy6k1uXppv2DmBeffmLTD2aJyqMSiGsFX7IrPcvOej2EwGgTStZMbwvpZFGg6MZJIN3QuDMdImuNUhPyrJErXDs1q9depwJrbR7r6iiGPqT/dG+WMhBCGtMLjyFIC0PUtlT1PaCEglwS3YiBBGMvdEFjekz3IE3wVSCWdOXsqoyCHJXZ/kr4f74L9p6UfRQKMpHBn1g9DuaTWWHxezNHcsHRVR2YSI1HVSB+OlWZ1yrOXd+bmYF87TAD5eP9/hL0RJd2rwzM4ug== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39850400004)(346002)(136003)(396003)(376002)(366004)(33430700001)(186003)(52116002)(86362001)(316002)(5660300002)(7696005)(6486002)(33440700001)(478600001)(54906003)(6666004)(4326008)(107886003)(36756003)(16526019)(26005)(8936002)(956004)(2616005)(8676002)(1076003)(66476007)(66946007)(66556008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: /Z6AIN8exZ/4tQUQvmzjrFoU/rad7JZQIONqw+7EMK3Ckwp5J8M87BSgH0/N+ptkBxNua06YCEDC69zY7eHSvsLMvsXvNI39jYlpw1J5cdFbthtEa3w3ZfnryoF4MyF8YBzpGrlXQT4OzCa8mLV+8NqwKdWWXNCuw1BZMuoLtzBlBd273kHPfZ8hI9PioxX2rLMo8PqZVfDh5oM7AXAWD9glC+REvboN922WqkRcT9rEiDbmOFl1aU1rmi9Mp3EiN4u5FpDgPR+THxU/NcqEtGrEOf8ZwU11XFkc0XnMSSH98RiPZxrferwyf7RecmEE4/q6Y9JPu32I1gJnyPi+jmuRO49xQsWtia5KpEwDP3N3xqfy82ZsVwwKF3cF5LbzN4mbQiIVxe1bpfPVQ4s39Fq+RHKMtDMa6i5wsdgbJs4wNy+hL2FJ0vFhvuJvXktBVIZFpa33Vt5XObmKhu9s/pd3KKcjOLyi9VkL7iRYYnc= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a933d4a-8e47-44b0-dc03-08d7f5c2fad5 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2020 15:50:07.9983 (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: I58X0vx6YRGDOGVrvzgeYTbhRnl0rUtnDzCqTRU37pP9nIvGwYFLgJY39T6EDF+1m/c+hb9jz7SwBhXsjWlxeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1968 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The field packet_id is not interpreted by the device. It is only used as identifier for the device answer. So it is not necessary to declare it little endian. It fixes some warnings raised by Sparse without complexifying the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index 6f70801949bb..bb8c57291f74 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -254,7 +254,9 @@ struct hif_ht_tx_parameters { } __packed; struct hif_req_tx { - __le32 packet_id; + // packet_id is not interpreted by the device, so it is not necessary to + // declare it little endian + u32 packet_id; u8 max_tx_rate; struct hif_queue queue_id; struct hif_data_flags data_flags; @@ -283,7 +285,9 @@ struct hif_tx_result_flags { struct hif_cnf_tx { __le32 status; - __le32 packet_id; + // packet_id is copied from struct hif_req_tx without been interpreted + // by the device, so it is not necessary to declare it little endian + u32 packet_id; u8 txed_rate; u8 ack_failures; struct hif_tx_result_flags tx_result_flags; From patchwork Mon May 11 15:49:25 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: 215653 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3022DC47255 for ; Mon, 11 May 2020 15:51:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08D51206D7 for ; Mon, 11 May 2020 15:51:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="eibVwbps" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730691AbgEKPvA (ORCPT ); Mon, 11 May 2020 11:51:00 -0400 Received: from mail-mw2nam12on2062.outbound.protection.outlook.com ([40.107.244.62]:10442 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730663AbgEKPuR (ORCPT ); Mon, 11 May 2020 11:50:17 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ECuuyz3q45KNqG8mrgE42LV4lb1qEN0CZL74vIBuLroCVYs9BNjIJoBaqZRYO6tN1q6nGqznZDVLBPyNoCFVAdTKmqXn0u2PD81viRK0kR5rjzyccPfys1u4KC1q8L57tK0kNLFv6RxZZDtKDK5PcG2Bsw22voGyuwSbsW1/sHDTqUAMwaZhu24StSW29kvdUo0ueNi8086+3WJELkgY0gJENJkNYkRUL8yvaDpC2uDtjtU+GG6VHOGIZxat9N7FdauCAD3RWXA+LvPmZLxhgzPJM6JXxYb94/DGkjYqZsge3NBI5iRLuguwHM91svJgwH30TzgQEjsS9Oy24n5VYw== 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=JQUEM5ca7coakQv72bsNt+k61HBZZbFyi6u61Mxubf8=; b=h+6EGdA1d/z6gaRk1yLEOi+v7TYFCKsO5kpzVqwPAxp3DV4FYfve07PH3+VHqXr+07XJ27xrC3s6xt20FrMc+37kF0pXjEWGEZ3FqRaFqAYJIKn9RncboThdafZ/gF7Qa0IGKVkDJJ/mCUL8L8Vje5421q88UFl4OJq3X+9Wb8YKjZWtAcQh8Oy+XRPIsSnH78Lxw6G3nA2y0RAe2jPNdqS9DX41UHl9w/VzJmyH39lBpdMnP9LossUkAJgjLBN10KFK2gb420Dz3YUjZ0W2T+oYcz3BcnDEaWyf0i9X30WUgylLeXZn2CHj8takCi57i7+8qpzRCuIBIbZ7qFH22A== 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=JQUEM5ca7coakQv72bsNt+k61HBZZbFyi6u61Mxubf8=; b=eibVwbpsTOAE7rEDwMzbgk1Lt2JqaQnucJwV03wiG5v1swWIM27xVQzFYziu+hEKrSgHK1jasFVkS3BtF1xSeoxnwsxYPLAcwNFDuH5mQ23uVLwgmansBS0FbbNVh4QbsRCFBbF1J8s7k7Lyp5B/YCo7osleydHs0gNicHWy5/o= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Mon, 11 May 2020 15:50:10 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.2979.033; Mon, 11 May 2020 15:50:10 +0000 From: Jerome Pouiller 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 12/17] staging: wfx: fix endianness of the struct hif_ind_startup Date: Mon, 11 May 2020 17:49:25 +0200 Message-Id: <20200511154930.190212-13-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> References: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (82.67.86.106) by SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Mon, 11 May 2020 15:50:08 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38bdffcd-4928-47aa-b5c4-08d7f5c2fc1c X-MS-TrafficTypeDiagnostic: MWHPR11MB1968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:248; X-Forefront-PRVS: 04004D94E2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LeIKW/OoLuNhzMbQ+FbzBTsBKL4hzeejmvi1iZ541wDHzwusCqrIjg0+UYA7/CRNPrz3eZCVDlZ7OAG8kUY7EwP6fvBqtmHz3QzFv+7Zw+R+V0+hqJffNvQBFdEmhAF/10aZnPS6OMi5KnQT+KubJz9qs6gzcP7xtq3uWYxTwKnUfaDmCrtYOlEbqMUocyNp/ep5kia3XezgT0MzHR5oNyfGbe9SGxWmxy46ThKPM47f7Zz5h+CZOqVOX/k5Ps048/m8ZulN7PUb/c3sEbf7diIJl94D8wysUFfirBSp5K+6ZKe1GH3bvIAFoxyqIE00XCkehX9wDt/ulhu5rQzxIkI6Zfe+S6IYp2Xw63rqkjqR0/qhfdNfLO14JrFojlDOkwF2PjHBR2Y2qKpLU0qGsRUadJrJ0X5W7dl5Xls/78wc72ukKHhz0TZ/TCdTh3k/FaRhFh3tAh/vnlE9h4phWMrlo9t3ihOip8PQuYIHyZe54OzJa0tai3MgwgZzW0JWvqtoKBQi2HxaGlC9rAqyWQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39850400004)(346002)(136003)(396003)(376002)(366004)(33430700001)(186003)(52116002)(86362001)(316002)(5660300002)(7696005)(6486002)(33440700001)(478600001)(54906003)(6666004)(4326008)(107886003)(66574014)(36756003)(16526019)(26005)(8936002)(956004)(2616005)(8676002)(1076003)(66476007)(66946007)(66556008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 22RpSVebhbVN2Fvq2QnWxpyGzHOOBbABeOJa80h6UUMFi+8nmvTmtdE2v5ef3Y4dW80EGqvuEU4Hrjfj49xrTfe2pMkFlVClEh/mWIQDMqvhzAZQtHBqELuuQe7KknfQqLQVVhd4URNfDpsRhLgeOrCF411Q8LHVnp44rxhu3ZO6TqQJc/QhTfZ0bPmaCPAHNRL99DFIJTrV0nVCoPUmJriDJkBPkI9+DI0LRJW51FBwLc6/PLRQmQ0ArPMQaZbXpzG3vg0icHgXAdO0k9I+zmQd/PQkOC9ghagGPl2qQGzwVv8UBaNZoDzVJLHTdbhAf9iFCjxZttcV/t5+1vES6+BW6eVxs0eENp1ExizAtdMrBPgAxDYZ3HdHxwBu5VotIxp0BAX/LWo7LhFkCQ0uIOGUTVCEi7wPhKwL8XpU1CJDjOwxCpm8MuLWi0jNCm9hByI0KQEq4PUzBwNe10ydUThU/d9KLA8vJmL/wPEwt64= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38bdffcd-4928-47aa-b5c4-08d7f5c2fc1c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2020 15:50:10.1203 (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: xAflAmfoSGPBOBRlowc9XAzFb+pkL6xHayQf6UDsL4HyRhy7J5u7o1PSO7VireFxYcMz19B9xgTq7QNj+IUtvA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1968 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The struct hif_ind_startup is received from the hardware. So it is declared as little endian. However, it is also stored in the main driver structure and used on different places in the driver. Sparse complains about that: drivers/staging/wfx/data_tx.c:388:43: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:199:9: warning: restricted __le16 degrades to integer drivers/staging/wfx/bh.c:221:62: warning: restricted __le16 degrades to integer In order to make Sparse happy and to keep access from the driver easy, this patch declare hif_ind_startup with native endianness. On reception of this struct, this patch takes care to do byte-swap and keep Sparse happy. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_general.h | 11 +++++++---- drivers/staging/wfx/hif_rx.c | 8 ++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h index f0135d27120c..995752b9f168 100644 --- a/drivers/staging/wfx/hif_api_general.h +++ b/drivers/staging/wfx/hif_api_general.h @@ -136,12 +136,15 @@ struct hif_otp_phy_info { } __packed; struct hif_ind_startup { + // As the others, this struct is interpreted as little endian by the + // device. However, this struct is also used by the driver. We prefer to + // declare it in native order and doing byte swap on reception. __le32 status; - __le16 hardware_id; + u16 hardware_id; u8 opn[14]; u8 uid[8]; - __le16 num_inp_ch_bufs; - __le16 size_inp_ch_buf; + u16 num_inp_ch_bufs; + u16 size_inp_ch_buf; u8 num_links_ap; u8 num_interfaces; u8 mac_addr[2][ETH_ALEN]; @@ -155,7 +158,7 @@ struct hif_ind_startup { u8 disabled_channel_list[2]; struct hif_otp_regul_sel_mode_info regul_sel_mode_info; struct hif_otp_phy_info otp_phy_info; - __le32 supported_rate_mask; + u32 supported_rate_mask; u8 firmware_label[128]; } __packed; diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index fca9df620ad9..9b4f0c4ba745 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -100,10 +100,10 @@ static int hif_startup_indication(struct wfx_dev *wdev, return -EINVAL; } memcpy(&wdev->hw_caps, body, sizeof(struct hif_ind_startup)); - le32_to_cpus(&wdev->hw_caps.status); - le16_to_cpus(&wdev->hw_caps.hardware_id); - le16_to_cpus(&wdev->hw_caps.num_inp_ch_bufs); - le16_to_cpus(&wdev->hw_caps.size_inp_ch_buf); + le16_to_cpus((__le16 *)&wdev->hw_caps.hardware_id); + le16_to_cpus((__le16 *)&wdev->hw_caps.num_inp_ch_bufs); + le16_to_cpus((__le16 *)&wdev->hw_caps.size_inp_ch_buf); + le32_to_cpus((__le32 *)&wdev->hw_caps.supported_rate_mask); complete(&wdev->firmware_ready); return 0; From patchwork Mon May 11 15:49:28 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: 215654 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F684C54E8E for ; Mon, 11 May 2020 15:50:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 494E2206D7 for ; Mon, 11 May 2020 15:50:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="gt4rOxA3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730684AbgEKPue (ORCPT ); Mon, 11 May 2020 11:50:34 -0400 Received: from mail-mw2nam12on2062.outbound.protection.outlook.com ([40.107.244.62]:17760 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730648AbgEKPub (ORCPT ); Mon, 11 May 2020 11:50:31 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nqb4b0a2psl1D3aT7R2hHB6AVCUOfdTqjqoMT4e9TXcwkQsGD2rv2oa5A0SyAr6t6w+PYzfakdWLFVdqc5up5GGjYkN6mG2M9FnosmtX82j/UDmzotY+29JJXuQPvsq9z3IkK2abqx16WgdPrfZRfYmaYQsjaXi+GBoD9FjyvgeneZqCP73J2r9gej60TSUJPIfFSSUBl3KrGMoNvBVq/oSRFE1lXRvcZE6wNyXb2PVbn/5hSKi+95QKIt6vPhnCJH3J0vEtuIUgWPuD4/m0SLeMKYVyNmc1IhrsD64Nkj8OFqZ7INlQc9RGlqz90mgPFC7CL50CquU5imcur9tjeA== 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=z4srQK29dX43wzsCF0du08S6OvPn/4KroWPMEV0cAqI=; b=GlbTfVoiRCL6U4m+ZeyoXYfgPDzMEg7vQ7MnfVxoRJcOL024vkBiyPHo7R4qdDIF49IUtCFZlCyBT+WufdRWMpCSX8/YRRNjZK+68JAk+58DnsasUmn4pwJEXfvTReR6dA6zZ8sjDSpp30AQbyqbkXodFRzUlKTkDymQiNHRqikdaO2SvUBSFCnmskj83pSlYUO5aJn9v1VgkZK/L+azFNTubJ2H6ONYWBabGN3dzuku5+3wu0tUj/khwjW7P1fXRKoZQGI0wNJxQXQeI6/1c/B222gfnjKVX7BnJOJE7yGy/k5XdeYEsNHpVIX/oPD+ljgmqGQzjzcvaBhdD+j8vQ== 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=z4srQK29dX43wzsCF0du08S6OvPn/4KroWPMEV0cAqI=; b=gt4rOxA3MnZWw82fybematDgF6P0Q74dZfhELfg4yigmwRFdnFHWdCPQt/2/glOhjzOqSVBOs236s4bqQi5YInAhOV4tXIWFfC/zqwh19t+5ccW9LLoqkRZZf0AgXHTOG+FkzJM5WLByRYg8vHndjTgi3LhFXRfbbZhHmxAT0fs= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Mon, 11 May 2020 15:50:16 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.2979.033; Mon, 11 May 2020 15:50:16 +0000 From: Jerome Pouiller 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 15/17] staging: wfx: fix endianness of the field 'num_tx_confs' Date: Mon, 11 May 2020 17:49:28 +0200 Message-Id: <20200511154930.190212-16-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> References: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (82.67.86.106) by SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Mon, 11 May 2020 15:50:14 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e219ba86-6697-47bd-7b1b-08d7f5c2fffb X-MS-TrafficTypeDiagnostic: MWHPR11MB1968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-Forefront-PRVS: 04004D94E2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qFQr4vMjnFVJC1itz3HKfhIMZUR6jjmk8j38Cssw0umAMN/df6IgNXnQ/XDQ7e8B9si6YBSMXu8zGTGRyfHUtUe4YsvF0/Q5R19PhfnB4S2CEuKPxzLjBHZYr8odFxyzkF20fyYR5DhOTbwCVkaz+ZEu3seuly2tY8QeZou4qTljQJPNyen7SdnTeh0QReLTXUtcErqC3z5BpBPbQf9OhHUxfPPIu6/K8NzPRO5M3qGeZIiwEsCj8nw9v5hnh9hU3MkRDp98z+ng97d5sfrwXLSvmKQe2NZ6zoGIHxD3WH2ZHLF9QvHPUJ92M/AqnE6wTbXCwtqoOqbTCMkajxYIRYdoKy9SVsLA9VDALVmAQmSWhdqSd7OBiufzB11nRQ2WGnTP6jIaqB6JQ4XjxGhdyut6+H+zZ75t9/ipeNwQqyBscl4YhtuLXa+EdguLIHgt86aQy22U7+lpXpaMrGPLPNkuAogWNhNU/T9wwFysM5ckOZbWPBWAW+PBPUDuvPe6csNvaqBSh7u4O54+a4WUsw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39850400004)(346002)(136003)(396003)(376002)(366004)(33430700001)(186003)(52116002)(86362001)(316002)(5660300002)(7696005)(6486002)(33440700001)(478600001)(54906003)(6666004)(4326008)(107886003)(66574014)(36756003)(16526019)(26005)(8936002)(956004)(2616005)(8676002)(1076003)(66476007)(66946007)(66556008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: x6If8Oe++0PsdYNBs4DROztM9P5o/Al3ZDC4yF+/av2UrbfNyhnmwke5YOsY25UqG9FOQHK14sD+GXSfyWMe9DplUhQ+lJJUHUBNmWIBvbJC5YpnkHbLv9wckrxt0E1CZg4QHdL4EaoFjFqHCeZc1EAis6YbmP1vcGjvsUwn9SPXI4Vly8DyOBYprwUj+a4OUQ1TjaP56FqFnghWf5lDNA7DKv6Et86esPuMeRa/wgu5lJqQGUn/2wd/c09Q6oDGtuIfZ4QCBoE/7WLNJgk1Gsw8BUCzPlun2BTN9C8GnDJJMJ0JOQd4FQikx94JeGn43sJZrUmcCVN9UsIvyGQmVkKq54exwWkDnYVl/I4oOj4yrtpjnv5Z9jy587Khxkz7jdRyb8ZgSSbgi7S7/Mu9+YpYooLdx4ss/7QZ9w0EBbXX34Klf8EDHRry9gNSt25If4ZjgdrBdIbGw0+gfhM7YsJcl5qjKK7oZT1J+d1yB+0= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e219ba86-6697-47bd-7b1b-08d7f5c2fffb X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2020 15:50:16.6194 (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: 529S+q03yB8wAxt7H8Wrz+TAOls2GKpyBGZgrXG9U5CLmwXTzNmNTuF/OOWQgnnJPSFr5qNSd8gdyxzLSLQbYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1968 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The field 'num_tx_confs' from the struct hif_cnf_multi_transmit is a __le32. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/hif_rx.c:82:9: warning: restricted __le32 degrades to integer drivers/staging/wfx/hif_rx.c:87:29: warning: restricted __le32 degrades to integer However, the value of num_tx_confs cannot be greater than 15. So, we only have to access to the least significant byte. It is finally easier to declare it as an array of bytes and only access to the first one. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 2 +- drivers/staging/wfx/hif_api_cmd.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index 0355b1a1c4bb..574b1f553af3 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -103,7 +103,7 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) if (!(hif->id & HIF_ID_IS_INDICATION)) { (*is_cnf)++; if (hif->id == HIF_CNF_ID_MULTI_TRANSMIT) - release_count = le32_to_cpu(((struct hif_cnf_multi_transmit *)hif->body)->num_tx_confs); + release_count = ((struct hif_cnf_multi_transmit *)hif->body)->num_tx_confs; else release_count = 1; WARN(wdev->hif.tx_buffers_used < release_count, "corrupted buffer counter"); diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index d76722bff7ee..8c48477e8797 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -280,7 +280,8 @@ struct hif_cnf_tx { } __packed; struct hif_cnf_multi_transmit { - __le32 num_tx_confs; + u8 num_tx_confs; + u8 reserved[3]; struct hif_cnf_tx tx_conf_payload[]; } __packed; From patchwork Mon May 11 15:49:29 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: 215655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48C65C54E8E for ; Mon, 11 May 2020 15:50:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 20742206DB for ; Mon, 11 May 2020 15:50:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="cpHnlbFh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730738AbgEKPuj (ORCPT ); Mon, 11 May 2020 11:50:39 -0400 Received: from mail-mw2nam12on2062.outbound.protection.outlook.com ([40.107.244.62]:17760 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730718AbgEKPuf (ORCPT ); Mon, 11 May 2020 11:50:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ljSRE0UWQ/I2aLx7FPewcUiT3Fpb4dTD4VyKJCVMZIhEDtpjIdWEeVO0vNsr/Du7k/No/+KW63IMqdMO0R3CAQqMXkemubxVqF6GPaVuw2mxdvt/pvU1GCY4RXKNjrzLbzT575SUYharaU19FbW1yn6VApDIzx6530tQB6D5SObO7X34L6P5Yaveq9ke+a2NQgzVIvSPWIAWMc2eeKDIcqopTh446VRqyjlpPQizPJjjnJkE53XYly93qVgA5FyQGwGkC+nBxm8Bmg0DGMNSBRImwWQ3/h6jCWejR/bYF91/BG7fWuTuiNOseSoVWjxXhW8q4cdbvCwZoibhzVS0zA== 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=Y5DYbo8vfnRWOM1AWqeRAX5SzRDmtdoARdW+TIHTLK0=; b=cAX074RzNpktt0bm3uDGP+0jPRgo6Bgx/9o/XaK7nnFw8OqrxnNSBQS9EsXTSan+Js4H87XcuQL2c6RGNMAtMha34zqJUyWi5Mbzeko1ZbNFvDZl2+QakyQ+LfQRPUSz2HCQpgttL9eDaxhMI2ozCTxvbTqc1UzA8yu2KBIKWpa09XPZqh5HsEqkX7HiAN1jAELyX3c13M/zzvcEekX+6Ngay7dDTRi9GfRkgAZ79OTU1YlCeF+dN4zu6MjmsvOxQF0ea2JO/sCQ98BTOVZbvVV//wi5vH7cJFtRltA0fMNQns0ReQwxi6kWnrOpqSoGhvNkJRjBv6kTVEutuWJzEA== 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=Y5DYbo8vfnRWOM1AWqeRAX5SzRDmtdoARdW+TIHTLK0=; b=cpHnlbFhNLVTb4oZSxi6+Ix3DS21VtnOY4SsqmI6r2L8lA61o9J+d7pNklwcJce7xGzFl5ZN6h38rTcitfc37KjgQdTwbb6BSukuDYSZp/ChmUGujBPRLNHQcYlAcEqJ26Ak2MGdh4IJaHXn48RH52+BWuigsgbPrrN/08m6/SQ= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) by MWHPR11MB1968.namprd11.prod.outlook.com (2603:10b6:300:113::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26; Mon, 11 May 2020 15:50:18 +0000 Received: from MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da]) by MWHPR11MB1775.namprd11.prod.outlook.com ([fe80::e055:3e6d:ff4:56da%5]) with mapi id 15.20.2979.033; Mon, 11 May 2020 15:50:18 +0000 From: Jerome Pouiller 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 16/17] staging: wfx: fix endianness of the field 'channel_number' Date: Mon, 11 May 2020 17:49:29 +0200 Message-Id: <20200511154930.190212-17-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> References: <20200511154930.190212-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) To MWHPR11MB1775.namprd11.prod.outlook.com (2603:10b6:300:10e::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (82.67.86.106) by SN6PR2101CA0026.namprd21.prod.outlook.com (2603:10b6:805:106::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.2 via Frontend Transport; Mon, 11 May 2020 15:50:16 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [82.67.86.106] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ef4b35b3-206e-4781-1407-08d7f5c3013c X-MS-TrafficTypeDiagnostic: MWHPR11MB1968: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 04004D94E2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B2II7x0R2PKwBuH9YIRALnI4MzEivi9KQ4UXbVDb8f0FQPp1Po5GEK6aZq3B+r6edUJZtsdlC6+5FyWaQW3DzFbBmHDBzYbXPHs7d4JXNO1BFjYot+SclPqZ3CY2sh+Ugij2e/TYCEKxCnLap1rWUjXBijJbOHKpfROsWE7w3Dr3tCpFrn3vABY3c9MVYThKqhxVPuOf5Ro2jxwBUZs9c+c0G2HDynhsRCatB2f0ofCsyjMvpPt8ONn0FGyJVNdys2zr8vxj17O+hOWgEq44bz15g3Y+QIImTrNcTfigwISk/8p3VaaERZAruWRhAepy6ig2Xfc/WdpGVDJQdzdtJzMG6hyqvYPYzyAvQMqS5a0yvgJ78ZAp8MbewIJSqouszGTIllJhC2HhD7x5sx9tlHLQAisiBG+6XlCITZInJIQkDXmssVDvszi4MFTnOWvIh48JT5mWqNMrlPl54XG+tJv+9uzS3bpo3WgiKTENTQnwt321TIodzYGwifzozUEK7YmIUXEr0eXxT1GMr+sYnQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1775.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39850400004)(346002)(136003)(396003)(376002)(366004)(33430700001)(186003)(52116002)(86362001)(316002)(5660300002)(7696005)(6486002)(33440700001)(478600001)(54906003)(6666004)(4326008)(107886003)(66574014)(36756003)(16526019)(26005)(8936002)(956004)(2616005)(8676002)(1076003)(66476007)(66946007)(66556008)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: p3GLcGYYzp+Ku2CgIDJKjnX7jTvhJfCTBvfYNRmmTP15o6Uv6miZkAqyesb/4WYpT2FhF9bj+0b0D50jRaWglG4zJ9KBYUqLB1VnFyaYAD0qfzXFj0H8rgb2papgVCw4LX61MHFR24Jk6F3JqcqnI2BWSinGaKHu2HNQGEiuaQ+6RWui7KOiVPSdxFeAyx3j50Ktfl/JT3LcGmYC8i9QSPa7P+1R9UE/FcGrg8bwGZ0JHrLz5V1B5T4uxbj5nFHbl+Bjg1+TftvpknwdKaibwCTKfyIjQP5/sh6J0gaiCv57NXFG8rhDjJ8ZvBvKJQC0tTgUa3hTnpUQh6XQlUnp8MD0lPJb6uogehm08LKt99fVAlzLXN14JPQj1gcZPMjUjGhrb5OAxBUrssR6O1l17L7SDhdiOYvD3iGaiO7U2duHwoaKIeuPG6Y6ID6Ld+pdzQoeXXY/Rb4vSF3QK6Cdvlch9fYeIXZ3U+hXBVZPfzE= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef4b35b3-206e-4781-1407-08d7f5c3013c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2020 15:50:18.7295 (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: uXXT8mSljjQYIJPt4P+4FNHHMTvgBVx3IefUIxP8vI3o6/zrHlISJ42w0sJvAs4kaqiyXuw09Kq6ZbYjBtWQjw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1968 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The field 'channel_number' from the structs hif_ind_rx and hif_req_start is a __le32. Sparse complains this field is not always correctly accessed: drivers/staging/wfx/data_rx.c:95:55: warning: incorrect type in argument 1 (different base types) drivers/staging/wfx/data_rx.c:95:55: expected int chan drivers/staging/wfx/data_rx.c:95:55: got restricted __le16 const [usertype] channel_number However, the value of channel_number cannot be greater than 14 (this device only support 2.4Ghz band). So, we only have to access to the least significant byte. It is finally easier to declare it as an array of bytes and only access to the first one. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_cmd.h | 15 +++++++++------ drivers/staging/wfx/hif_tx.c | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index 8c48477e8797..21cde19cff75 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -321,7 +321,8 @@ struct hif_rx_flags { struct hif_ind_rx { __le32 status; - __le16 channel_number; + u8 channel_number; + u8 reserved; u8 rxed_rate; u8 rcpi_rssi; struct hif_rx_flags rx_flags; @@ -356,7 +357,8 @@ struct hif_req_join { u8 infrastructure_bss_mode:1; u8 reserved1:7; u8 band; - __le16 channel_number; + u8 channel_number; + u8 reserved; u8 bssid[ETH_ALEN]; __le16 atim_window; u8 short_preamble:1; @@ -421,13 +423,14 @@ struct hif_ind_set_pm_mode_cmpl { struct hif_req_start { u8 mode; u8 band; - __le16 channel_number; - __le32 reserved1; + u8 channel_number; + u8 reserved1; + __le32 reserved2; __le32 beacon_interval; u8 dtim_period; u8 short_preamble:1; - u8 reserved2:7; - u8 reserved3; + u8 reserved3:7; + u8 reserved4; u8 ssid_length; u8 ssid[HIF_API_SSID_SIZE]; __le32 basic_rate_set; diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index e653ebbe5067..ecc99b765335 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -309,7 +309,7 @@ int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, body->probe_for_join = 0; else body->probe_for_join = 1; - body->channel_number = cpu_to_le16(channel->hw_value); + body->channel_number = channel->hw_value; body->beacon_interval = cpu_to_le32(conf->beacon_int); body->basic_rate_set = cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates)); @@ -435,7 +435,7 @@ int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, WARN_ON(!conf->beacon_int); body->dtim_period = conf->dtim_period; body->short_preamble = conf->use_short_preamble; - body->channel_number = cpu_to_le16(channel->hw_value); + body->channel_number = channel->hw_value; body->beacon_interval = cpu_to_le32(conf->beacon_int); body->basic_rate_set = cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates));