From: Vincent Heuken <me@vincentheuken.com>
To: gregkh@linuxfoundation.org, thomas_75@safe-mail.net,
himangi774@gmail.com, paul.gortmaker@windriver.com,
aybuke.147@gmail.com, arnd@arndb.de
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Vincent Heuken <me@vincentheuken.com>
Subject: [PATCH] Staging: serqt_usb2: fixed frivolous else statement warnings
Date: Fri, 20 Jun 2014 09:49:51 -0700 [thread overview]
Message-ID: <1403282991-19133-1-git-send-email-me@vincentheuken.com> (raw)
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@vincentheuken.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
next reply other threads:[~2014-06-20 16:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-20 16:49 Vincent Heuken [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-06-20 16:31 Vincent Heuken
2014-06-20 16:43 ` Greg KH
2014-06-20 13:23 Vincent Heuken
2014-06-20 15:31 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1403282991-19133-1-git-send-email-me@vincentheuken.com \
--to=me@vincentheuken.com \
--cc=arnd@arndb.de \
--cc=aybuke.147@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=himangi774@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.gortmaker@windriver.com \
--cc=thomas_75@safe-mail.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®