From patchwork Tue Jan 14 10:28:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13938595 Received: from PA4PR04CU001.outbound.protection.outlook.com (mail-francecentralazon11013053.outbound.protection.outlook.com [40.107.162.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82BBE1ADC60 for ; Tue, 14 Jan 2025 10:27:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.162.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736850465; cv=fail; b=mWdw49bL6e915jn3O2pqtGyawGMJPGoFh7jFTbUguTTTmuO9Es3W+p86GBFR54ilQxSmbNEpBIISGNJ2OM9u4mVlFNuF8lFEms0xpW+B7JwHyxQMCnEX2La+qTq3S7AhLMwZ4O8nf56dpPLb6qOnkl10X0b2AWQcKF4FdqcLWD0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736850465; c=relaxed/simple; bh=jhsKl5p08Vt9lk13TIk+sOyxLPv5TbZUR8cAGPA4RUw=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=E/gI+Wi2usahR+/KxQFRBYwicGqB0uOruKuEZFzcHSsDdxVfBodoT30WxrqX3SORsf7dbgiXs5FNLeFj+Ko1Y/S7mWDUMOKw858MNs5JyO+oWUhCxfCcy0xnu+yHVPH3fNmXHnB8w1gEEaYIxQyKXalRMrSLV0d9xWZ/Xd8r2RY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=fRqbeDiL; arc=fail smtp.client-ip=40.107.162.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="fRqbeDiL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=em7vilHWJlNV6iYN6McB/o0XEKKwut5nNd7ZgCr9+Cbnhbl+4OmYWKCmYrJGIms9M/Zxws64GzeAKGR9TSkNhMLzAKfZQEHwtS5b/E3+umRXxcZCU17VjgrSbyXBNDIYG20mYAGlBT/2hkCNOUJEJQ4VLqNC1zAOzIM34NkaKTfSC104KSlpJG7Rsom2Y3ixAhiWjyklZXY+WHHarjG/P0Ulgpxe7SIdPGzzHW4x5fA0TMBSXANJcxL/ValUq4q28T+H10EsFNvtl+MuuhoWBEd24qWyzXnL1+LqsbvQQ3LGjYKNTJlqZ9r2qbG8qmmqJKQ+P07rwo+hcf21civVBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=CqeEeYQpMhrJuNEY+9Ijt+waCNxeE3JV2CAF0R8VKDk=; b=cQGBBbS0+qo1Yvt99TMhYVfTmzvxPVqdU4pbrXIIwmVWHu2XtRXX6v4pGbriLpDLWocB+Tj22MHgBMHSPNK70WKM0tMqBlY7H10+kfxvwGgk+m0OR74xBc4fYvHtmEMyOvh5qCICcDAhOy/wLlnzI9z4DE/bWdyxPyvRvt2hA9Gqq85n3As7b/XngK+kdSX9eHn+Y8JpP7gk/aCpDDwMU7Y/VAZN6YreqnjaS/TPebb5oWPbUEBLdIoZ1KIEnQ1UltTwyaH4WwI/BuCwSXlrQcNWLBYQUttpNgmkTDpXAZUiVfmRn2O2bg77Wa53S5GkWddkEL8lkre0YrpLY05fYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CqeEeYQpMhrJuNEY+9Ijt+waCNxeE3JV2CAF0R8VKDk=; b=fRqbeDiLdYjLNAN4qFhlpFisg41pxOnR9DHzlSi3v5Rl8zGyvkcgjG6DOvxtx3JXZ9dw5X6lljUQvucOvjOmZLUsKS2D4YarFu+MoIPLOteXK02pIX+78yNCr1nDaSxCNtYPxGgmLz7KFpKF5bCr0fYvYfBWvs6EJioF4hZu12D/OdmNS4jhMYqvyZMxYp168COBROuFz7y/LpdWqeq1SsyvyOArHZJibc4peK+GBSd3NdcoeG8A8MVW4QkjicyZuBaf5WbtO3E6WEz/rLuORJAb652OnoCjWlh9u2EPe6lLrFGFCr6VxCyi5LZ5yb6SYUt07gnC2R7bJDikausB4w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by PA2PR04MB10185.eurprd04.prod.outlook.com (2603:10a6:102:401::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.17; Tue, 14 Jan 2025 10:27:40 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%7]) with mapi id 15.20.8335.017; Tue, 14 Jan 2025 10:27:39 +0000 From: Xu Yang To: heikki.krogerus@linux.intel.com, peter.chen@kernel.org, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, imx@lists.linux.dev, jun.li@nxp.com Subject: [PATCH] usb: chipidea: udc: initialize bounced_size to avoid coverity warning Date: Tue, 14 Jan 2025 18:28:15 +0800 Message-Id: <20250114102815.2311956-1-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2PR01CA0122.apcprd01.prod.exchangelabs.com (2603:1096:4:40::26) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|PA2PR04MB10185:EE_ X-MS-Office365-Filtering-Correlation-Id: 0663180a-6d2f-4133-8100-08dd34861252 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: sT693deM5G2S8IS4rTGlmlAYI9/SkXScAhiS6wPcd3Z3lcG9+rLamT4451LvTygouNIBvXMOCjvv5M0N04iLCsI6Z80XntBOKfcNoNJ4zyooxOQJBjyikz2u+W8p4Pao4716EnQCHOC3ka53CHexQABeToZMI3x1aFuUxQ4MlHBnmlyzZpgZh0DOL56Rq3mme4B5p2rPpEUZ5fm04bkZq6krQy6mjxg1ZduskcHaj/Sc8omO6nPzd1EugYQzHN6qX3OM+ClucUmWQorSo2DecmmenL9A2xctp3D4BWcwvzm51jPXHvLHipKlUgvtJnjBKF2vUCRl30bYe8TADuEmlN87A2G/s3rzDFVJwwMFaH9Y9efmQylbWXi5/3aX/VWm0p3ionHBFjym1njcyBimDUZ/nryjtNNeFu1QfNwEQMggygelWGL1zl2kLvvVAT0sB+i6glDl4Kj9Jn35scbFI1SzfBMBboUqtlFFjO67+mPXOsuH13sOBySM8swYmKJjfCj3T5y5BvfWDUmGXPfYhQYGE1EH01R/YvTSafFskewz5gOsNjQRP5s4EaiBKqbKUtKaHI/9/rWld8U2NDLqCBlZFq54JDrUR5ZBvp4gYDvtqOvGuz9b9KQEsYrwsAUMG/ZhTD78oOoHdDNdJHQ3jU2dK6VkNIvOYYwyF8hw6/2JDoMxyk6vx1wJLwwwmBCr5m/QxfToF2zEcLqBZ/E/0uHu7aQvewjw2jUUVqQ0oTvfLh+nnilP8U3MZvVbmrW16hwSrZq4f8bfjaztAtWrwBD2ebKGV5gc/1XiPFDDr0bgwqgE24bWx48gg8UuuKzw6VOH+hNWqzPHGmOfz8Gbwj/xuqnS1OrG+Ia9UVy0RFlIs7dH7x2D9+pGG1vAhEsYWV+LRAITngHdud1W3UnwJfhkeL+FnxXrYlSJGXnWqVRJevLjqx826eoAYiGEAWOUceOqvoJh/dOi4pIEkhemD9rvopMrSeMAQb7L7JZOBmawOB/GVwNMa4sW+bXUySFUB/W4apGELxJYjRcnIrqEkeBZiACNxnulHiY2cMvzD041F0mOR62pn6Ga97brDTvgnOGz8p3l/5i5YpfYIq401dY7G3SxM/C8x59s/ttgZKez+witDh7fmxerfuqhcjHxxuHvYNurTKJT7pPD2YRChaRQAiV7LbbbXmPDhoKZjnCdfx6BiqSzfp8yYxUJ/VQvqKi3lM9TDN5XZ0OzZ7OhN06lMnGxY40ymABwftpJ+zlsAqjJtU7ETpf3d2oy1lEYq14810dEtnMnmYeGIHwUVZQlMMl1OIxo3UqFNkxX2erU4k07ydT/YOMvt0joarEre5oaR1jpJod/BfMkdqZt2OTB6Yd6TU+byTndRkd9WuDDSAxXjpf2P63sr3Xx4rrbkqaQJBXaoV/ZgkmwdfzCG1pbun5/7gykxLrISbX+FH1cTfizg+robuty3ku2hOa4 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(52116014)(1800799024)(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iS7wwpDCfFqSUMI8OblG+Z7JwdzeDCuQ+mFUD7i0uF0a/FkOId2sbFC3SM1LY2W3mIGM5KeZVHPJdiIbQGN5/lpxQWAnpY62b1zfLcwuvhu27eaZJqJ75n36nuALlMd9hnhw/wBuj6ON73lK0YlsDyIKeUmZIw8q7sfYT/tPA7OsKEYmeuX2SlDyBnTv/N5ccUZACQz4zZG1JFND+rlyyng/iMT4+0t6a5mmAHXgJUY0jY3V5DNgQoCE0920RTXbXodRtoIduINkCBwvcXlMER0wLLEFLsnP7Z0F/RHLkKuCzX1+Cmsw2jc0axmFKO0DTLZAlFYXOBhmu7i2fiIHAhIKJYD+VAjc/J16vcl4OsyVt5o9/UORFdtLYsBqfXElkuA5HBlSn/CBvX/Wn53Hwn4QO+6w1nt+RuQRO6XS4cr2AGFsAvPEutecG1+F/DhEni2yE5pD4hPSX8BrtXtut8YimR4n1DxHEEwN9tlWarap/UB/dAP3XWMZJQkCCz4nyniyHPVKcR5cOX6xgWj0buTrS44U3Zui0OWzFiDdD9RWUINRvJBDZdBF9mpJjAdrdNLYq/HxMxCpU81L+3NPrn/ws0VBYpm15MaO4 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0663180a-6d2f-4133-8100-08dd34861252 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 10:27:39.8047 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: K5tJ7KsnjvxRrzunuRSNv8QXR/VhVXC26/dqD2MoTfMR8Wzq+MZgMpUdcF9UQEeuX70WgMOr3I2oi7eMGQOWwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA2PR04MB10185 The synopsys covertiy tool complains "Using uninitialized value bounced_size." at some condition. sg_dma_len(sg) = min(sg_dma_len(sg), bounced_size); ^~~~~~~~~~~~ Although it can't happen, try remove the warning by initializing it. Fixes: edfcc455c85c ("usb: chipidea: udc: create bounce buffer for problem sglist entries if possible") Cc: stable@vger.kernel.org Signed-off-by: Xu Yang --- drivers/usb/chipidea/udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 8a9b31fd5c89..8e496b7d940d 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -673,7 +673,7 @@ static int _hardware_enqueue(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq) struct ci_hdrc *ci = hwep->ci; int ret = 0; struct td_node *firstnode, *lastnode; - unsigned int bounced_size; + unsigned int bounced_size = 0; struct scatterlist *sg; /* don't queue twice */