[PATCH 24/26] staging: comedi: comedi_fops: cleanup comedi_{read, write}_subdevice()

H Hartley Sweeten hsweeten at visionengravers.com
Wed Dec 19 22:44:46 UTC 2012


Flip the info->device tests so than the return NULL occurs last.

Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 drivers/staging/comedi/comedi_fops.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 33f5187..8d407cc 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -118,9 +118,9 @@ comedi_read_subdevice(const struct comedi_file_info *info)
 {
 	if (info->read_subdevice)
 		return info->read_subdevice;
-	if (info->device == NULL)
-		return NULL;
-	return info->device->read_subdev;
+	if (info->device)
+		return info->device->read_subdev;
+	return NULL;
 }
 
 static struct comedi_subdevice *
@@ -128,9 +128,9 @@ comedi_write_subdevice(const struct comedi_file_info *info)
 {
 	if (info->write_subdevice)
 		return info->write_subdevice;
-	if (info->device == NULL)
-		return NULL;
-	return info->device->write_subdev;
+	if (info->device)
+		return info->device->write_subdev;
+	return NULL;
 }
 
 static int resize_async_buffer(struct comedi_device *dev,
-- 
1.8.0




More information about the devel mailing list