From: Johan Hovold Date: Wed, 19 May 2021 09:20:06 +0000 (+0200) Subject: USB: serial: drop irq-flags initialisations X-Git-Tag: accepted/tizen/unified/20230118.172025~6887^2~7^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=17cd3a106e9762cd97883cce884a8bfcf5a476ad;p=platform%2Fkernel%2Flinux-rpi.git USB: serial: drop irq-flags initialisations There's no need to initialise irq-flags variables before saving the interrupt state. Drop the redundant initialisations from the three drivers that got this wrong. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold --- diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 754c66f..af65eb8 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -372,7 +372,7 @@ static int digi_write_oob_command(struct usb_serial_port *port, int len; struct usb_serial_port *oob_port = (struct usb_serial_port *)((struct digi_serial *)(usb_get_serial_data(port->serial)))->ds_oob_port; struct digi_port *oob_priv = usb_get_serial_port_data(oob_port); - unsigned long flags = 0; + unsigned long flags; dev_dbg(&port->dev, "digi_write_oob_command: TOP: port=%d, count=%d\n", @@ -430,7 +430,7 @@ static int digi_write_inb_command(struct usb_serial_port *port, int len; struct digi_port *priv = usb_get_serial_port_data(port); unsigned char *data = port->write_urb->transfer_buffer; - unsigned long flags = 0; + unsigned long flags; dev_dbg(&port->dev, "digi_write_inb_command: TOP: port=%d, count=%d\n", priv->dp_port_num, count); @@ -511,8 +511,7 @@ static int digi_set_modem_signals(struct usb_serial_port *port, struct usb_serial_port *oob_port = (struct usb_serial_port *) ((struct digi_serial *)(usb_get_serial_data(port->serial)))->ds_oob_port; struct digi_port *oob_priv = usb_get_serial_port_data(oob_port); unsigned char *data = oob_port->write_urb->transfer_buffer; - unsigned long flags = 0; - + unsigned long flags; dev_dbg(&port->dev, "digi_set_modem_signals: TOP: port=%d, modem_signals=0x%x\n", @@ -577,7 +576,7 @@ static int digi_transmit_idle(struct usb_serial_port *port, int ret; unsigned char buf[2]; struct digi_port *priv = usb_get_serial_port_data(port); - unsigned long flags = 0; + unsigned long flags; spin_lock_irqsave(&priv->dp_port_lock, flags); priv->dp_transmit_idle = 0; @@ -887,7 +886,7 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port, int ret, data_len, new_len; struct digi_port *priv = usb_get_serial_port_data(port); unsigned char *data = port->write_urb->transfer_buffer; - unsigned long flags = 0; + unsigned long flags; dev_dbg(&port->dev, "digi_write: TOP: port=%d, count=%d\n", priv->dp_port_num, count); @@ -1024,8 +1023,8 @@ static unsigned int digi_write_room(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; struct digi_port *priv = usb_get_serial_port_data(port); + unsigned long flags; unsigned int room; - unsigned long flags = 0; spin_lock_irqsave(&priv->dp_port_lock, flags); diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c index f9ce9e7..30ab565 100644 --- a/drivers/usb/serial/metro-usb.c +++ b/drivers/usb/serial/metro-usb.c @@ -109,9 +109,9 @@ static void metrousb_read_int_callback(struct urb *urb) struct usb_serial_port *port = urb->context; struct metrousb_private *metro_priv = usb_get_serial_port_data(port); unsigned char *data = urb->transfer_buffer; + unsigned long flags; int throttled = 0; int result = 0; - unsigned long flags = 0; dev_dbg(&port->dev, "%s\n", __func__); @@ -171,7 +171,7 @@ static int metrousb_open(struct tty_struct *tty, struct usb_serial_port *port) { struct usb_serial *serial = port->serial; struct metrousb_private *metro_priv = usb_get_serial_port_data(port); - unsigned long flags = 0; + unsigned long flags; int result = 0; /* Set the private data information for the port. */ @@ -268,7 +268,7 @@ static void metrousb_throttle(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; struct metrousb_private *metro_priv = usb_get_serial_port_data(port); - unsigned long flags = 0; + unsigned long flags; /* Set the private information for the port to stop reading data. */ spin_lock_irqsave(&metro_priv->lock, flags); @@ -281,7 +281,7 @@ static int metrousb_tiocmget(struct tty_struct *tty) unsigned long control_state = 0; struct usb_serial_port *port = tty->driver_data; struct metrousb_private *metro_priv = usb_get_serial_port_data(port); - unsigned long flags = 0; + unsigned long flags; spin_lock_irqsave(&metro_priv->lock, flags); control_state = metro_priv->control_state; @@ -296,7 +296,7 @@ static int metrousb_tiocmset(struct tty_struct *tty, struct usb_serial_port *port = tty->driver_data; struct usb_serial *serial = port->serial; struct metrousb_private *metro_priv = usb_get_serial_port_data(port); - unsigned long flags = 0; + unsigned long flags; unsigned long control_state = 0; dev_dbg(&port->dev, "%s - set=%d, clear=%d\n", __func__, set, clear); @@ -323,7 +323,7 @@ static void metrousb_unthrottle(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; struct metrousb_private *metro_priv = usb_get_serial_port_data(port); - unsigned long flags = 0; + unsigned long flags; int result = 0; /* Set the private information for the port to resume reading data. */ diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c index 3b5f203..d3377f3 100644 --- a/drivers/usb/serial/quatech2.c +++ b/drivers/usb/serial/quatech2.c @@ -874,7 +874,7 @@ static unsigned int qt2_write_room(struct tty_struct *tty) { struct usb_serial_port *port = tty->driver_data; struct qt2_port_private *port_priv; - unsigned long flags = 0; + unsigned long flags; unsigned int r; port_priv = usb_get_serial_port_data(port);