linux-6.3-rc1/arch/sparc/kernel/pcic.c:768: possible problem with shift values ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux