linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* usb: serial: mos7720: remove redundant variables iflag, mask and serial
@ 2018-07-13 10:08 Colin King
  0 siblings, 0 replies; 2+ messages in thread
From: Colin King @ 2018-07-13 10:08 UTC (permalink / raw)
  To: Johan Hovold, Greg Kroah-Hartman, linux-usb; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Variables iflag, mask and serial are being assigned but ar never used
hence are redundant and can be removed.

Cleans up clang warnings:
warning: variable 'iflag' set but not used [-Wunused-but-set-variable]
warning: variable 'mask' set but not used [-Wunused-but-set-variable]
warning: variable 'serial' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/usb/serial/mos7720.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 8f11e759ad61..27109522fd8b 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -1527,8 +1527,6 @@ static void change_port_settings(struct tty_struct *tty,
 	struct usb_serial *serial;
 	int baud;
 	unsigned cflag;
-	unsigned iflag;
-	__u8 mask = 0xff;
 	__u8 lData;
 	__u8 lParity;
 	__u8 lStop;
@@ -1552,23 +1550,19 @@ static void change_port_settings(struct tty_struct *tty,
 	lParity = 0x00;	/* No parity */
 
 	cflag = tty->termios.c_cflag;
-	iflag = tty->termios.c_iflag;
 
 	/* Change the number of bits */
 	switch (cflag & CSIZE) {
 	case CS5:
 		lData = UART_LCR_WLEN5;
-		mask = 0x1f;
 		break;
 
 	case CS6:
 		lData = UART_LCR_WLEN6;
-		mask = 0x3f;
 		break;
 
 	case CS7:
 		lData = UART_LCR_WLEN7;
-		mask = 0x7f;
 		break;
 	default:
 	case CS8:
@@ -1686,11 +1680,8 @@ static void mos7720_set_termios(struct tty_struct *tty,
 		struct usb_serial_port *port, struct ktermios *old_termios)
 {
 	int status;
-	struct usb_serial *serial;
 	struct moschip_port *mos7720_port;
 
-	serial = port->serial;
-
 	mos7720_port = usb_get_serial_port_data(port);
 
 	if (mos7720_port == NULL)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* usb: serial: mos7720: remove redundant variables iflag, mask and serial
@ 2018-07-16 12:11 Johan Hovold
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2018-07-16 12:11 UTC (permalink / raw)
  To: Colin King
  Cc: Johan Hovold, Greg Kroah-Hartman, linux-usb, kernel-janitors,
	linux-kernel

On Fri, Jul 13, 2018 at 11:08:31AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Variables iflag, mask and serial are being assigned but ar never used
> hence are redundant and can be removed.
> 
> Cleans up clang warnings:
> warning: variable 'iflag' set but not used [-Wunused-but-set-variable]
> warning: variable 'mask' set but not used [-Wunused-but-set-variable]
> warning: variable 'serial' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Now applied, thanks.

Johan
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-16 12:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-16 12:11 usb: serial: mos7720: remove redundant variables iflag, mask and serial Johan Hovold
  -- strict thread matches above, loose matches on Subject: below --
2018-07-13 10:08 Colin King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).