[PATCH][next] USB: serial: ftdi_sio: Remove redundant assignment to variable cflag

Colin Ian King posted 1 patch 2 years ago
drivers/usb/serial/ftdi_sio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH][next] USB: serial: ftdi_sio: Remove redundant assignment to variable cflag
Posted by Colin Ian King 2 years ago
The variable cflag is being assigned a value that is not being read
afterwards, it is being re-assigned later on. The assignment is
redundant and can be removed.

Cleans up clang scan warning:
drivers/usb/serial/ftdi_sio.c:2613:15: warning: Value stored to 'cflag'
during its initialization is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/usb/serial/ftdi_sio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 13a56783830d..c634d345a652 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2610,7 +2610,7 @@ static void ftdi_set_termios(struct tty_struct *tty,
 	struct device *ddev = &port->dev;
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
 	struct ktermios *termios = &tty->termios;
-	unsigned int cflag = termios->c_cflag;
+	unsigned int cflag;
 	u16 value, index;
 	int ret;
 
-- 
2.39.2
Re: [PATCH][next] USB: serial: ftdi_sio: Remove redundant assignment to variable cflag
Posted by Johan Hovold 1 year, 11 months ago
On Wed, Feb 07, 2024 at 10:49:36AM +0000, Colin Ian King wrote:
> The variable cflag is being assigned a value that is not being read
> afterwards, it is being re-assigned later on. The assignment is
> redundant and can be removed.
> 
> Cleans up clang scan warning:
> drivers/usb/serial/ftdi_sio.c:2613:15: warning: Value stored to 'cflag'
> during its initialization is never read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Applied, thanks.

Johan