linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>, michal.simek@amd.com
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, git@amd.com,
	Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Subject: Re: [PATCH] irqchip/xilinx: fix shift out of bounds warning
Date: Thu, 08 Aug 2024 16:57:50 +0200	[thread overview]
Message-ID: <87frrfyscx.ffs@tglx> (raw)
In-Reply-To: <1723101895-3470952-1-git-send-email-radhey.shyam.pandey@amd.com>

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


      reply	other threads:[~2024-08-08 14:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08  7:24 [PATCH] irqchip/xilinx: fix shift out of bounds warning Radhey Shyam Pandey
2024-08-08 14:57 ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87frrfyscx.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=git@amd.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=radhey.shyam.pandey@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).