[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <49EF5B05.6080402@mev.co.uk>
Date: Wed, 22 Apr 2009 18:59:33 +0100
From: Ian Abbott <abbotti@....co.uk>
To: Greg KH <greg@...ah.com>
CC: Roel Kluin <roel.kluin@...il.com>, Greg KH <gregkh@...e.de>,
lkml <linux-kernel@...r.kernel.org>,
Ian Abbott <ian.abbott@....co.uk>,
Frank Mori Hess <fmhess@...rs.sourceforge.net>,
David Schleef <ds@...leef.org>
Subject: Re: staging: comedi: non working tests on unsigned cmd->convert_arg
On 22/04/09 17:50, Greg KH wrote:
> On Tue, Apr 21, 2009 at 03:18:10PM +0200, Roel Kluin wrote:
>> 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?)
>
> I don't know. Let's ask the comedi developers :)
>
> Frank, what do you think about this?
Ian here. I'd just delete that 'if' statement entirely as the test is
never true and it is followed by another 'if' statement that tests the
maximum value.
The similar 'if' statements that test cmd->start_arg < 0, and
cmd->scan_begin_arg < 0 can also be removed.
>> 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@...il.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++;
>> }
That should be:
- if (cmd->convert_src == TRIG_EXT && cmd->convert_arg < 0) {
- cmd->convert_arg = 0;
- err++;
- }
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@....co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists