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>] [day] [month] [year] [list]
Message-Id: <1403282991-19133-1-git-send-email-me@vincentheuken.com>
Date:	Fri, 20 Jun 2014 09:49:51 -0700
From:	Vincent Heuken <me@...centheuken.com>
To:	gregkh@...uxfoundation.org, thomas_75@...e-mail.net,
	himangi774@...il.com, paul.gortmaker@...driver.com,
	aybuke.147@...il.com, arnd@...db.de
Cc:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	Vincent Heuken <me@...centheuken.com>
Subject: [PATCH] Staging: serqt_usb2: fixed frivolous else statement warnings

This is a patch to the serqt_usb2.c file that fixes three instances
of the following checkpatch.pl warning:
WARNING: else is not generally useful after a break or return

Signed-off-by: Vincent Heuken <me@...centheuken.com>
---
 drivers/staging/serqt_usb2/serqt_usb2.c | 45 ++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
index 998c384..c1259c8 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -981,9 +981,8 @@ static void qt_block_until_empty(struct tty_struct *tty,
 		if (wait == 0) {
 			dev_dbg(&qt_port->port->dev, "%s - TIMEOUT", __func__);
 			return;
-		} else {
-			wait = 30;
 		}
+		wait = 30;
 	}
 }
 
@@ -1119,6 +1118,7 @@ static int qt_ioctl(struct tty_struct *tty,
 	struct usb_serial_port *port = tty->driver_data;
 	struct quatech_port *qt_port = qt_get_port_private(port);
 	unsigned int index;
+	char diff;
 
 	dev_dbg(&port->dev, "%s cmd 0x%04x\n", __func__, cmd);
 
@@ -1132,25 +1132,24 @@ static int qt_ioctl(struct tty_struct *tty,
 #endif
 			if (signal_pending(current))
 				return -ERESTARTSYS;
-			else {
-				char diff = qt_port->diff_status;
-
-				if (diff == 0)
-					return -EIO;	/* no change => error */
-
-				/* Consume all events */
-				qt_port->diff_status = 0;
-
-				if (((arg & TIOCM_RNG)
-				     && (diff & SERIAL_MSR_RI))
-				    || ((arg & TIOCM_DSR)
-					&& (diff & SERIAL_MSR_DSR))
-				    || ((arg & TIOCM_CD)
-					&& (diff & SERIAL_MSR_CD))
-				    || ((arg & TIOCM_CTS)
-					&& (diff & SERIAL_MSR_CTS))) {
-					return 0;
-				}
+
+			diff = qt_port->diff_status;
+
+			if (diff == 0)
+				return -EIO;	/* no change => error */
+
+			/* Consume all events */
+			qt_port->diff_status = 0;
+
+			if (((arg & TIOCM_RNG)
+			     && (diff & SERIAL_MSR_RI))
+			    || ((arg & TIOCM_DSR)
+				&& (diff & SERIAL_MSR_DSR))
+			    || ((arg & TIOCM_CD)
+				&& (diff & SERIAL_MSR_CD))
+			    || ((arg & TIOCM_CTS)
+				&& (diff & SERIAL_MSR_CTS))) {
+				return 0;
 			}
 		}
 		return 0;
@@ -1378,8 +1377,8 @@ static inline int qt_real_tiocmset(struct tty_struct *tty,
 	    box_set_register(port->serial, index, MODEM_CONTROL_REGISTER, mcr);
 	if (status < 0)
 		return -ESPIPE;
-	else
-		return 0;
+
+	return 0;
 }
 
 static int qt_tiocmget(struct tty_struct *tty)
-- 
2.0.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ