From mboxrd@z Thu Jan 1 00:00:00 1970 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 C7A0BC3DA4A for ; Thu, 8 Aug 2024 14:58:43 +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:References:In-Reply-To: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:List-Owner; bh=rcU8jHNp+0iq+RbsEV6EN3ntmm5cSHAiATW/SrWGmEQ=; b=Dvh1JKMxCCfnqxQKTkPWHjftcL GHjUBoKerINdVil5lkHUZDCFx5imSqhLsKF23fVRTMLaLMvn31qRTvdpl0yNtQ2+Zl5kOPPB8+H4E DakP9aJhPg+G/NxKelOrx6tOaAp9/ZMcYJRVlxJ69qKBKDPfMZI7WhtKWzon1tILMbo/m+U59CAG3 4osLJ3oUKMyfKx/meD2iGJBra0O7fF8s1ncDYvoEgM1ln0bOAY/5gdZX0fAoy0DN3eFWEGlvnCt1C ZxW5Ow34KMzPG15rkSQVO+nEbmZE5+yVKT4xCsz7W2pWv7Mot6kJYcMSYtocFy+4M/gz1ZfP/cz5r cKpmgjmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc4b1-00000008dp2-0ySO; Thu, 08 Aug 2024 14:58:31 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc4aO-00000008dbW-1OmE for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 14:57:55 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1723129070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rcU8jHNp+0iq+RbsEV6EN3ntmm5cSHAiATW/SrWGmEQ=; b=R/6v9ohBbuRdP3zwMnO/cZvKQKW3izWBpmlfacSfMedeDL+wEXg57vlzsjn8AuiTGRQMIa s7g/NNiArIJW5eMfLj3k75deqAdDi0dTzZjA5vH8JX3c0abT1ePEYcMFybS5v0WIS1Tnhn pXysLIykRPCAo1ewNYnNZRV04rSxex1i7XQMjEpjTK8rZNLMbGspvkVwxzIr4EcnGKVmMl CcYrQ27+4JgiI3+7WSpI+6JF4bcDNzddKQGgC9fArTSmTC5paeDuMMEAKkTPhgVWTy8JCY YwTPqCKwY+QsbFeIcLT178daUHq/2vKxOszy1a5dwUQC4Z51hIqwOXCYDLnBIg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1723129070; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rcU8jHNp+0iq+RbsEV6EN3ntmm5cSHAiATW/SrWGmEQ=; b=1AcCE30fL2txXoTbcNJs1x2KaLfEwHcspQcbNxVbz0BcdKOUdh78hrQxMFTwC25hz2aZk6 GsuzW+ATyahrKoDw== To: Radhey Shyam Pandey , michal.simek@amd.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, git@amd.com, Radhey Shyam Pandey Subject: Re: [PATCH] irqchip/xilinx: fix shift out of bounds warning In-Reply-To: <1723101895-3470952-1-git-send-email-radhey.shyam.pandey@amd.com> References: <1723101895-3470952-1-git-send-email-radhey.shyam.pandey@amd.com> Date: Thu, 08 Aug 2024 16:57:50 +0200 Message-ID: <87frrfyscx.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_075752_531455_A70E87BF X-CRM114-Status: GOOD ( 11.67 ) 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 On Thu, Aug 08 2024 at 12:54, Radhey Shyam Pandey wrote: irqchip/xilinx: fix shift out of bounds warning Please start the sentence after the colon with an upper case letter. Also you can't fix a out of bound warning. You can fix the code which causes the warning > In case num_irq is 32 there is shift out of bound and result in false What is num_irq? This is text and not subject to random acronyms. https://www.kernel.org/doc/html/latest/process/maintainer-tip.html > 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' Something like this: irqchip/xilinx: Fix shift out of bounds The device tree property 'xlnx,kind-of-intr' is sanity checked that the bitmask contains only set bits which are in the range of the number of interrupts supported by the controller. The check is done by shifting the mask right by the number of supported interrupts and checking the result for zero. The data type of the mask is u32 and the number of supported interrupts is up to 32. In case of 32 interrupt the shift is out of bounds, resulting in a mismatch warning. The out of bounds condition was also caught by UBSAN. Fix it by promoting the mask to u64 for the test. Hmm? Thanks, tglx