All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: Greg KH <gregkh@suse.de>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: staging: comedi: non working tests on unsigned cmd->convert_arg
Date: Tue, 21 Apr 2009 15:18:10 +0200	[thread overview]
Message-ID: <49EDC792.60100@gmail.com> (raw)

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++;
 	}

             reply	other threads:[~2009-04-21 13:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-21 13:18 Roel Kluin [this message]
2009-04-21 13:22 ` staging: comedi: non working tests on unsigned cmd->convert_arg 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49EDC792.60100@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.