From patchwork Thu Aug 8 07:24:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radhey Shyam Pandey X-Patchwork-Id: 13757064 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0F83C52D73 for ; Thu, 8 Aug 2024 07:35:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Jyb5e5/xN7QuLeKEo4rp6jeGChO7rIXS8IooWVUYpM4=; b=Q5Fyu+xtR1YqjGBXNR0jicyrMq roIHsN/TJha56kDm8ZRmveYs0LM43bwYjcfBTX1/PrTQIZZZvreJXmAHYQvhbGVY6CdEfMrVNM3zl V1Vi4WAbbkv9kOmPGABdEhG0Czotvftm1talGyEFIB9TTndF24pzrDhWRMeFCioiXJ/BHe3lEdQYt hd9VduwOON8lgdLzOvtk2pQcJCTqsH0Jh+MQc4DNEapxoCa3UkGMOEXX/lWySjUOrCkt1XQFMCFF1 6Uf8pgi2NacX7Llj6K7dqXe7X+B/EMSdDCChnMrPvWroeLHCzPOVXBK3SHaY79zDEJOHZJToUcta4 cTAfJnCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbxgN-00000007RrL-46Tw; Thu, 08 Aug 2024 07:35:36 +0000 Received: from mail-bn8nam12on20600.outbound.protection.outlook.com ([2a01:111:f403:2418::600] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbxWQ-00000007Oop-0tmE for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 07:25:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QL1Os/+aaQvnfGenW6RkguDmlJm3rYN1XFgdFv4j2ldElIydftaZVD0FgWvBO4prt6Vw84GbdPkxr7mPvXQFerwBTr5wugLc2mPa1NmRQa6Kp/USP+Xw8y4JZRt5NxZ+SkZ3xkwzSFcgtyu9UHLtZtGzx2qDiDwJxBkc6Q1u2kskObpb4kfxft4h13DRkYYR18ESjqSNtUmKs+5uvTHMJtIvZ+HJVFuRRR2kBCJH3xKi3AOibhQwU+uk1r98/1u+HbmuBXh3irfBFHlPHKNX4WaoY/41biZAsltettw0oxXp+bh3Lhub/b4deeRonmix2Gxmkb/7lmU1Oj5sZUpHig== 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=Jyb5e5/xN7QuLeKEo4rp6jeGChO7rIXS8IooWVUYpM4=; b=gvEwVt26JIZqNlmZkCu0wHqIy4A3EX63TlLiEk+GeSQ+0BB/tCTcB1B/WVGxk/oH1eH/cEFw749sESNivcOOTQdFEgjXehP2Wv00clqyi9tw62OJGkbJ/7vUck+32Usg7w89bd8FDB3sXHY1B3o/7DrcvhjekUSHbhUwOItxMdWdrBtjmOytYptQYODOLqtzcU800hkstegD4pM4HtORxSUHzjAVPCSw0T/t7U2FXYPxrnVqE1I9ORAvJBIJZ8y1/+advrzDGlYYeO9DRDJY9EkjnFw8yhR91XQRK2zXGyFes4tYQ0237oUgsFoVaAdDRnW9SQCzplXXvuJIBYLTrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linutronix.de 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 (0) 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=Jyb5e5/xN7QuLeKEo4rp6jeGChO7rIXS8IooWVUYpM4=; b=A2KMu9QwsKriduMSOFu8tNQWN1lRGoCNDro77PwzliHRFGRZ/Zbov3bb2o5WPnxBiywKxTXUYfXEZJx8SMmQ2yrmqfIecfxwGuM3320cfKfmURiVLhVaxTbqPcYw2ZMROoMp1i0bqEOx+LU9jeI1/e2cC8W93WzfBY3RHFBIkwQ= Received: from MN2PR15CA0056.namprd15.prod.outlook.com (2603:10b6:208:237::25) by SJ2PR12MB8847.namprd12.prod.outlook.com (2603:10b6:a03:546::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19; Thu, 8 Aug 2024 07:24:58 +0000 Received: from BL6PEPF0001AB59.namprd02.prod.outlook.com (2603:10b6:208:237:cafe::90) by MN2PR15CA0056.outlook.office365.com (2603:10b6:208:237::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.14 via Frontend Transport; Thu, 8 Aug 2024 07:24:58 +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 BL6PEPF0001AB59.mail.protection.outlook.com (10.167.241.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Thu, 8 Aug 2024 07:24:58 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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.39; Thu, 8 Aug 2024 02:24:57 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 8 Aug 2024 02:24:57 -0500 Received: from xhdsswupstream.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Thu, 8 Aug 2024 02:24:55 -0500 From: Radhey Shyam Pandey To: , CC: , , , Radhey Shyam Pandey Subject: [PATCH] irqchip/xilinx: fix shift out of bounds warning Date: Thu, 8 Aug 2024 12:54:55 +0530 Message-ID: <1723101895-3470952-1-git-send-email-radhey.shyam.pandey@amd.com> X-Mailer: git-send-email 2.1.1 MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: radhey.shyam.pandey@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB59:EE_|SJ2PR12MB8847:EE_ X-MS-Office365-Filtering-Correlation-Id: 99731308-035a-4bcf-1e6e-08dcb77b352c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0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CaLlsq6XFk2OeFvlcNud7flSaaj1rqoRsHFlEe8f8wqiqT9y8aGjcEzKlvw2Ludg3lzjj26E7wN0zrg7p+GpXLS+RyPkzNMq/mRW0NgwBUzgO2KnYuGZvlXHcgflJfvWO/PM3Ec6TciszQ+3B2060GuE9zltZIy2n+RX7iY8cvwCfA8GuBot4oKVQV6Q5mMG7sM38ugflN+1r8ATXx3oTraNeL2z4e2LqHdxA4qe/hCrtfTvlmp0WZia9hYpozrb7Zqqdhi4nPjybAEW1eAg5KgYCMMjWg8gzV/u2C1n42XHBB6KeqxrmwItW4VLjDApW6gQ4Q4hJsLw7fdsfI8NPiTrZOo1g9cov8gM4MJ8z+iimJkAWEaYuFoUSauJzLPX47r23Xw+2Z2xxldPwVe/Gvc5sXi0BjDywuH5bBbEFeZKaZR67gOxmNpshoGr 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:(13230040)(1800799024)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2024 07:24:58.0087 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 99731308-035a-4bcf-1e6e-08dcb77b352c 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: BL6PEPF0001AB59.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8847 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_002518_266499_50F9DCD9 X-CRM114-Status: GOOD ( 11.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In case num_irq is 32 there is shift out of bound and result in false warning "irq-xilinx: mismatch in kind-of-intr param" . To fix it cast intr_mask to u64. It also fixes below shift out of bound warning reported by UBSAN. UBSAN: shift-out-of-bounds in irq-xilinx-intc.c:332:22 shift exponent 32 is too large for 32-bit type 'unsigned int' Fixes: d50466c90724 ("microblaze: intc: Refactor DT sanity check") Signed-off-by: Radhey Shyam Pandey --- drivers/irqchip/irq-xilinx-intc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 6a0e38264012809afa24113ee2162dc07f4ed22b diff --git a/drivers/irqchip/irq-xilinx-intc.c b/drivers/irqchip/irq-xilinx-intc.c index 238d3d344949..7e08714d507f 100644 --- a/drivers/irqchip/irq-xilinx-intc.c +++ b/drivers/irqchip/irq-xilinx-intc.c @@ -189,7 +189,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc, irqc->intr_mask = 0; } - if (irqc->intr_mask >> irqc->nr_irq) + if ((u64)irqc->intr_mask >> irqc->nr_irq) pr_warn("irq-xilinx: mismatch in kind-of-intr param\n"); pr_info("irq-xilinx: %pOF: num_irq=%d, edge=0x%x\n",