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]

 



On 2013-01-29 13:17, 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.

That is probably my imagination because after a quick check I can't seem to find a compiler that actually issues such a warning, but still a force of habit. I'll change it. ;)

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
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