Re: [PATCH] staging: comedi: don't override read/write subdevice if not supported

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux