From: Bjorn Helgaas To determine whether the user specified a module parameter, use some #defines instead of checking for bare magic numbers. Signed-off-by: Bjorn Helgaas Cc: Keith Owens Cc: Len Brown Cc: Adam Belay Cc: Matthieu CASTET Cc: Jean Tourrilhes Cc: Matthew Garrett Cc: Ville Syrjala Cc: Russell King Cc: Samuel Ortiz Signed-off-by: Andrew Morton --- drivers/net/irda/smsc-ircc2.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff -puN drivers/net/irda/smsc-ircc2.c~smsc-ircc2-tidy-up-module-parameter-checking drivers/net/irda/smsc-ircc2.c --- a/drivers/net/irda/smsc-ircc2.c~smsc-ircc2-tidy-up-module-parameter-checking +++ a/drivers/net/irda/smsc-ircc2.c @@ -79,11 +79,13 @@ MODULE_AUTHOR("Daniele Peri io.fifo_size = SMSC_IRCC2_FIFO_SIZE; self->io.speed = SMSC_IRCC2_C_IRDA_FALLBACK_SPEED; - if (irq < 255) { + if (irq != IRQ_INVAL) { if (irq != chip_irq) IRDA_MESSAGE("%s, Overriding IRQ - chip says %d, using %d\n", driver_name, chip_irq, irq); @@ -654,7 +656,7 @@ static void smsc_ircc_setup_io(struct sm } else self->io.irq = chip_irq; - if (dma < 255) { + if (dma != DMA_INVAL) { if (dma != chip_dma) IRDA_MESSAGE("%s, Overriding DMA - chip says %d, using %d\n", driver_name, chip_dma, dma); @@ -2836,9 +2838,9 @@ static int __init smsc_ircc_preconfigure tmpconf.fir_io = ircc_fir; if (ircc_sir != 0) tmpconf.sir_io = ircc_sir; - if (ircc_dma != 0xff) + if (ircc_dma != DMA_INVAL) tmpconf.fir_dma = ircc_dma; - if (ircc_irq != 0xff) + if (ircc_irq != IRQ_INVAL) tmpconf.fir_irq = ircc_irq; IRDA_MESSAGE("Detected unconfigured %s SMSC IrDA chip, pre-configuring device.\n", conf->name); _