Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: serial: mos7840: remove set but not used variables 'st, data1, iflag'

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/usb/serial/mos7840.c: In function 'mos7840_interrupt_callback':
drivers/usb/serial/mos7840.c:604:14: warning:
variable 'st' set but not used [-Wunused-but-set-variable]

drivers/usb/serial/mos7840.c: In function 'mos7840_write':
drivers/usb/serial/mos7840.c:1303:17: warning:
variable 'data1' set but not used [-Wunused-but-set-variable]

drivers/usb/serial/mos7840.c:1700:11: warning:
variable 'iflag' set but not used [-Wunused-but-set-variable]

They are never used since introduction in commit 3f5429746d91 ("USB:
Moschip 7840 USB-Serial Driver")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Johan Hovold <johan@kernel.org>

authored by

YueHaibing and committed by
Johan Hovold
32d8a6fc 548f32f5

+1 -6
+1 -6
drivers/usb/serial/mos7840.c
··· 601 601 struct usb_serial *serial; 602 602 __u16 Data; 603 603 unsigned char *data; 604 - __u8 sp[5], st; 604 + __u8 sp[5]; 605 605 int i, rv = 0; 606 606 __u16 wval, wreg = 0; 607 607 int status = urb->status; ··· 644 644 sp[1] = (__u8) data[1]; 645 645 sp[2] = (__u8) data[2]; 646 646 sp[3] = (__u8) data[3]; 647 - st = (__u8) data[4]; 648 647 649 648 for (i = 0; i < serial->num_ports; i++) { 650 649 mos7840_port = mos7840_get_port_private(serial->port[i]); ··· 1299 1300 struct urb *urb; 1300 1301 /* __u16 Data; */ 1301 1302 const unsigned char *current_position = data; 1302 - unsigned char *data1; 1303 1303 1304 1304 if (mos7840_port_paranoia_check(port, __func__)) 1305 1305 return -1; ··· 1359 1361 mos7840_bulk_out_data_callback, mos7840_port); 1360 1362 } 1361 1363 1362 - data1 = urb->transfer_buffer; 1363 1364 dev_dbg(&port->dev, "bulkout endpoint is %d\n", port->bulk_out_endpointAddress); 1364 1365 1365 1366 if (mos7840_port->has_led) ··· 1694 1697 { 1695 1698 int baud; 1696 1699 unsigned cflag; 1697 - unsigned iflag; 1698 1700 __u8 lData; 1699 1701 __u8 lParity; 1700 1702 __u8 lStop; ··· 1725 1729 lParity = LCR_PAR_NONE; 1726 1730 1727 1731 cflag = tty->termios.c_cflag; 1728 - iflag = tty->termios.c_iflag; 1729 1732 1730 1733 /* Change the number of bits */ 1731 1734 switch (cflag & CSIZE) {