From patchwork Tue Aug 22 06:31:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mehta, Piyush" X-Patchwork-Id: 13360234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EA98EE4996 for ; Tue, 22 Aug 2023 06:32:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233035AbjHVGcb (ORCPT ); Tue, 22 Aug 2023 02:32:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233032AbjHVGca (ORCPT ); Tue, 22 Aug 2023 02:32:30 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2056.outbound.protection.outlook.com [40.107.237.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87E021A5; Mon, 21 Aug 2023 23:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aGxeLBEgWbX/ZOILZht1AW+c/WWI1j4aKQAFf0tZGAvPmDWSl///kbexFOwZp8Oiy7WgqM/wsLBB55AkR8qoXr4PgtLtu4KGxe0suMlE8WCsKrnUTmWPiHJPeD2Fmh0lnoWERD1/AIiimiNT//8otIf7toRFFmE1ZvteOmrG7/3PaIfIJYdZ8ftsdqhZ0eZHT7ev67ouFY2nzx6cDAfY8G452F0JG3bYtfIN8c3HBpsO6s0YaJdWSc87p36FtmRL4hiRme5wocYKKom43rwnffS6Uya64Wl1iz8gk4wCpyqZQGMUb9RDN1a0eCC1cS5cHkr4AcFNPK8D3Wyd5OANNg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=n0EQGJB9LSNPwfXG8wjfxhnxkoSQdYYPt3IqTh/iGPI=; b=P8DyF5zS4S/c54Zj3Jkn/0978Ccc/vB94ibrdFyl9BHwdCnhuly3N5kGQnhZ8oFJN1MdpTpdFk4RidE/5ZsF0MJpcXHLZZx9QMIU9VNSuqgorPBqDHQT5xdyhzqxI1SU07HuicbHtk9eeDdGmZjUc/X+ERj6z7sko4Bfsh1yyFAv1PCwREqbhvJmYcL45hTIzq1oPUKoYjJDjDnNaWFeFDc9bvvMNiR8s0id36vM/+uAsQ3cxtoPoCaq+7sgCBtj/wkMIjkg0z9ILW9C1xAfmot1lQq+9/g6oGz6uBP91v0SN7F6TalFd/xp0+wFz3cFGpbNbiaElUikr2R6p99X1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n0EQGJB9LSNPwfXG8wjfxhnxkoSQdYYPt3IqTh/iGPI=; b=EJ6d0/K0z2bDM2/AaG5qCEGF7iPJDQ02xWBricRjeSii0NC2uwHY9gB3O6R3eJjhjpRzpEly6ozqxKWhD3W4xOFqVJWQt0IIAxn4QrO0u2UUlr5Jlu/dlFk3YD3NPZR0KQe3KfAuQRFn6piRNbIU5aPBbozMrbq4CKZfDahXSXU= Received: from BY3PR04CA0018.namprd04.prod.outlook.com (2603:10b6:a03:217::23) by BL1PR12MB5364.namprd12.prod.outlook.com (2603:10b6:208:314::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 06:32:18 +0000 Received: from MWH0EPF000989E7.namprd02.prod.outlook.com (2603:10b6:a03:217:cafe::53) by BY3PR04CA0018.outlook.office365.com (2603:10b6:a03:217::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 06:32:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by MWH0EPF000989E7.mail.protection.outlook.com (10.167.241.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 06:32:17 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 22 Aug 2023 01:32:11 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 22 Aug 2023 01:32:11 -0500 Received: from xhdpiyushm40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Tue, 22 Aug 2023 01:32:08 -0500 From: Piyush Mehta To: , , , CC: , , , , Piyush Mehta Subject: [PATCH 1/3] usb: gadget: udc-xilinx: fix restricted __le16 degrades to integer warning Date: Tue, 22 Aug 2023 12:01:59 +0530 Message-ID: <20230822063201.16929-2-piyush.mehta@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230822063201.16929-1-piyush.mehta@amd.com> References: <20230822063201.16929-1-piyush.mehta@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000989E7:EE_|BL1PR12MB5364:EE_ X-MS-Office365-Filtering-Correlation-Id: af5c3c8e-f538-41be-8035-08dba2d987d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Zo8gIrjwYvpFwBROeWA4ab1mGRTMG8E8nR4ujGF0FKRoDlGJeX3uTwxe4WcNNEUbxkdhDAY2qvNo8bLD+U0XEUuaCA1FvpZYJW+5B5gLuV0F7xbB78LXe0KCh1/OJcdKd/QbGuNh6dkZtdqLTtLOT/WgOaACQzibemLZu0r4aZR5RRrxB09jS7Yj/rOQUrmTyP1OQCe7XNO86uYdQFpp0AOpIZ6FDn4VfISOVWnlECNPg7gM/R4PTFnr0a2e4RJKIyFKoCxeHB3DZpzdD5jrn5BJdduXRx5EEr2AkX6v6MWaS3TwlgASqYAS9q4q53AjBqDFmaWmy8nGCJcMWrrwBDKoatDO4FsCnv6rgy1cOzepGG370KFmdE0HYTf+lz6uP+pEA+oz2I4oYHve5J9PLdrLL7bhLvP5w1J3pEvlkgCXkzBzIKs70X3OXwS5N2mXpTENyR6B9TbixeLaVTRYd9hN/hddDSBX5melePDGEn4rw3rOK3wV/hvl0byFAVBz5OkpbOny9PvV45YEGhZ+J69ZDlvdtaK7ix6XHmD4Ji/l/OSAQvNG5p+V6Ge+fZNlct1cu+Uh1yiV7HHuGApL8LNvEcKe7gLfJk5nrKkrafg7hDSzQrHZ7GEiAEy+H3zoMiVVhLkcEGEqqR1MUPkpS7pVMqilLyD4WZWHcYLPvgNbU6gT9THw0ExoCiiRo3TxabOmM5ghJCX7cdLnWDpQlxZ/fjK0GjF3zR5Pinlm1MguMJjTLLiKoYKZwZZEYxxo X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(376002)(136003)(396003)(39860400002)(451199024)(82310400011)(186009)(1800799009)(46966006)(36840700001)(40470700004)(2906002)(40480700001)(83380400001)(5660300002)(44832011)(426003)(336012)(26005)(36860700001)(86362001)(47076005)(8676002)(2616005)(8936002)(4326008)(70206006)(316002)(70586007)(54906003)(110136005)(966005)(82740400003)(478600001)(356005)(81166007)(6666004)(36756003)(40460700003)(41300700001)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 06:32:17.2235 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af5c3c8e-f538-41be-8035-08dba2d987d6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000989E7.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5364 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org usb_ctrlrequest members wValue and wIndex are of type __le16, so to fix this warnings we are using le16_to_cpu() macros. Reported-by: kernel test robot Closes: https://lore.kernel.org/all/202209020044.CX2PfZzM-lkp@intel.com/ Signed-off-by: Piyush Mehta --- drivers/usb/gadget/udc/udc-xilinx.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c index a4a7b90a97e7..e6308414cd1f 100644 --- a/drivers/usb/gadget/udc/udc-xilinx.c +++ b/drivers/usb/gadget/udc/udc-xilinx.c @@ -1617,13 +1617,13 @@ static void xudc_getstatus(struct xusb_udc *udc) case USB_RECIP_INTERFACE: break; case USB_RECIP_ENDPOINT: - epnum = udc->setup.wIndex & USB_ENDPOINT_NUMBER_MASK; + epnum = le16_to_cpu(udc->setup.wIndex) & USB_ENDPOINT_NUMBER_MASK; if (epnum >= XUSB_MAX_ENDPOINTS) goto stall; target_ep = &udc->ep[epnum]; epcfgreg = udc->read_fn(udc->addr + target_ep->offset); halt = epcfgreg & XUSB_EP_CFG_STALL_MASK; - if (udc->setup.wIndex & USB_DIR_IN) { + if (le16_to_cpu(udc->setup.wIndex) & USB_DIR_IN) { if (!target_ep->is_in) goto stall; } else { @@ -1666,7 +1666,7 @@ static void xudc_set_clear_feature(struct xusb_udc *udc) switch (udc->setup.bRequestType) { case USB_RECIP_DEVICE: - switch (udc->setup.wValue) { + switch (le16_to_cpu(udc->setup.wValue)) { case USB_DEVICE_TEST_MODE: /* * The Test Mode will be executed @@ -1686,13 +1686,15 @@ static void xudc_set_clear_feature(struct xusb_udc *udc) break; case USB_RECIP_ENDPOINT: if (!udc->setup.wValue) { - endpoint = udc->setup.wIndex & USB_ENDPOINT_NUMBER_MASK; + endpoint = le16_to_cpu(udc->setup.wIndex) & + USB_ENDPOINT_NUMBER_MASK; if (endpoint >= XUSB_MAX_ENDPOINTS) { xudc_ep0_stall(udc); return; } target_ep = &udc->ep[endpoint]; - outinbit = udc->setup.wIndex & USB_ENDPOINT_DIR_MASK; + outinbit = le16_to_cpu(udc->setup.wIndex) & + USB_ENDPOINT_DIR_MASK; outinbit = outinbit >> 7; /* Make sure direction matches.*/ @@ -1869,7 +1871,7 @@ static void xudc_ep0_in(struct xusb_udc *udc) u16 count = 0; u16 length; u8 *ep0rambase; - u8 test_mode = udc->setup.wIndex >> 8; + u8 test_mode = le16_to_cpu(udc->setup.wIndex) >> 8; req = list_first_entry(&ep0->queue, struct xusb_req, queue); bytes_to_tx = req->usb_req.length - req->usb_req.actual; @@ -1880,12 +1882,12 @@ static void xudc_ep0_in(struct xusb_udc *udc) case USB_REQ_SET_ADDRESS: /* Set the address of the device.*/ udc->write_fn(udc->addr, XUSB_ADDRESS_OFFSET, - udc->setup.wValue); + le16_to_cpu(udc->setup.wValue)); break; case USB_REQ_SET_FEATURE: if (udc->setup.bRequestType == USB_RECIP_DEVICE) { - if (udc->setup.wValue == + if (le16_to_cpu(udc->setup.wValue) == USB_DEVICE_TEST_MODE) udc->write_fn(udc->addr, XUSB_TESTMODE_OFFSET, From patchwork Tue Aug 22 06:32:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mehta, Piyush" X-Patchwork-Id: 13360231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1F13EE4996 for ; Tue, 22 Aug 2023 06:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233027AbjHVGc3 (ORCPT ); Tue, 22 Aug 2023 02:32:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233019AbjHVGc1 (ORCPT ); Tue, 22 Aug 2023 02:32:27 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2067.outbound.protection.outlook.com [40.107.93.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 119BB1A3; Mon, 21 Aug 2023 23:32:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YXz7mclsaeg3GCvaCIbTawia804Dqyg+nk3mtfCW7U4sGkpylSPABmcx91sjFE8h6ygCBjhIVAeQfQcNlcYtbxxldyEe2YjZWBEUpjvQGWiGDRsccDCven/eprDiVvxVXTFt94uJBnAARjaonvXv7FG8ZlgKYNfxmrmfCFle29VHam/7C1SntVSn+glQRKgw5qS9seWI5SqoqeSXmeO2BIKLkHEiLFzW733/ZnQq+B0qeE7wKlx8KVAHIubR2hSRpaHhoL/ClRbl56nZwAOYGb+dDrByMCw3A9HfUIMLRpfcZdmate6V/aD0Xt3M2EaJC7Ab7gmmCoC26yF3Rb4GkA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EpPrHEE4ddnOxj+Nlc449tY6ETQWkegsX1lHKRzxeFQ=; b=X0TunI/tiwmI1VxKCzbSy58YbVDSNFdJTeIaRwxqGTwS4Gbvzb2EW9QKX2Ib3zha4cCW0nw+UCw94mrbYKVm13TnXVxVZualFWYFwPs0KAQOm/eFGGFANrKCRM1ZmvkEOUdflc5uWJpN0UugaFkJ+TcjkoQr9tiZK6l3hR/41klo0k9cRYnaMxdwlA8yvoXl84UMRO/uiPsSpivJsLSM/0bvLMHCykhHnvg+fean9h6fWWF4r2luZ5joK0TcwCc6+1FimINUwdDKYysbqkBNz+MtI+MXKs++iv8yz4XgnKwRjcnkYCNsp4t0AwRzG3TVaq4teHTvixp62iwSvJgXzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EpPrHEE4ddnOxj+Nlc449tY6ETQWkegsX1lHKRzxeFQ=; b=JignJ5O2rOInwQg8JRw0x2cycBDz7GoDdo7ssMCR99xWZPx6n8/HowbGBEKr+yoee6oPCCbNdEjwpxKn4WlSUAzlou8VpKildomfyXx0sPrLZVwdw/Oo2DSYP5rzA0xJJK5/4WSgMisBeEgtQGC1PdyB31oisfYdvbRXoIC24BU= Received: from SA1PR02CA0007.namprd02.prod.outlook.com (2603:10b6:806:2cf::18) by MN2PR12MB4408.namprd12.prod.outlook.com (2603:10b6:208:26c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 06:32:15 +0000 Received: from SN1PEPF00026367.namprd02.prod.outlook.com (2603:10b6:806:2cf:cafe::ef) by SA1PR02CA0007.outlook.office365.com (2603:10b6:806:2cf::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 06:32:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SN1PEPF00026367.mail.protection.outlook.com (10.167.241.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 06:32:15 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 22 Aug 2023 01:32:14 -0500 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 22 Aug 2023 01:32:14 -0500 Received: from xhdpiyushm40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Tue, 22 Aug 2023 01:32:11 -0500 From: Piyush Mehta To: , , , CC: , , , , Piyush Mehta Subject: [PATCH 2/3] usb: gadget: udc-xilinx: fix cast from restricted __le16 warning Date: Tue, 22 Aug 2023 12:02:00 +0530 Message-ID: <20230822063201.16929-3-piyush.mehta@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230822063201.16929-1-piyush.mehta@amd.com> References: <20230822063201.16929-1-piyush.mehta@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00026367:EE_|MN2PR12MB4408:EE_ X-MS-Office365-Filtering-Correlation-Id: 79f0ff23-bd98-4bb0-2d2f-08dba2d9868e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ObhCoT/HK7IockWRvPwE81SZwJDnaKUYsHkGAJs0rJx3ig6hp6koWnrfHsBj4HXZqoKi4ffpPR4FQ7KHUEPdsfIrST6TTUqOXlMQYCm3RBl5MDBtzVDf0ysCjikuPiTN/qObQnT5fuPOAE7AdkbnRrQ0Q82XTCqFcWQHMuAwihYTKu87ddzc6RUnuqib5p6KxIUTy9yrW+i84t1mT/0tOqc3DdS/NrX/itgtqBBMxQRm52QoZJ+1Atkt+rIcZbo7IHHd6UtFLrkWCX3vxXaSyYJDZFLVucbW6GmsHIycyfWEQb7D5R50GzQRJ3/w4qLvnPahBQ3816q63MasbG236c2SsgTytCunCsz6s3aMmeR7Z7GYXAwkPupjpYsl4tOlhy1/KjLZSKrAtrhb7/fM0fCqD+UIm+aMX1Aiq/oNJoP3YBn0oj8m23gCBlRnLHFXxye4g7ET5jgb/dhz3OHZSJkPBPGL3hkFsm4/2sLlGqRZZVjoozimzgA1WOWMHro5ZNuj/3NNBLZX0LJxVePa3jYy8LefA2NnyUOlT1q2mxt/lWH3mPHR0cZTf039pmKBaLh6dceNvZ1ZEvZawyVaqH8/J4nwp/GV9ippwfs1mr8rPGkq/QI/fceYcOERiapAyyiCo4tP4mBCic51scu0ZDJMH+DJol5CWTRk/T6rOtRVMfln5WwFGvhPi2BJfj1OnbGYjCcRYTBiH9f3kQaUsMolw7znImT/dOIxDGDAYYxtTkwR1zg//9yJ6pTTmJ3T+KgquP0AdwRrfZfcW/elqw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(396003)(39860400002)(136003)(451199024)(82310400011)(1800799009)(186009)(36840700001)(40470700004)(46966006)(2906002)(40480700001)(83380400001)(5660300002)(44832011)(336012)(426003)(26005)(86362001)(36860700001)(47076005)(8676002)(2616005)(8936002)(4326008)(70206006)(316002)(70586007)(54906003)(110136005)(966005)(478600001)(82740400003)(356005)(81166007)(6666004)(40460700003)(36756003)(41300700001)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 06:32:15.1499 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 79f0ff23-bd98-4bb0-2d2f-08dba2d9868e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00026367.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4408 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org usb_ctrlrequest member wValue, wLength and wIndex are of type __le16, conversion macro cpu_to_le16() input argument is __u16, so properly typecasted to fix the cast from restricted __le16 warning. Reported-by: kernel test robot Closes: https://lore.kernel.org/all/202209020044.CX2PfZzM-lkp@intel.com/ Signed-off-by: Piyush Mehta --- drivers/usb/gadget/udc/udc-xilinx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c index e6308414cd1f..476c0a8fc5e7 100644 --- a/drivers/usb/gadget/udc/udc-xilinx.c +++ b/drivers/usb/gadget/udc/udc-xilinx.c @@ -1757,9 +1757,9 @@ static void xudc_handle_setup(struct xusb_udc *udc) memcpy(&setup, ep0rambase, 8); udc->setup = setup; - udc->setup.wValue = cpu_to_le16(setup.wValue); - udc->setup.wIndex = cpu_to_le16(setup.wIndex); - udc->setup.wLength = cpu_to_le16(setup.wLength); + udc->setup.wValue = cpu_to_le16((u16 __force)setup.wValue); + udc->setup.wIndex = cpu_to_le16((u16 __force)setup.wIndex); + udc->setup.wLength = cpu_to_le16((u16 __force)setup.wLength); /* Clear previous requests */ xudc_nuke(ep0, -ECONNRESET); From patchwork Tue Aug 22 06:32:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mehta, Piyush" X-Patchwork-Id: 13360233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24F27EE49A5 for ; Tue, 22 Aug 2023 06:32:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233051AbjHVGcf (ORCPT ); Tue, 22 Aug 2023 02:32:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233033AbjHVGca (ORCPT ); Tue, 22 Aug 2023 02:32:30 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2064.outbound.protection.outlook.com [40.107.237.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87DBE1A4; Mon, 21 Aug 2023 23:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JBezX/+/9GQ9PbMSj2P3bq8WPexMmntmRglWXfDbLo2DX8e84SJ0s5pL85TYfHD797+tjGv8zjuBqRF8EMUIpZRD27VNxmzD2GR8XyE1O67/V3txHKgXX9A1AsBzbzwfsh8Hpfok43eMsFIL8fmu2WVpA31n9ZfQv7f+0gms350TMq6ZpyMJYYaQGULwG2QkIj4HqajjKB3BuIVAh2GpE2uH+aREJQ4Mcf2h4LVDbIhk9D8aqe/o2Pwk7VXH0SMO+u8TZF6MOQHRh07jd5lBGakhP62IFwflqYIHVcbxaosF6iCfWOktwpEx7b9gbW8f13MLX1+I50vsxpoBPpKMcA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=B3/luZGIP2yZkNSQosU26Zs3McFWtFDRsmMlXPnoZG4=; b=hiNmWMO0J0/bUvOXzEB7NbzmOl37UcKvPP3VAFn7UKT/b1vTQaSY5CZtO2qBhiLjlVAMjRNm6ZhlQf0MpUgNtMhPx9JOwMn5aVsRlBUMTRE0rCIo/bhChVjybfh0g8RKILy3F8XUcXng+TPE8xR3FnmtTOjpu07+scKpkQ2pnkM2m4qjetBI7ReGh21gUdzknOfOqu+4l3lXskXeQFB0d/5o/GdMqAujN8+i83QRBu+ef9K1R69ny9NP2/DSdrxZsQ4x4WTQDjFpg2L7C6XeOLDPI1JcE4xmMuatGUvFUGMQFomwQGfJiPs5srttwCKvkapnYq6a8B46Bkq5MQML3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B3/luZGIP2yZkNSQosU26Zs3McFWtFDRsmMlXPnoZG4=; b=O6W/fET4sb7rf60LE4iyDKy3rwTl5gIerInLGd7Ds55FME9Kr7bLmTD90EjV8gK1JeQsSft55H5m12rD7UnuhkgKJA5M4waB4p3C04Ws4zTbeqFU4+JuSg1EEAkOflQU2JYp4tM21SG+KomXqaRe/Dpo8sohry6awptvPTWzEVk= Received: from SA1P222CA0137.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:3c2::6) by MW4PR12MB8611.namprd12.prod.outlook.com (2603:10b6:303:1ed::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 06:32:18 +0000 Received: from SN1PEPF00026368.namprd02.prod.outlook.com (2603:10b6:806:3c2:cafe::e6) by SA1P222CA0137.outlook.office365.com (2603:10b6:806:3c2::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 06:32:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SN1PEPF00026368.mail.protection.outlook.com (10.167.241.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6699.14 via Frontend Transport; Tue, 22 Aug 2023 06:32:18 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 22 Aug 2023 01:32:17 -0500 Received: from xhdpiyushm40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Tue, 22 Aug 2023 01:32:14 -0500 From: Piyush Mehta To: , , , CC: , , , , Piyush Mehta Subject: [PATCH 3/3] usb: gadget: udc-xilinx: fix incorrect type in assignment warning Date: Tue, 22 Aug 2023 12:02:01 +0530 Message-ID: <20230822063201.16929-4-piyush.mehta@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230822063201.16929-1-piyush.mehta@amd.com> References: <20230822063201.16929-1-piyush.mehta@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF00026368:EE_|MW4PR12MB8611:EE_ X-MS-Office365-Filtering-Correlation-Id: b55912b8-f052-4630-d7fc-08dba2d9884c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pVd4Wu7glJ1URHRErvu/mbl+vih/A6VHmVyulLR3NWkopebWv278ZxwI73+f6Ljhm3VZ+vR2yIQuypf3ddpUDFb+dy9NSQzIiubmmPoL4TIn37/D1k5VPbLSN3kFwi2uYPU54xJSSFPcW1yZ/YYMJV3XHuwlS5wNC7ZZvbOXnuaMoipQY+ATQYBe66TIznjSvMhWw6eM2nAxyEI7apuwc5apq9RRJ7Ir3pccELHr5sY6qB31ttms03eoy4klt+DkDBtvgmYb8UdHNGPem0LKQCPqbk51zdgzTL9dsuU8u4OJtv2o92o2P92lytqtCK6M4oUSE/7J/iz2TElfmBQjQpjOJnc+VFKQNX7KnJZw5xbcZEPqnO9ELdWl0yBM+XdSFdqq7Ktq6pvOi1yHtXLVeiZ/KvUT+s998HuTnd9LL3MPUyJMcCpmAcUtWfrUUPS3Ai+cMYIb+P6BkHUcxxcBuaKodo+KqW7GVXs0U8CWVfiZcsgMmp3y2TxhLoppbMrS3SMbUmC6+/2U5Gt8gKiWWCAiMbRMh087Nab4WApEjZwGf6/grefrxkuoxLLaQ+jL62vmPy/a7eWUd5T+QxrmYb3JSoe170T1bHWtzhy7OxgrD27oUYz8mYq1S4bTH7H65Q+Eu05FGUOZxXYiPVBt89da79ENiRWDrCQiyCKNjm229NV5iFsFFWXVXdSCc12yLHIScIrnB4Yh5hwX8tqrt39OILMYTSbNFWMnjMDxutuHWFaaOwqXyIruzGElwPWuwrub3wXCXoG3WQIu5hPSBw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(376002)(346002)(396003)(39860400002)(136003)(451199024)(82310400011)(1800799009)(186009)(36840700001)(40470700004)(46966006)(2906002)(40480700001)(83380400001)(5660300002)(44832011)(336012)(426003)(26005)(86362001)(36860700001)(47076005)(8676002)(2616005)(8936002)(4326008)(70206006)(316002)(70586007)(54906003)(110136005)(966005)(478600001)(82740400003)(356005)(81166007)(6666004)(40460700003)(36756003)(41300700001)(1076003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 06:32:18.0616 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b55912b8-f052-4630-d7fc-08dba2d9884c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF00026368.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB8611 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The bitwise attribute is used by the sparse utility to make sure the variable is converted to the local processor type before other (unsafe) operations are performed on the variable. Fix the below sparse warnings type casted with __le16: warning: incorrect type in assignment (different base types) expected unsigned short [usertype] got restricted __le16 [usertype] Reported-by: kernel test robot Closes: https://lore.kernel.org/all/202209020044.CX2PfZzM-lkp@intel.com/ Signed-off-by: Piyush Mehta --- drivers/usb/gadget/udc/udc-xilinx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c index 476c0a8fc5e7..0b12155635d9 100644 --- a/drivers/usb/gadget/udc/udc-xilinx.c +++ b/drivers/usb/gadget/udc/udc-xilinx.c @@ -1638,7 +1638,7 @@ static void xudc_getstatus(struct xusb_udc *udc) } req->usb_req.length = 2; - *(u16 *)req->usb_req.buf = cpu_to_le16(status); + *(__le16 *)req->usb_req.buf = cpu_to_le16(status); ret = __xudc_ep0_queue(ep0, req); if (ret == 0) return;