Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1466982

[PATCH 6/7] USB-iowarrior: Delete unnecessary braces

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 6/7] USB-iowarrior: Delete unnecessary braces
Date 2016-08-21 16:10 +0200
Message-ID <s8BBL-1lk-3@gated-at.bofh.it> (permalink)
References <qEuGl-43C-5@gated-at.bofh.it> <s8Bs5-12P-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 21 Aug 2016 15:25:30 +0200

Do not use curly brackets at a few source code places
where a single statement should be sufficient.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/usb/misc/iowarrior.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index ffbbb74..132c8cf 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -227,10 +227,10 @@ static void iowarrior_write_callback(struct urb *urb)
 	/* sync/async unlink faults aren't errors */
 	if (status &&
 	    !(status == -ENOENT ||
-	      status == -ECONNRESET || status == -ESHUTDOWN)) {
+	      status == -ECONNRESET || status == -ESHUTDOWN))
 		dev_dbg(&dev->interface->dev,
 			"nonzero write bulk status received: %d\n", status);
-	}
+
 	/* free up our allocated buffer */
 	usb_free_coherent(urb->dev, urb->transfer_buffer_length,
 			  urb->transfer_buffer, urb->transfer_dma);
@@ -304,25 +304,21 @@ static ssize_t iowarrior_read(struct file *file, char __user *buffer,
 								      read_index
 								      (dev)) !=
 								  -1));
-				if (r) {
+				if (r)
 					//we were interrupted by a signal
 					return -ERESTART;
-				}
-				if (!dev->present) {
+				if (!dev->present)
 					//The device was unplugged
 					return -ENODEV;
-				}
-				if (read_idx == -1) {
+				if (read_idx == -1)
 					// Can this happen ???
 					return 0;
-				}
 			}
 		}
 
 		offset = read_idx * (dev->report_size + 1);
-		if (copy_to_user(buffer, dev->read_queue + offset, count)) {
+		if (copy_to_user(buffer, dev->read_queue + offset, count))
 			return -EFAULT;
-		}
 	} while (atomic_read(&dev->overflow_flag));
 
 	read_idx = ++read_idx == MAX_INTERRUPT_BUFFER ? 0 : read_idx;
@@ -475,9 +471,8 @@ static long iowarrior_ioctl(struct file *file, unsigned int cmd,
 	int io_res;		/* checks for bytes read/written and copy_to/from_user results */
 
 	dev = file->private_data;
-	if (dev == NULL) {
+	if (!dev)
 		return -ENODEV;
-	}
 
 	buffer = kzalloc(dev->report_size, GFP_KERNEL);
 	if (!buffer)
@@ -647,9 +642,8 @@ static int iowarrior_release(struct inode *inode, struct file *file)
 	int retval;
 
 	dev = file->private_data;
-	if (dev == NULL) {
+	if (!dev)
 		return -ENODEV;
-	}
 
 	dev_dbg(&dev->interface->dev, "minor %d\n", dev->minor);
 
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/7] USB-iowarrior: Fine-tuning for some function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-21 16:00 +0200
  [PATCH 3/7] USB-iowarrior: Delete an unnecessary initialisation in  iowarrior_release() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-21 16:00 +0200
  [PATCH 4/7] USB-iowarrior: Delete unnecessary initialisations in  iowarrior_open() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-21 16:10 +0200
  [PATCH 6/7] USB-iowarrior: Delete unnecessary braces SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-21 16:10 +0200
  [PATCH 7/7] USB-iowarrior: Apply another recommendation from  "checkpatch.pl" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-21 16:10 +0200
  [PATCH 5/7] USB-iowarrior: Delete unnecessary initialisations in  iowarrior_write() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-21 16:10 +0200

csiph-web