[PATCH] staging: comedi: don't override read/write subdevice if not supported
Bernd Porr
mail at berndporr.me.uk
Tue Jan 29 13:51:35 UTC 2013
> Force of habit because some compilers issue a warning when a bitwise
> operator is used in a context expecting a logical result.
indeed. Good point.
/Bernd
Ian Abbott wrote:
> On 2013-01-29 12:41, Dan Carpenter wrote:
>> On Tue, Jan 29, 2013 at 12:00:27PM +0000, Ian Abbott wrote:
>>> diff --git a/drivers/staging/comedi/comedi_fops.c
>>> b/drivers/staging/comedi/comedi_fops.c
>>> index b798e42..6bfaeef 100644
>>> --- a/drivers/staging/comedi/comedi_fops.c
>>> +++ b/drivers/staging/comedi/comedi_fops.c
>>> @@ -2358,8 +2358,10 @@ int comedi_alloc_subdevice_minor(struct
>>> comedi_device *dev,
>>> if (!info)
>>> return -ENOMEM;
>>> info->device = dev;
>>> - info->read_subdevice = s;
>>> - info->write_subdevice = s;
>>> + if ((s->subdev_flags & SDF_CMD_READ) != 0)
>>
>> This patch is fine but why add != 0 to if statements?
>
> Force of habit because some compilers issue a warning when a bitwise
> operator is used in a context expecting a logical result.
>
--
http://www.berndporr.me.uk
http://www.linux-usb-daq.co.uk
http://www.imdb.com/name/nm3293421/
+44 (0)7840 340069
More information about the devel
mailing list