lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 21 Aug 2016 16:06:22 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-usb@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Josh Boyer <jwboyer@...oraproject.org>,
        Wolfram Sang <wsa-dev@...g-engineering.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org,
        Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 7/7] USB-iowarrior: Apply another recommendation from
 "checkpatch.pl"

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

The script "checkpatch.pl" can point out that assignments should usually
not be performed within condition checks.
Thus move the assignments for two local variables to separate statements.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/usb/misc/iowarrior.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 132c8cf..78b5d65 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -292,7 +292,8 @@ static ssize_t iowarrior_read(struct file *file, char __user *buffer,
 	/* repeat until no buffer overrun in callback handler occur */
 	do {
 		atomic_set(&dev->overflow_flag, 0);
-		if ((read_idx = read_index(dev)) == -1) {
+		read_idx = read_index(dev);
+		if (read_idx == -1) {
 			/* queue empty */
 			if (file->f_flags & O_NONBLOCK)
 				return -EAGAIN;
@@ -616,7 +617,8 @@ static int iowarrior_open(struct inode *inode, struct file *file)
 	}
 
 	/* setup interrupt handler for receiving values */
-	if ((retval = usb_submit_urb(dev->int_in_urb, GFP_KERNEL)) < 0) {
+	retval = usb_submit_urb(dev->int_in_urb, GFP_KERNEL);
+	if (retval < 0) {
 		dev_err(&interface->dev, "Error %d while submitting URB\n", retval);
 		retval = -EFAULT;
 		goto out;
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ