From patchwork Tue May 12 15:03:58 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: 219420 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, URIBL_BLOCKED, 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 82509C54E8E for ; Tue, 12 May 2020 15:04:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58B9C20673 for ; Tue, 12 May 2020 15:04:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="pbeDTkFh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730390AbgELPEi (ORCPT ); Tue, 12 May 2020 11:04:38 -0400 Received: from mail-bn8nam12on2076.outbound.protection.outlook.com ([40.107.237.76]:45896 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726168AbgELPEh (ORCPT ); Tue, 12 May 2020 11:04:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IfzbvjdmsAeG3sofhSptv0CZHJQRGU6N+bsYxJ02twj0im/R6CdSquGcjT4eseE80/8LfbdtgdrV/jzOf6X8EDE213nmnxTziDqSscsbX6n76rnVqEm4XMHlifY8Vz175d1cAhWi/Ek33jSjuqPMdt7Oy57pHLtZFEeIfo/xVNtjuhMt8T84mu1d4A3M0HWb0mZNpIrK3TnDpN30gcWeVKq+l9N02YQsPhAheCCSgVII/nj6lrIjo0Ls2Gz40Rz9bLzWWNCujA+Y5t5LuXJCG37oX8v0BWcfndtIeMaES1e/XyBAfwKrNm3i6MJfp9GUXTKZ17r/9TYZpKGqVVDcTA== 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=IExWWVHKF2XqSi+Sp12AMWU3WVMr+CLo4qZB9OwghaE=; b=dLvwQCxO37v7iAmh1fvS0eGmeMBOk0SXPpt0XYO6wB5rvfOo5L48ve01w9hf3o3bLxUujHN61S2RkA5eKyPDsshlKDn0mNGSjBYdWMZMg6ST2KEiVlKQ5/5nkmCrSp6F9ZPH8yympvZeByTbmnafh8FbROLRkhKVqXKj4kiAQpcfoPQgseQXTo3HW+3klZtQpaBYE6+aX6PnutuBsQh16LVekUOsS060My/K28SNB7hd7+g4mlvDLKiZPWHKlx/TyumlKKkfL2NbAvZoP3TeN0A42OnWvg7afuQ2eneF24Wv15uKS1L6XDwPP4T+Ti3tmDWHI9kvKNR5ZkzPUgZ8ZQ== 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=IExWWVHKF2XqSi+Sp12AMWU3WVMr+CLo4qZB9OwghaE=; b=pbeDTkFhY1OEwuBv8Ha8GInmmG7sSFx8a/Lk4mILIV8ZfOrEuapjscabRQZXGvLPo4KNCk8q36DQB4DRDhakn0E012x0ncwMjIzMXDMc8Pzf+DvJozxdHhgQSC+hUqupKUQ4ppfg8ijxPhABgexkMzqI5LdkYHoQM7bM6i6CzSg= 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 MWHPR11MB1741.namprd11.prod.outlook.com (2603:10b6:300:10d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 15:04:32 +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; Tue, 12 May 2020 15:04:32 +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 v2 01/17] staging: wfx: fix use of cpu_to_le32 instead of le32_to_cpu Date: Tue, 12 May 2020 17:03:58 +0200 Message-Id: <20200512150414.267198-2-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> References: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) 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 DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 15:04:30 +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: b02287c3-2bda-4962-42e9-08d7f685c684 X-MS-TrafficTypeDiagnostic: MWHPR11MB1741: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:595; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xQ6OvbYvP0pFhC6TgMyccESL2tdL0Ivzr+ZXzysgJcH0kqxP5ITAT3cexBeRFPu/OD/se+y5zyB/TQGtCtXuNGYUin0Uxjj+H/45gsfci7CEVZxXrefE18oALg4ax2h4dD6nbmdtL7u5QFWTf3Hh7FkLwV6NZfi3siDrdvf7WMCMghf7bAtMmMbVruRS2FnNzxwdhmcK82QW4E7AWy4QQbiM4EuYD/wUJVgKhlNKqe6pRUtD8Onw/25NgHv+RwLxvkgz4HtKhr1ctNyFIcFYBkjkRWMIFuBCPMmZ6UfKzgC+cgJvkPDorElQlA5VmL4qwhSTOI6/nfu3PmCdMJqC5V+79543kTjZjgQMMZyPuGgZg4PQauRY9YOqmdPlv7QZE/pZLcV344p9PcGbJTkugz7NKWIn/3k7jKeRaPT/fLGFDWVk7zyN84rrSLQt/yt8D3sg/t3ta/mEH+W1wyftChu0UAQrqwMra1owCIlpMaZpXmGBtHturRG4XXI3zijQPiAY37HylxFt/n/dq9o7uA== 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:(396003)(366004)(376002)(39860400002)(346002)(136003)(33430700001)(54906003)(107886003)(4744005)(478600001)(8676002)(5660300002)(316002)(1076003)(956004)(8936002)(2616005)(186003)(2906002)(7696005)(86362001)(4326008)(52116002)(6666004)(6486002)(66476007)(66574014)(26005)(66946007)(66556008)(33440700001)(16526019)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: N0TB7E3AILoSBOwuqxJEQk350MDZRhABZs4XdnLqIkEFYxzyHMtouQFlOFq4BnovWSqil9aXRuOcAfuMDmzcJxjbYY98VvY2lewn5k1FezZnEOEROPXo8BpeIlhRmHOW55VrTJDWL1bHbBNGnNOC1YS/TrkvB75rscxSjaaSb+QuUZr6PbB2EA1WMmB+8UMTN6qvEDpig0FzFtCaMzFSDojICzsUbbP/KeBgZB2bYCWydaaB3RmoZVIp2Ua3SsAwn9XXKEu7FmjMMg+H0JuAUSHn2O4xAE3ytkMsgTZxc/T8AsWvpWqTEPH8HO4/EUJIkaIuBuS6N4jiikVwzVN+dSXKnzNXcEAVr/1GPMYcNXIIvVXpEmhstEQBhrFLax4SgksBMHcj6bOXXS62jxDRPvAxrnmuDSaGPZ7t4xY3Wx8kPx2Kbxu3i9l5YRbeOPYzwCdDTPBYFd0fT9k5TESD372QEAhwVi5jmbMX6BQD7Is= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b02287c3-2bda-4962-42e9-08d7f685c684 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 15:04:32.0153 (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: +lpIHa+OS9mGijIMwbPfZUr92Ig42O0Ofp0kWg9iRLGUBY1iN9KAyADVT+gKjAjmTm2TGsuYY0g3RMLpKSCcDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1741 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Sparse detected that le32_to_cpu should be used instead of cpu_to_le32. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hwio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/hwio.c b/drivers/staging/wfx/hwio.c index d878cb3e84fc..777217cdf9a7 100644 --- a/drivers/staging/wfx/hwio.c +++ b/drivers/staging/wfx/hwio.c @@ -205,7 +205,7 @@ static int indirect_read32_locked(struct wfx_dev *wdev, int reg, return -ENOMEM; wdev->hwbus_ops->lock(wdev->hwbus_priv); ret = indirect_read(wdev, reg, addr, tmp, sizeof(u32)); - *val = cpu_to_le32(*tmp); + *val = le32_to_cpu(*tmp); _trace_io_ind_read32(reg, addr, *val); wdev->hwbus_ops->unlock(wdev->hwbus_priv); kfree(tmp); From patchwork Tue May 12 15:04:00 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: 219419 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, URIBL_BLOCKED, 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 B259AC54E8E for ; Tue, 12 May 2020 15:04:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8CECA206F5 for ; Tue, 12 May 2020 15:04: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="hB/J6sSM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730571AbgELPEo (ORCPT ); Tue, 12 May 2020 11:04:44 -0400 Received: from mail-bn8nam12on2076.outbound.protection.outlook.com ([40.107.237.76]:45896 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726168AbgELPEm (ORCPT ); Tue, 12 May 2020 11:04:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q1uTPTRVFFLZsmPcrFjICeqezdmk+fruoxrJB3A7A0JcEN78uCEVCuUvPzQ1OfBRpfjjW5+lI992qwclndpCPlKlT/zUkdjUwGqV8MLjXF7waUssMyf2D8uV3vhXws8r+6lNb97g3C8pYfp0yPqtrjwsKSk5auL2BHDxIAvcudGDi1uinvWWAQxmU/Wtfpia9KEoTprIIFP+ACTZTfmK4gBIsowh8nPMYv30/1wOZU9mCilLBXcoTPA9cFTsXQDpAzLs9reiuohmwJMJVIP77obSttV7SI6FGc618z30xXRvhgP8O/TPq1DVuA5PJYnxKuPFODnfHh8lVrO6X7MBOA== 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=Bmb3yU3vfAOpMfT02jKmw8s9KMikGGXSCwYZ2WRcgcxjoZ3F8I4uXeLrz/9yWVYgoT9c1Kvab2GrcpdZVBJP+sxAh6C+780Qheq7EGS+MtnW0N7im9JtJxZiC6VFDEmuI2mznSPr6RqgogOhLHoq9w+qXLqqBwyHd+GBQyq2osvc+k7iJaxl29bemOGFO9FGuwZLVC5UqCAE5SoRTsXebQX0Jsdh3sVLLiDHu6+FCFj1r7SJSJ4hYzBaGb11zDsS/QP332BNANVao7U+su+xpq4zjgJaeRtwFL7jxUyq+PpoUGNGgWQhS6EvzHqHi3qZK9W0XVTWg7im6PEoQMgLPw== 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=hB/J6sSMldzFn2MVNE3ynlJg8sI3CvFD9JFlU/OK5rS5BQZe6FEtcwCiCLoFl6VjqnSN3JVQt9kVOZQuhVSmcPXbq1hx7kDsHKKG+LLSeMh2xap5PWI54sypPNxbwzT9gd9iDdf3bDUKp9MshwedNv5CWJjEXap4nWe7w4Rpxcs= 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 MWHPR11MB1741.namprd11.prod.outlook.com (2603:10b6:300:10d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 15:04:36 +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; Tue, 12 May 2020 15:04:36 +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 v2 03/17] staging: wfx: fix cast operator Date: Tue, 12 May 2020 17:04:00 +0200 Message-Id: <20200512150414.267198-4-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> References: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) 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 DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 15:04:34 +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: e10a1d1f-b408-4211-7a95-08d7f685c8df X-MS-TrafficTypeDiagnostic: MWHPR11MB1741: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tXLOcj/bQMTnktDKehYZUgpdLXbtL/nG6Vm6rJJoTN6wvZIkMXKz2hX1SjhRyr6iUXiVdkKreItSn/cc/j7RQKNqziv5tT18GQMDCYznBhvkBg3JnvlSQXQywX42gXZujuUQL7Mx38qfnxPRatxWgd736ORuSCTnX8iouGFXNMRIQg8xhDIA9+QPz1XjcIj3plAFoepmyOGnBryBlJXBSNKVt7xqIGFIHI1NUUMfFktxxiyIXk4eldpVlrUGYwobGuVEUM47POWqnh/Tl1pBBIyazth8jYCdUVIeEh1UD4JFySWE8h69zfAqSgyy7ioPHYUC3UHLUre7nLfpmNM3I63abMtP4wEWCn1bHc6HgADGdm++N1ZJzQ21eltvVK4TWFvfl/P5kXDk0GaE1XdrePsURNYgi6J+LfVEd+Ugh/DAdFQZBwCiKX2dAogywLbxvwjUl3MtIYO6bQHQmsnAxyds2WADAWvwswNdQAXJnt8a3pa7bJ2FkVBESvwPBtQzCLUldbov+OokeFK6ByqTYQ== 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:(396003)(366004)(376002)(39860400002)(346002)(136003)(33430700001)(54906003)(107886003)(478600001)(8676002)(5660300002)(316002)(1076003)(956004)(8936002)(2616005)(186003)(2906002)(7696005)(86362001)(4326008)(52116002)(6666004)(6486002)(66476007)(26005)(66946007)(66556008)(33440700001)(16526019)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 16vecmAjvvi8H8PcGWpm3T0KJDThcyHoxtl8mwpvGXivZfmBeNtt1NAEZzunSg6v6+++5Az8XO5RfU9/chyoV1rlRyJ0olsmPiVcEe6zQ3sEdEMMrquRxFntG7YhvIBzhxnyOq99nuQ1vBhaU7SQz7T2k6hq6Wiv+cTfz3+v0gjZggziWDMIzroFF2Xs7gYnHTQYd/ttdtyMc1VBzCHummTnwWkbNOFkYacs/nRPCX0rVsYV7ULp25+0bzaqa4pZhPWmFqvRKzQKLrktfrNjegNyYLJn9Ds5HFPHRIWtMsF4c5Xjwe8DbyPELQXL5bTEu956EBeLuGF7vqHdpq6i4NAMSHHWP1dREaMIDm6nohOMFW1AsTfKtrGt0PLzSiiK9/h5T4m7ZZMSmlGnuHV62k9E139pXFWpwy4aYwk6y17gqwDg6yTcdeiw58F++z7eDL1wJ/bG8hk3cJxjQV9ikg/bzKvwI98akBXxhbI4O0g= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e10a1d1f-b408-4211-7a95-08d7f685c8df X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 15:04:35.9605 (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: L3UjiLyWrH7cGM21jmow/A+e4m27rNhHKPUBF4vNHtzJCNCuYbMmAhOD1h6t0NZl6JAvzPBrqD2EwxJ0bxpoDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1741 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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 Tue May 12 15:04:02 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: 219418 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, URIBL_BLOCKED, 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 A7DC6C54E8E for ; Tue, 12 May 2020 15:04:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86B56206F5 for ; Tue, 12 May 2020 15:04:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="jnUZVjAJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730617AbgELPEv (ORCPT ); Tue, 12 May 2020 11:04:51 -0400 Received: from mail-bn8nam12on2076.outbound.protection.outlook.com ([40.107.237.76]:45896 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726168AbgELPEs (ORCPT ); Tue, 12 May 2020 11:04:48 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aSdsgPOWEvufnSyxNmR8KkInYndb8xWZllP7sBz0Bjvb48NOCGMwO/QQhGn0LIHIxYTsZ6JZN4xT1cSwlHGd6u4uYqB5Zrkko4dkiPlfMMDQf3/HCO73BJppB9Y0bhzIoy2P6XyiP8c2Qj15Y/I04w/LHSmrxGj8VFAY6X4bOgjmJZvo7PakXP+yiSdVEnRAUdXmX5sO7afstdPW1C5o3B6ZI8SiVK2w3EqR5mmBnksLAAXlHbk6DqjZ3c3M+k+ZgTdDPlL35fIgB/ZoaIgpje5jmaYSmsL4/fxGVAJ91mRjMmjNI+3C05FD1RyajvHGZD5QE2HQ9Fr1xJMKY0WsfA== 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=AEXy55pmjEp6LuWI/5Y8hfjIGMAA70jo5RF8VvTo5Rx1UaYaDQNJNBDxIk2FUnyyfQ9Z0krRmd9gpRwtXabujmgUdC3g4GpKlZI8S1WRESloDC5/+iLgXRat8Vn5kdwDzSO4LeHpOjIMfC4HjVdPXS0k6eRIR4+19cTe2I51SiMaZ6ymqxgSJSuT5CMXXClw+YGCscXlgInRb/m0BkE8u16c0fQmBrqQNxXjJZQg3dzz/5wlQ+NWDEoEVDi3k66HFfemLaWiXBbdxUXE6/3wJix3X7QvE5WGqjJd9+z/GaZqCrO3DMzpfE+X8h3s4YbDbb2xAoE+1UNaO+zFt4YOzQ== 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=jnUZVjAJ9L8I6wRekqiptSLmQEihFhp9jZBxXgUP7IrQdmf1Kd9/eQPNThTbpJ/KUUUs0GYUEZ31JV7B2gzxgqT+nkui9TYR0G5qQYuQ0rnXW3XFYcbDFGwTgsHurDHTSRIIgE1ZkoUW8Z+NxRuzrnm2VH2KGsc9Xr1Cfdq+rrw= 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 MWHPR11MB1741.namprd11.prod.outlook.com (2603:10b6:300:10d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 15:04:40 +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; Tue, 12 May 2020 15:04:40 +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 v2 05/17] staging: wfx: fix output of rx_stats on big endian hosts Date: Tue, 12 May 2020 17:04:02 +0200 Message-Id: <20200512150414.267198-6-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> References: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) 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 DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 15:04:38 +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: d29f5e09-9661-4cd7-bb0b-08d7f685cb36 X-MS-TrafficTypeDiagnostic: MWHPR11MB1741: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:339; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8Sj7ehGfJwg1deZiPSLBLQqHPmkeVDIq99Fy2HXmoXTjN7U2R4+47HmOCEfLsWDO2i+qBKk4yLu3wDkIrfwq6jb3Ft2csPR7Jq8TN/u3Q9lXAv2gFMN2aUagLgFOzj9nk5EqCG7CmOx2mYW1Ep8UkCNE2qA4XizpzuUPyjH1vFCbFmSmdtbRWmg6uSqFGjUpPu5CLOKeF9Z9bVDNMa30PZsRnLoaWXdUAazLquklpNKW9b3nEQl9y3YRUt/6j+nWvEY86nj0Suj6fuxaG7kksanqysoYSSxMWKQihJGAMP+ygS79/2rGdyVv/VWfVFqDgU+Y+5Ef1iJ6GH2J28kdsNPXJIh7FR8tTIZpW6HCmAzvkV6DrRT2SS4QGp9jeZcuOFWdPfB5nb0QLe0eEBxpzwfMnQkstbboJpHwoal4AhpmjC6cbNIUWIsdfcxk1e3pY2mRt71JI4yB+wVb94KkVP5rLeBHrVMbWhbq0mRyKgeHw2XZB2Ke+GLskTC7LIdD3x1knom996y/buNxHaTXww== 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:(396003)(366004)(376002)(39860400002)(346002)(136003)(33430700001)(54906003)(107886003)(478600001)(8676002)(5660300002)(316002)(1076003)(956004)(8936002)(2616005)(186003)(2906002)(7696005)(86362001)(4326008)(52116002)(6666004)(6486002)(66476007)(66574014)(26005)(66946007)(66556008)(33440700001)(16526019)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 6ojtYiK/oD/v5MoaUzGYcTxON6cFloKwHwa+LbJPpFqNWHtCd/wVGf91RZwCo9LJa9KuvfbCAI8lmko/O3fTztSjJFkyik6PkjRPJ3Dkct1GMMX3Gwtr0YIZ19IHcOhSJHpnP3g2pyOkfi0nLVWKL7cOFQ3U6DkDeDA0L9esZJhW+t66EHyJFeDKET6srP62cdg51+Yeht5X0sIuPoF9Cc/oWpayKSMzmMx3/fuwJ0E+BCdLFNDkYV3/3oUUoLcKOfr3ACYzVDFs8Kb5YYiOukaVn/svRv8BlHTEfCiqwFn+230lKIuzaLSVNtpyJEmhE89fq3nJO15GFjUeN1KNIx7KO0kMZ4nJytTNWH0Rbahl/bWQd45pxLROpHJG2RDqKuto+9XU2KQ4fnJG2bjweoGLYDC+UyqBnDNXftMMFaGW90rWArmXXILzlVl1zbXTWo7zphCPKOnfoZfrB/zcXqZAEb9DnztZ7dA8F7pr2SM= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d29f5e09-9661-4cd7-bb0b-08d7f685cb36 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 15:04:39.8978 (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: ivdpbbHyLD4Brp5wqjyrN0veiql6iSk71NrQAg5BZYFVK1oNMZT96U+vKTRuzRQ9atSSbOrFvVCtfTCqXaqcCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1741 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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 Tue May 12 15:04:04 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: 219417 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, URIBL_BLOCKED, 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 540B5C54E91 for ; Tue, 12 May 2020 15:04:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A313206F5 for ; Tue, 12 May 2020 15:04:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="k1IHDT2U" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730679AbgELPE5 (ORCPT ); Tue, 12 May 2020 11:04:57 -0400 Received: from mail-bn8nam12on2076.outbound.protection.outlook.com ([40.107.237.76]:45896 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726168AbgELPEz (ORCPT ); Tue, 12 May 2020 11:04:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XLXZVWAgIXLIdYRRDDSUMKIhVAWX+zRn50sqmTf9SdEQ2I23ncEGf1+XbPU+G5jWEy1XZz7IoHeeVRfa2sQSre2FYwsDAvleI4Cg+PnxuS9bKthTZ9qNLjfWsoTr6y6rRbEn7dtvlq8iODxJg6GlFtfwXElqwZLX3Tta+48NSgQHaGG4WauldnCROHVKchAUdimvdCjfe094Pr0MhmD7oOwlO9L6CxW/lcODqGG94ivi0tRR/cEDS43/kAxtEwqewv1Po4ZM9g81G/3pk9gNBagVaAcszNzkmnJe36qPI8el4VCHt369oJNlGGhEysCHFve0jXUjijstHpoA1mM56w== 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=IhlCiF1XE9V+4Nm4TchjKd7aHlGrsZDyCHe00h5/zy2nDFIzbtJL8QW+Wfhb6+9ZW/lakL5WMbjk6QybwtBvh3jUaCWWI9Hu+V0EtBBWITcVAqjV7SZaJTwBx+TYVV5wQWCGzelS5xtK3D6UU+r/TzaLdhRQ9ZdytV9ne8l6RG1JRTpriEfiAZDdh1RYWrG5Q16hH10eLCP9sCZctEpQHlbEtLfVbJsjosgJP6pTb6GbFk91tjEDSFXuY5t8bM9jSV06GP0IRGjtKbseTeBz6ggMaIqpR9RGHFTxUtsmKvdwPZelUoX5E2LU5Y2VOF0moWKLBCTgNoACZVLhNqy1XQ== 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=k1IHDT2UPNe7u19ZRU1iqFM7Wk0by92nSWOkZLCRVKQIEhe9K2fsb8dcjiMP1LTCJaTfB2qaMzHAEJkhmBxlkYFAYR8FFYas1Y4skF8df1wX2CTXOemDrpy58zaix6GACisX5bPGhVxpgESpcS68pwQMqs+nnHRBu2bBlJXzayA= 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 MWHPR11MB1741.namprd11.prod.outlook.com (2603:10b6:300:10d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 15:04:43 +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; Tue, 12 May 2020 15:04:43 +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 v2 07/17] staging: wfx: fix endianness of hif_req_read_mib fields Date: Tue, 12 May 2020 17:04:04 +0200 Message-Id: <20200512150414.267198-8-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> References: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) 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 DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 15:04:42 +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: 6d3471dd-e5cb-423a-9340-08d7f685cd90 X-MS-TrafficTypeDiagnostic: MWHPR11MB1741: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:163; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 23JM8cFZsATlTyH0a7gl9NTvH+KmJBWJ3LEBlcrhBKnLarEDmLfuJ4XrwOZ3UdD8dHF1xz5wGjng68YMfl1CuCwEG4cpekMFb2A4QfwU7zO9yhG7Pr0jELmwB1cEa3pTT9P/MwVuWo10rkL5+lEFmsJzwom6EOYOJMBSIFJ1ktqWUEDlzHlMZjPt7egWdzE65rrBkXHpttryoWkQIhXANu81JGSdKiwBL+VZXZ//vzDVbJK72+V92ECGKdECL/FcYaj/bPvQuqXL5upHtfNCSY61FUD4HZTxzJ06qwWQD8XQWtN86YLWNcUuZjIdQpjimc9PQwQJHLBHkMG38fqGuq7Nx+Uw8WeL0oslDh6vjVbdt36djjHOX8O9iPnz+MQmBJrelGhb0c6DkoNoQWDlYblIoRW8JlWxUdP8fH9RElg/PUtRORXYUmpyD3ySlc/oImW8WGZVopSbPXKtprkq0XmLn2LBrdWFf5+9brS6VV3cLx4vQ6EMdJR3WHXNBq5SJrXt9mz7NaXr6C0890O2DA== 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:(396003)(366004)(376002)(39860400002)(346002)(136003)(33430700001)(54906003)(107886003)(478600001)(8676002)(5660300002)(316002)(1076003)(956004)(8936002)(2616005)(186003)(2906002)(7696005)(86362001)(4326008)(52116002)(6666004)(6486002)(66476007)(66574014)(26005)(66946007)(66556008)(33440700001)(16526019)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: LxoeSfxujjD3IgI2MFuj3skBJMDta5MIIBDKXLOFMfV4qzNx9fICtCwoKL6jl/OmWaMirj+CxQW3ZgzLeiAtLMOTQhy/dOxdu01Fc4TOqVvHsv21f5n2cNZcBDg0PIfJHOi/8SycdxboJJZIW9WkErECt/RBYNGc3OZ3gbocWkPeHvC1zNjC607XCtCvt+Ozmc6Y18dHaan+r7qYfiGjUU6H1FUw7cQ+Xfr356/Nc9s9fdExw9dRe3p178VNmjZqaCyr3P+YDeRwm1oGGn2R5JyABF/ynnGsiAVC7VkLFKIeBqcL2W4ESDxIbrn2B3RZnLAgMSrKdGndsCODAkKmU1eMP2XkRIh/CLDZr4naKISOagIitzm70VgqhVEPFAVRgP3+6MeeHausgtV0yCfA0djToO5+5tS/2m1q9OLy1bP1K+sThAwoFK06dxk2cDXD6wBlVMkqUTCqeKGZ4RT5Wwl0qFLLglSVH7ETl8kNIR0= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d3471dd-e5cb-423a-9340-08d7f685cd90 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 15:04:43.8171 (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: 5a1w6Mo3T/XtcexDj+oY6OlZ0sNwU8iu5yVcNcylgof7gsefr20cln+eYFwgsstWscL58FCTzE2sm3MLkG0qlQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1741 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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 Tue May 12 15:04:07 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: 219416 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, URIBL_BLOCKED, 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 EF8FAC54E90 for ; Tue, 12 May 2020 15:05:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CDD7B206F5 for ; Tue, 12 May 2020 15:05:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="AEnYhqK4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730734AbgELPFE (ORCPT ); Tue, 12 May 2020 11:05:04 -0400 Received: from mail-eopbgr770070.outbound.protection.outlook.com ([40.107.77.70]:42722 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730672AbgELPFD (ORCPT ); Tue, 12 May 2020 11:05:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jovbiyyYnjX5sfVYc+dEr//WQIl+JDGIA4gRPGTlX3hBxxeuJmoCDSqMPue18S60CNPnFJEEyMm/1hTyfOkF/pbS3cjyv68sRevYREY9Wd9H3b6B/MB/HXDBMh9Tt70WPUahzNZi40eYLP05sOeX1yujOuGGYVT9GeWwRHM81Zgk7GMdnKfsuxywyGhU8hDoaTVy6oaaeE5TlAZgdZHCMkNDwUOJRS9pvXnRSGKg6nHmchCsO0HnY504IaofEXOKMlaEkFzQ5vJDmeGsYsljMyzV6CZd3j7kFMme+HsFTm0rUcZfA7u+4zsltRw1Npy0wCIAdOrZt2TXJeKpWDposg== 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=NkzghTDCsqoKkN2RTocV98XMJiCXurzeGJcUFs2XUWs=; b=oI/DhH4fBt3A4e7oWC1BLu1KntnSyvisNHV7S63/qEtc+PZvdUGZFO6xAfovJcmlO2R31NoqvFlptbLemDJppAnFnQXQ2IUrR/zrk5xdEQ5rFt2BeUgIPQ1Qjm+80Sg36NQBuFtPVRM1qkgBwlCPdOXFSJSFxUHCU+S48voiuEtO33amXCtS/H6cz1J9nGVBSVSESkf0veNmN8pwvTsgRY6LwVgGLEw2+i9G+V30XpPvzNhJ61HFt4XcndQhdNDY2oUh3yD0NGF+DTZnYs0fae4/gGBFJ1EVMRpZBiHlvcOl1qd4SdTj7iQ5Vasxiz+cIgz8wwkRFl2AMmZZb7YHkw== 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=NkzghTDCsqoKkN2RTocV98XMJiCXurzeGJcUFs2XUWs=; b=AEnYhqK4DBGRg/uTwYAfuNtRJxLeTXExhSzx89YPt6RauDmLVwC+5UKzllQRMmfgyXzBBwGsidqxAFjHMVPJnMqzVDFbiKgQzympzmypD7tkWcU2PgeCT0XIpH85R+Rk/qmOJVWR1AGPt5je43zFegbrG8/9f68QGidf8AAbU10= 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 MWHPR11MB1741.namprd11.prod.outlook.com (2603:10b6:300:10d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 15:04:50 +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; Tue, 12 May 2020 15:04:49 +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 v2 10/17] staging: wfx: fix access to le32 attribute 'indication_type' Date: Tue, 12 May 2020 17:04:07 +0200 Message-Id: <20200512150414.267198-11-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> References: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) 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 DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 15:04:48 +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: 82900a7d-de16-4419-2c2b-08d7f685d119 X-MS-TrafficTypeDiagnostic: MWHPR11MB1741: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1850; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ykHRJvZi+fA41GeTeBJDXNuc/Aa55qljNtlGPKCfAjIWfpyihDrRa/9xaK6I7suWEn7pDFnlEIxsOP9OcaPsr5B50OcMQPPMj6Q6wlJ9bW1nYBIx0F0xgPcSTSfUtJiyxfPKuFK4LPd1wkAcUOI6BgyQKFNgS/QONiqjdwXV60yGOUwPw4DImkQ6sT4P2EYP9iNOPKNMtSZGjZhqXhPVMnBmyCN2Tui/NA1pVVDVGSlEsJ6ChOeFXkrGRQwP0AFkOtjzGZMzsPFUL9OPPEPfKoYX004rfhPCQN8s/hIFHfygpCxhGUQVJ/+ei0iVyqOwxAYVGRy69tAJbRtMAflIOksJrYDRK+qdiYyZ4570BQneWc4pPvjTmXyLUPhVJq4SGGkcTXvXOR3MBBX//8IxtbrVmL3xOd4DHoQJwWej1Qjm/Q15HyCK7CYnkNexRj/vu/oWwU+lZEP/heomhll3ewRhsDRQcHW6JRSWKrKE1RpKM3lyZO4xdm7Rex6zAZkBEZEv6D3npD4zVshD3DRuJg== 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:(396003)(366004)(376002)(39860400002)(346002)(136003)(33430700001)(54906003)(107886003)(478600001)(8676002)(5660300002)(316002)(1076003)(956004)(8936002)(2616005)(186003)(2906002)(7696005)(86362001)(4326008)(52116002)(6666004)(6486002)(66476007)(66574014)(26005)(66946007)(66556008)(33440700001)(16526019)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: P1hWNEBheIbnM4DdqREeXk8+XyWj911gwggpmE0k6HVf/8m5/FpqJ6UqMwUnB1+m9I4UhjZwz3D3lEnkEzOfVoPHMm8DKXZckVLXsg3Ud975MSKAlvtjv+UnFhSm/DBGMJDfj4pcP0992JHOdBGQx7VRrmAmIzV0gqnnBQReBLG3nDB3W3cHHEOBmT9Z7iHbf26iMmDDeycw68wQ8yZa9Yx/FIIZ5CyOqbkhp6IVZQ9ZXkcI4lKFeIqMobt1e6cHeEPwNGuxuCdjcyskkkfs8nNAlGJxZriXmJ7yI5TGNatsVv7YxOSe+w0kpdUIDD241bTdPa4vzgHfJOGH3rN/w16CaLAaahYjMkgtMs4wVg/le1/mvFg6KhN/aR2rH7lZ4LYTCYo/SCQS1QL8TOE5dyDqPiELOlMahyX2IbLIdcR3CNpip4MmtFUNQXNJZayIxjfltLzQQQxpYgCzBE+O6og2w//dmNMBV+mutKWbknE= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82900a7d-de16-4419-2c2b-08d7f685d119 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 15:04:49.8114 (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: f9RzM5UTtVWsTF2vJzOGXpMOmWDmH7R7Kq9Vi4FXKbbk74KmRhbpP+YJ3dVwfNkaO2ScoTN+R76JIRLmcPduAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1741 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The attribute indication_type 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 966315edbab8..fca9df620ad9 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -259,8 +259,9 @@ static int hif_generic_indication(struct wfx_dev *wdev, const struct hif_msg *hif, const void *buf) { const struct hif_ind_generic *body = buf; + int type = le32_to_cpu(body->indication_type); - switch (body->indication_type) { + switch (type) { case HIF_GENERIC_INDICATION_TYPE_RAW: return 0; case HIF_GENERIC_INDICATION_TYPE_STRING: @@ -278,9 +279,8 @@ static int hif_generic_indication(struct wfx_dev *wdev, mutex_unlock(&wdev->rx_stats_lock); return 0; default: - dev_err(wdev->dev, - "generic_indication: unknown indication type: %#.8x\n", - body->indication_type); + dev_err(wdev->dev, "generic_indication: unknown indication type: %#.8x\n", + type); return -EIO; } } From patchwork Tue May 12 15:04:08 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: 219413 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, URIBL_BLOCKED, 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 6551BC54E8D for ; Tue, 12 May 2020 15:05:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3066320673 for ; Tue, 12 May 2020 15:05:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="NR2NSMXO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730938AbgELPFp (ORCPT ); Tue, 12 May 2020 11:05:45 -0400 Received: from mail-eopbgr770070.outbound.protection.outlook.com ([40.107.77.70]:42722 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730239AbgELPFF (ORCPT ); Tue, 12 May 2020 11:05:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ltCaxKBxARH6ICDDkv9ENs56DCoCC9vZAoZUAbHAj/i0skp+cETRP1E2pjGs92eYHpQqsHjhG97xB+PR3GiNcqoQZDLn/CtHlZxDHhkLbEf8+N2EFBslPMzeIOEu9jXBSw9Uuyt2vWceyekddfQUAbuVo8xLRDqpDEXD2E7aIFDgPgIs0Y3iEfnWBsyiWC8MQi6U+pLnjIab9ZRGXUm54BAASyaUoT93Y9tASjg1RG44Fh8fZ/FrkzJ8Ay24klAJNaiqh8ELJZBHRKY4D6qIKXNMREk9E01fbGwBOiZ2NkKy4UFQqChUDr55xwALP3AnDOI0mj4HrbUFZgQQOZO/Pw== 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=F1qdTWeTm5AKpPlGIRToDrrDYmYNLV9ruzP+urPzr8GPuajzuGyLF7ItriWqwEpaMpdYqts78BLOfPgZKX+ZVIWN4czcei0duo7urt8rX17FNgN4ngbZ79rXgMfjUBgU8Qy6HJbcEaKVBUMy5qL1wJx7uBIVyJYj8jh+/MbxM1yDNN1wUT8gNTuS+C/jmt1qnYmWeFfUJwpvYivZi41Ykov41iufh2Ro6zaFPKcvanD9733a1ThVBTQMfNgycYNwBuUsKU/gsy+UJVSS1pTxXEQ+UYoQv4GYE2083fZT7qjud+Px2+0WLaj5JRe49yojEBr9ISrerqHG2SQs87vXzA== 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=NR2NSMXOEe9Y8QSdPocBJekAKOfmxvNg2qNedOfdpQRaX5MPTQ7Wo/G3fXud0DLaCtQSCv1ykBdjHDmTaTqgmt2KumUAXrDzYuHJw3KPbfRgg4DNraoF0CbqB+wHDw8LgwR+yXcy4E3oO024FdL9tU+eGQQn5WhgDZ0ZQi9qoaU= 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 MWHPR11MB1741.namprd11.prod.outlook.com (2603:10b6:300:10d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 15:04: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; Tue, 12 May 2020 15:04: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 v2 11/17] staging: wfx: declare the field 'packet_id' with native byte order Date: Tue, 12 May 2020 17:04:08 +0200 Message-Id: <20200512150414.267198-12-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> References: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) 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 DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 15:04:50 +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: 524598f1-a049-4321-a735-08d7f685d24c X-MS-TrafficTypeDiagnostic: MWHPR11MB1741: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9NG8OIc0qJZlNQo3gd/8+kmHBtAWmGeSdqn8K/h7HIjbjC7Yq4+8IY/vBFaGNo7bDOOJNQ9naAhg3o4bOr3BLcAiXIvsEDIzsqVnpxJt94qM87iCnKWiJQuUDZN3Jw0qCVpl6ASf4D6jtJKyhIQJUoUgZrTCdkw1uyB39I/51J2rn6i03TthBEWprcZ7ANmdBG+bd+pzghHeOwf4c+mQbwKHyET1BnaXC0cUPqLtys8bboxhknajqAaaj7SDC7DovIEdGxHzgOn7CE7ixFp15d0sclQg7QCLWy4TCPXRoVbFkjJE6bIxlNida2OVR3HWpk8HRCYKyb2m4ZfmuYssg3bg28wsYyHBfyV8NjuJjGICzXBhjv/izgsjqzDJzbZ8OnRd5f8ou72LPpo4MEob6vnC6sbS2zBbGSop/GYCC6b11TCx8hx+Ets1+7b4s03P/wQi+3atd0mogLpp0mpD5sMKdId0jd1cDkN/zOaxwxzTgPxBjTT/TIWoi23TkoVas5VCqIS3LkX/dCSgTayFng== 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:(396003)(366004)(376002)(39860400002)(346002)(136003)(33430700001)(54906003)(107886003)(478600001)(8676002)(5660300002)(316002)(1076003)(956004)(8936002)(2616005)(186003)(2906002)(7696005)(86362001)(4326008)(52116002)(6666004)(6486002)(66476007)(26005)(66946007)(66556008)(33440700001)(16526019)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: bRf0hvcre0zkpGwlQOGA2+6rbDE91KdRz1bzxnv4k2EJL2iuXPhqgXNdxaCTLiVEhry2O1hveDup9CKdM/jXLTH47Bo4tSoh0N64z62pJFLS1tdG2bOZjOafi0o+QHS6K/8rgHAT16iO5pLwYKdPMoT+P0TiMUub42x802prXIexmeAAR7YdOPkYY7kGZD5SrReSb2Am18gxJNzkEVjnRKJW6Q99Ciul46fOZfT82o3hpspq/AsY4YH7iW0om49X0yk3JmZ3w1eRS5hOhERaYWGx/TwvGNqEv/6a/ABg03r2cTTpRPGeoZJUIidLzXQltyxooc0nAHr0l6IxrzFXpnb5nKO1snsjtP4dPLNiciNo6LToxiIlXSeyToz2tavxto4wfqxQvV6NOUlE7Gb0QXZdRAj+peG+X/sgQKnTjMlmdr3G0XVUyAbKiUHeyF/aLHWV6Oh/2uup+p/YuMbKWznFZMtBhu6cpxV87LUA1RU= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 524598f1-a049-4321-a735-08d7f685d24c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 15:04:51.8085 (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: xLZp7P/zAQhsEiPCTDfbFQaKz+viDOgp985QsiQBz3940Q6SA21n2+7N/DmaW8U7FDsXVb2zyHDKKEg4k9UWzQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1741 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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 Tue May 12 15:04:09 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: 219415 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, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 AFBD2C54E8F for ; Tue, 12 May 2020 15:05:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84944206D6 for ; Tue, 12 May 2020 15:05: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="INYK03WZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730779AbgELPFI (ORCPT ); Tue, 12 May 2020 11:05:08 -0400 Received: from mail-eopbgr770072.outbound.protection.outlook.com ([40.107.77.72]:30085 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730725AbgELPFG (ORCPT ); Tue, 12 May 2020 11:05:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uh48uiQrLbQZ1Fzr8J4YPUoyiEPdS8ZpSbdmYmLiF8rqdp8EUs8Lw2O3ZQjT9C1HHgL7O2EGmlq8V7ntbOLYyHjc9/Puzu/KitJ70g2Q/hj6UBsqDZUfslczLspYAHoY+NUTtaqcqErUXeIHUQ0QWC6g4zI2dmTBb2Nh+26lMUBe0OE3z1aFb/qqiCgufcbTfhU1kUc2X+lAtnfA/QSr1SRufZioi5C6VMK2YLZDYydfUwKVGOKyVhuDK/PdQMLRxogoPCK6f0XdRzw/RobuwIc4tvn+mkKzr78DULwN3A7hHeQNNHCpORkTx0wonWyo5ueBCTu0FaVkUhxNS9k5jg== 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=OgPCU+I2uUL8q+EcnZFGnxhrdcqVJUaDfowLVV0SLgjNacYGpyogwcDJBTWRZPySDrWxaQBG3sJrAiFZDKBH5OcPFuS2f/caRM/tg9H0ZwJdL2AhgFHVGqAn24WupXOpPPVmZn9ieEoTgQPtVjZFJunz0OdWL1wXKN2+4kBUV533Bg1mn1p65mM5RLud/oGPDB6uklUF4h1FX3nlgrMiCHnyuRcKyCE5b/iJVlAGcpuISWO+jXeCSNUkjInfkbM1wGAXstCaBSZHjZ62Rva3iPep8h+O//g/wn8qiegHG16xRg9A+fRExNbHNsOmlasJrZRdVnP+ln8GEp7+fc7pSA== 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=INYK03WZcAy0/bM4cwu3LY6dtMQ+Pw97UY6bEDhGauoXzadCE1cMJ0fLcgTeHpOE/0DS9+zDLmOMW6wHlxXmFu4NOQdvpWXUC+aHKcTu0mMQ4QiiBjJMbBC+jxuFdOQAtVK4ehdz8zodXdNZ5Py0/vPnqrMB8bkjiUJ1W0dSPXk= 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 MWHPR11MB1741.namprd11.prod.outlook.com (2603:10b6:300:10d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 15:04:54 +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; Tue, 12 May 2020 15:04:53 +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 v2 12/17] staging: wfx: fix endianness of the struct hif_ind_startup Date: Tue, 12 May 2020 17:04:09 +0200 Message-Id: <20200512150414.267198-13-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> References: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) 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 DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 15:04:52 +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: edef80a4-18ea-4bb9-081d-08d7f685d383 X-MS-TrafficTypeDiagnostic: MWHPR11MB1741: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:248; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9eydh+TMdDIk4hfoUZvbZ+hM+2X7BxRvBsxF6jCSY5+OsD8gVfg+o3+42XfS32SyyQ6fd1Xq8oy1XNre6BRs4R7nGWrYE1TpqSpxQydaNRFS9sYG3T1442pRTJMvYYhytm9OpOsOL6+OGOrtX1qYUD9ChzCqTo1krdj+3dep/sl+oZ2kuX+Sk5prp7jwpn2AkIjzYDK1SE3zKRqBuLA4vyTiFTrM5uxMPdme4JCC+VpKKUEdCto8wb6/3mGh3TF5wC6aW5B8EzX2JsssLkoCmDXwQELhoAekytesfgSGwbrnVV2wC1EANu54mahTbihkd9AoDvBadHNMngvOtwhA4O+vECozWzxhwg/3hBEnYia2zjiQYMIArCoGQ8GRqlBpAFD7YWr252yv4a7vyDeIbPiHBkHiEd0uEnr+sDtvFFYCAQ+5ZTn3kWavYN7rTzKTDNeaPEGrnPwJMKDSvFN+rOPNKwikjtDUtlgULu3FdzTC2plHlFatLxxvxuUHu1N+Pg6Lez3J4ASlhsRj+hEEJQ== 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:(396003)(366004)(376002)(39860400002)(346002)(136003)(33430700001)(54906003)(107886003)(478600001)(8676002)(5660300002)(316002)(1076003)(956004)(8936002)(2616005)(186003)(2906002)(7696005)(86362001)(4326008)(52116002)(6666004)(6486002)(66476007)(66574014)(26005)(66946007)(66556008)(33440700001)(16526019)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: hB3EAaOvqNDraKH1AeGN6pJwba3Hlk5EvGt9fNrtBh9xNIrXlupDyuVrsQW126slTqFC/kpiX3vzZJ1txhVDGHJE3fhJqxtCSNaxAYShjyPOAvnDIARgSxREtCgl1GpmkMG/2GWa5DE+lD1RrYa4y7knBdB4ijReS9BCN3+D3qjywzzsxSsDBVBlwykQPlE+n4PWoHC6MbNyeWRgMA0DiU/xj4q3V4iNb7v5FifOkcPOyWj5c+i+OzfeKCM1KmsjU3g1zN3bx8v5zXOzrzT0eyT3E8IHvjR18KsRx2LkFxaZvMjASSJW2qMGEPvULMkVQc/Z6hH5D9RxxwaqJhHU98TktUVAKkgqjcFLO5K+fs2bCRcZBGl6qxXibYtWYCmtK5oNT1A46KlRPkwd7nZRtMKOvZZTDIHVjQtLdgdPMgC4E+elGpFIr/pEyqc/Qmo+8GeV9d+6fG5lj975453xyC6Bu6a2VwI2PhBQdWeg0MU= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: edef80a4-18ea-4bb9-081d-08d7f685d383 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 15:04:53.8066 (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: Mz5ey4WyEtTSpxQbmGeh370mE8CjwNKfvyvwwImNB6oDmR3GpN4LA0I/v+gh4pSyOhNWuTexag+ePr/Z4a2Acw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1741 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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 Tue May 12 15:04:12 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: 219414 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, URIBL_BLOCKED, 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 87649C54E4A for ; Tue, 12 May 2020 15:05:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A16620673 for ; Tue, 12 May 2020 15:05:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="GiDa4RAH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730823AbgELPFS (ORCPT ); Tue, 12 May 2020 11:05:18 -0400 Received: from mail-eopbgr770070.outbound.protection.outlook.com ([40.107.77.70]:42722 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730801AbgELPFL (ORCPT ); Tue, 12 May 2020 11:05:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mTQ+VSRA7NCDNemq4TMRRiF2vDQTvVq/HrJz+385vX+hSvsqU1HFAv4W9DJJiRGPYd9myQNpv6JfPoNprzz2f18/wvqfEvVUcUq5FKwTNpilQJmL4UtrhdaWueoQ8moHcDegEIWSsbfISAx39whTmYdfiJQV8bQAHfnr0GpCwDMXj6U6C/o55PMonNnRdq3a2rqo9QAx4AFo0qw5EzEnRAkc9AmA0RyQ4R6ieWjy43d1xdOPj0O5qy+QP77GXthnzbykFQxOM/5cAEPE0+e/+3ICJbEw3rYO3msd/VY36ZHiT49CY7WKy/I4kdx2faJUnWXMP1T54l5OOAMWy9XTQg== 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=pFy/vniKhrpxtq/YSZf0zFvIVPUCYROviEhpqdga+Vg=; b=S2ZIFcSHdNRAYzmnX/UayItW5Ktj4AVwYI7j5uNlgEjEuJSO1CPIjHg0apoigj5FqBDTSMf2fr4SgBJt5RX8cJmW6CbRyPkHdXVTIl8GeRoYdBKn+JDGajkS9vz17OSdiOuWXEnI7NiUU7tnIrMz0JlyoCRvWhrDAWpmvqoyxJJrgxdPAOyfv+uXpA2uHyqAHG1N2O/RjVdpamIPEBQ6YGQ6xMlKnzKQzj++Fx1YKAqqNudoaeDRU5VxTqr1LJP2CF74iV7VyeSR+0F3Dvtm5Nt7EsIreKTk8ZZuANYk3gSVKly4oio9XaV7aAyObBKpJFFR5m05nGcRNw6Fd7jntw== 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=pFy/vniKhrpxtq/YSZf0zFvIVPUCYROviEhpqdga+Vg=; b=GiDa4RAHlN4KvRMYJ7NOhmaXI0faXX+qkrADPxbfvufXSfmnICubywr6GIGxC+tzYJjG8n1J0Hs21+Qj0bIsHW7YO+yRT8YmGYrDTH5TNwbRmWAQDYiPJsV8+M6wGFEWKVu4pQMVgsyLtHgqDrFwf5JxMsc4VMjAQpFNJOLrMt8= 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 MWHPR11MB1741.namprd11.prod.outlook.com (2603:10b6:300:10d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.34; Tue, 12 May 2020 15:05:00 +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; Tue, 12 May 2020 15:05:00 +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 v2 15/17] staging: wfx: fix endianness of the field 'num_tx_confs' Date: Tue, 12 May 2020 17:04:12 +0200 Message-Id: <20200512150414.267198-16-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> References: <20200512150414.267198-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) 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 DM5PR1101CA0003.namprd11.prod.outlook.com (2603:10b6:4:4c::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 15:04:58 +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: 864b8fe5-38eb-4b56-8637-08d7f685d720 X-MS-TrafficTypeDiagnostic: MWHPR11MB1741: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-Forefront-PRVS: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RzI0REGWeXkaqz72sghLZsSqEeuf7YOhctLA7/iiIXi+HaWX5YKMwinCs8xhte/osk80MSVnij7FqvJvjd5pMGS/K1vjBEV802JDS2PmNI8Ip/lzmjuWoaVq182lAqCJd53NRJRkP71AgI6Wt+Ma9dt3CimGAquLgkq/XP+LzG007tQA6tmLIOH7KlWZERUjJuu42DX4wLODSUDPC4yKc30Fmjuu/H+kj8wg9DwUaBM4dAEFfFhm+EcozIhgA71C+cXj5f3RBeRwOR0NZmsqjtNZl3CdC/8cvc76h3eQK1NnG/K4CaH07o2nBG3YWRDA0JUTkQo4XVfUfgyXWEvoNY/EnS0sEgJqcNg0BXumdZK6CAuv/UNq2sQkcjYnDzyV8fugHqnE4s1s6jjFx7on4HeB036+xzGO/C67J+3/POt1ScTX6VBwsAWZYOQJooiVhngrjxoAwFijebUTuH610E+MP42ShF4Zy9+T7DgwG5+mY+9UNc/D2VqAeck59IzlKhqcoVFOBwUqdU/ObVICGw== 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:(396003)(366004)(376002)(39860400002)(346002)(136003)(33430700001)(54906003)(107886003)(478600001)(8676002)(5660300002)(316002)(1076003)(956004)(8936002)(2616005)(186003)(2906002)(7696005)(86362001)(4326008)(52116002)(6666004)(6486002)(66476007)(66574014)(26005)(66946007)(66556008)(33440700001)(16526019)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: YrVOBUfyVjsL+2CdBucnCal0dzs3j2B3YjjtRSNsZRBXrW+q/IT/hVkqfX3UUH2wWITzHgCHpR/Hv3dl8DaMP6GN/wz+/jbt+N57yr1m7oCufw0KgDgZzhtpz/hi+EyfLCKM0CGZWN/DbjhAkYYp6ZD9DDfHyQGkGmsFBigQPpm7w+R3QguJHS3oz8KkjL1t//XVdShDe8FwcAxVL4MEXI4ohj4dsu3df3gKFQDR0d9HqgUkA/kRecfdsLa0In+um8vcisBfnKhhX1o3f+m6YZj0nWB4vHBJrmKwlZMbDqFqc3WFHYpT7Ztesz7oVdz9ZdIOVTUSdHVWlDU8lKpBNzbJtDloByK+AEu45HLZDPS6spX+nBTlkPtgFFjLCV6ssKrUoWS0JZVXJUlxPQ4fHs1VyRk0otOhKkjI3UATbg1DCkW/TVJYD0+MA5K3+Msi/2QZPaxe7B0dR7YviHCUX5hdpWrLvnbQwQa11AqxZTY= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 864b8fe5-38eb-4b56-8637-08d7f685d720 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 15:04:59.9009 (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: OnahC/fjdeh1/HSztBFZovG7+WJuB4sUEFrz3VPJRnDh7pmmv0AlmQZqPqUI/NUWNXq98UN+j4XEe30qI79GXA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1741 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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 6c6e29cb7dcf..1cbaf8bb4fa3 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -102,7 +102,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;