diff options
author | Vincent Heuken <me@vincentheuken.com> | 2014-06-20 16:49:51 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-26 23:56:48 (GMT) |
commit | ee01e6334783297a91f4978c390a2a934cfa7a62 (patch) | |
tree | 48768608dbe7139474796e66178b2c8b4116d7bb | |
parent | 0b913529c7831d0244a602927e763ec8c4134747 (diff) | |
download | linux-ee01e6334783297a91f4978c390a2a934cfa7a62.tar.xz |
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@vincentheuken.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/serqt_usb2/serqt_usb2.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c index 5e97726..999757d 100644 --- a/drivers/staging/serqt_usb2/serqt_usb2.c +++ b/drivers/staging/serqt_usb2/serqt_usb2.c @@ -982,9 +982,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; } } @@ -1120,6 +1119,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); @@ -1133,25 +1133,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; @@ -1379,8 +1378,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) |