Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=916f11c760fc1c835d3fe10bebc97a02e2ac6b41
Commit:     916f11c760fc1c835d3fe10bebc97a02e2ac6b41
Parent:     a1e7e636fe9fff531a4fc42e65c8e8416fde5220
Author:     Bjorn Helgaas <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:36:02 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:23 2007 -0700

    smsc-ircc2: tidy up module parameter checking
    
    To determine whether the user specified a module parameter, use some 
#defines
    instead of checking for bare magic numbers.
    
    Signed-off-by: Bjorn Helgaas <[EMAIL PROTECTED]>
    Cc: Keith Owens <[EMAIL PROTECTED]>
    Cc: Len Brown <[EMAIL PROTECTED]>
    Cc: Adam Belay <[EMAIL PROTECTED]>
    Cc: Matthieu CASTET <[EMAIL PROTECTED]>
    Cc: Jean Tourrilhes <[EMAIL PROTECTED]>
    Cc: Matthew Garrett <[EMAIL PROTECTED]>
    Cc: Ville Syrjala <[EMAIL PROTECTED]>
    Cc: Russell King <[EMAIL PROTECTED]>
    Cc: Samuel Ortiz <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/net/irda/smsc-ircc2.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index 198bf3b..1d24973 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -79,11 +79,13 @@ MODULE_AUTHOR("Daniele Peri <[EMAIL PROTECTED]>");
 MODULE_DESCRIPTION("SMC IrCC SIR/FIR controller driver");
 MODULE_LICENSE("GPL");
 
-static int ircc_dma = 255;
+#define DMA_INVAL 255
+static int ircc_dma = DMA_INVAL;
 module_param(ircc_dma, int, 0);
 MODULE_PARM_DESC(ircc_dma, "DMA channel");
 
-static int ircc_irq = 255;
+#define IRQ_INVAL 255
+static int ircc_irq = IRQ_INVAL;
 module_param(ircc_irq, int, 0);
 MODULE_PARM_DESC(ircc_irq, "IRQ line");
 
@@ -646,7 +648,7 @@ static void smsc_ircc_setup_io(struct smsc_ircc_cb *self,
        self->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 smsc_ircc_cb *self,
        } 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_subsystems(unsigned short ircc_cfg,
                                        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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to