Skip to content

Commit

Permalink
staging: comedi: fix signess bug
Browse files Browse the repository at this point in the history
ai_count and ao_counter are unsigned, check for < 0 doesn't make sense.
Cast them to int.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Vasiliy Kulikov authored and Greg Kroah-Hartman committed Sep 16, 2010
1 parent cae16a1 commit 2503a26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers/cb_pcidas64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/comedi/drivers/usbdux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2503a26

Please sign in to comment.