sparclinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-6.3-rc1/arch/sparc/kernel/pcic.c:768: possible problem with shift values ?
@ 2023-03-08  9:13 David Binderman
  0 siblings, 0 replies; only message in thread
From: David Binderman @ 2023-03-08  9:13 UTC (permalink / raw)
  To: David Miller, sparclinux, Linux Kernel Mailing List

Hello there,

The source code is

static inline unsigned long get_irqmask(int irq_nr) 
{
    return 1 << irq_nr;
}

That's only going to work correctly for irq_nr < 32. 
If irq_nr gets >= 32, that will wrap around. 
Perhaps the programmer intended

static inline unsigned long get_irqmask(int irq_nr) 
{
    return 1UL << irq_nr;
}

Regards

David Binderman


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-08  9:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08  9:13 linux-6.3-rc1/arch/sparc/kernel/pcic.c:768: possible problem with shift values ? David Binderman

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).