]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: rti800: tidy up CR_{CHAN,RANGE} usage
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 9 Apr 2013 01:19:41 +0000 (18:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Apr 2013 23:29:07 +0000 (16:29 -0700)
The insn->chanspec passed to the CR_{CHAN,RANGE} macros is an unsigned
int. For aesthetic reasons, put the result of the macros into an
unsigned int local var.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/rti800.c

index 04ba9e69b00a2f5a92bb7cf60e9190f47efca080..30d7245b6baec2f42c6144731cf094e3b56920b7 100644 (file)
@@ -169,10 +169,10 @@ static int rti800_ai_insn_read(struct comedi_device *dev,
                               struct comedi_insn *insn, unsigned int *data)
 {
        struct rti800_private *devpriv = dev->private;
+       unsigned int chan = CR_CHAN(insn->chanspec);
+       unsigned int gain = CR_RANGE(insn->chanspec);
        int i, t;
        int status;
-       int chan = CR_CHAN(insn->chanspec);
-       unsigned gain = CR_RANGE(insn->chanspec);
        unsigned muxgain_bits;
 
        inb(dev->iobase + RTI800_ADCHI);
@@ -223,7 +223,7 @@ static int rti800_ao_insn_read(struct comedi_device *dev,
                               unsigned int *data)
 {
        struct rti800_private *devpriv = dev->private;
-       int chan = CR_CHAN(insn->chanspec);
+       unsigned int chan = CR_CHAN(insn->chanspec);
        int i;
 
        for (i = 0; i < insn->n; i++)
@@ -238,7 +238,7 @@ static int rti800_ao_insn_write(struct comedi_device *dev,
                                unsigned int *data)
 {
        struct rti800_private *devpriv = dev->private;
-       int chan = CR_CHAN(insn->chanspec);
+       unsigned int chan = CR_CHAN(insn->chanspec);
        int reg_lo = chan ? RTI800_DAC1LO : RTI800_DAC0LO;
        int reg_hi = chan ? RTI800_DAC1HI : RTI800_DAC0HI;
        int val = devpriv->ao_readback[chan];