bsps/powerpc/beatnik/irq/discovery_pic.c: Address type-limits warnings

This change was made to address GCC -Wtype-limits warnings.
In this case, the irq was unsigned and there was no need to
check it being <= 0.
This commit is contained in:
Joel Sherrill
2025-11-25 12:30:49 -06:00
committed by Gedare Bloom
parent 19cc585d2e
commit 3cf6df3cba

View File

@@ -212,10 +212,14 @@ static void discovery_dump_picregs(void)
static inline int
validIrqNo(rtems_irq_number irq)
{
return
irq >= BSP_PCI_IRQ_LOWEST_OFFSET
&& irq <= BSP_PCI_IRQ_MAX_OFFSET
&& ! (IMH_GPP_SUM & (1<<(irq-32)));
/*
* The GCC warning -Wtype-limits flagged that the
* (irq >= BSP_PCI_IRQ_LOWEST_OFFSET) * part of the expression
* was * not needed because irq is unsigned and
* BSP_PCI_IRQ_LOWEST_OFFSET is 0.
*/
return (irq <= BSP_PCI_IRQ_MAX_OFFSET
&& ! (IMH_GPP_SUM & (1<<(irq-32))));
}
/* return 0 if a given priority is outside the valid range */