Skip to contentSkip to conversation

staging: comedi: fix signess bug

PATCH New Vasiliy Kulikov 1 participant 1 message Sep 12, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: comedi: fix signess bug

ai_count and ao_counter are unsigned, check for < 0 doesn't make sense. Cast them to int.

---
Compile tested.

 drivers/staging/comedi/drivers/cb_pcidas64.c |    2 +-
 drivers/staging/comedi/drivers/usbdux.c      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/cb_pcidas64.c +1 -1
index 9b1dd3c..2583e16 100644
@@ -3078,7 +3078,7 @@ static void handle_ai_interrupt(struct comedi_device *dev,
 			spin_unlock_irqrestore(&dev->spinlock, flags);
 	}
 	/*  if we are have all the data, then quit */
-	if ((cmd->stop_src = TRIG_COUNT && priv(dev)->ai_count <= 0) ||
+	if ((cmd->stop_src = TRIG_COUNT && (int)priv(dev)->ai_count <= 0) ||
 	    (cmd->stop_src = TRIG_EXT && (status & ADC_STOP_BIT))) {
 		async->events |= COMEDI_CB_EOA;
 	}
drivers/staging/comedi/drivers/usbdux.c +1 -1
index 4b320b1..6131e2d 100644
@@ -649,7 +649,7 @@ static void usbduxsub_ao_IsocIrq(struct urb *urb)
 
 	/* normal operation: executing a command in this subdevice */
 	this_usbduxsub->ao_counter--;
-	if (this_usbduxsub->ao_counter <= 0) {
+	if ((int)this_usbduxsub->ao_counter <= 0) {
 		/* timer zero */
 		this_usbduxsub->ao_counter = this_usbduxsub->ao_timer;
 
Signature · 1 line
1.7.0.4