[PATCH 19/28] staging: comedi: rti800: tidy up CR_{CHAN,RANGE} usage

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

 



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@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/rti800.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/rti800.c b/drivers/staging/comedi/drivers/rti800.c
index 04ba9e6..30d7245 100644
--- a/drivers/staging/comedi/drivers/rti800.c
+++ b/drivers/staging/comedi/drivers/rti800.c
@@ -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];
-- 
1.8.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux