[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220912133826.18517-1-xu.panda@zte.com.cn>
Date: Mon, 12 Sep 2022 13:38:27 +0000
From: cgel.zte@...il.com
To: johan@...nel.org
Cc: gregkh@...uxfoundation.org, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, Xu Panda <xu.panda@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH linux-next] USB: serial: ftdi_sio: remove the unneeded result variable
From: Xu Panda <xu.panda@....com.cn>
Return the value usb_control_msg() directly instead of storing
it in another redundant variable.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Xu Panda <xu.panda@....com.cn>
---
drivers/usb/serial/ftdi_sio.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 0a1da579ead5..f02dcef69cb9 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1394,7 +1394,6 @@ static int change_speed(struct tty_struct *tty, struct usb_serial_port *port)
u16 value;
u16 index;
u32 index_value;
- int rv;
index_value = get_ftdi_divisor(tty, port);
value = (u16)index_value;
@@ -1407,13 +1406,12 @@ static int change_speed(struct tty_struct *tty, struct usb_serial_port *port)
index = (u16)((index << 8) | priv->interface);
}
- rv = usb_control_msg(port->serial->dev,
- usb_sndctrlpipe(port->serial->dev, 0),
- FTDI_SIO_SET_BAUDRATE_REQUEST,
- FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE,
- value, index,
- NULL, 0, WDR_SHORT_TIMEOUT);
- return rv;
+ return usb_control_msg(port->serial->dev,
+ usb_sndctrlpipe(port->serial->dev, 0),
+ FTDI_SIO_SET_BAUDRATE_REQUEST,
+ FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE,
+ value, index,
+ NULL, 0, WDR_SHORT_TIMEOUT);
}
static int write_latency_timer(struct usb_serial_port *port)
--
2.15.2
Powered by blists - more mailing lists