All of lore.kernel.org
 help / color / mirror / Atom feed
* staging: comedi: non working tests on unsigned cmd->convert_arg
@ 2009-04-21 13:18 Roel Kluin
  2009-04-21 13:22 ` Roel Kluin
  2009-04-22 16:50 ` Greg KH
  0 siblings, 2 replies; 7+ messages in thread
From: Roel Kluin @ 2009-04-21 13:18 UTC (permalink / raw)
  To: Greg KH; +Cc: lkml

vi drivers/staging/comedi/comedi.h +342

and note that cmd->convert_arg in s626_ai_cmdtest() is unsigned. Should there
maybe be a test:

if (cmd->convert_src == TRIG_EXT && cmd->convert_arg > MAX)

(and what should MAX be then?)

Otherwise you may want to apply the cleanup patch below

Roel
------------------------------>8-------------8<---------------------------------
Remove redundant tests on unsigned

Signed-off-by: Roel Kluin <roel.kluin@gmail.com> 
---
diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 30dec9d..928c4c6 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -1906,7 +1906,7 @@ static int s626_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s
 		err++;
 	}
 
-	if (cmd->convert_src == TRIG_EXT && cmd->convert_arg < 0) {
+	if (cmd->convert_src == TRIG_EXT) {
 		cmd->convert_arg = 0;
 		err++;
 	}

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-04-23 10:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-21 13:18 staging: comedi: non working tests on unsigned cmd->convert_arg Roel Kluin
2009-04-21 13:22 ` Roel Kluin
2009-04-22 16:50 ` Greg KH
2009-04-22 17:59   ` Ian Abbott
     [not found]   ` <200904221411.13851.fmhess@speakeasy.net>
2009-04-23  2:08     ` Greg KH
2009-04-23 10:23       ` Roel Kluin
2009-04-23 10:53         ` Ian Abbott

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.