Skip to contentSkip to conversation

USB: serial: oti6858: Remove redundant assignment to variable divisor

PATCH Applied Colin Ian King 2 participants 2 messages Feb 7, 2024 – Mar 4, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: serial: oti6858: Remove redundant assignment to variable divisor

The variable divisor is being assigned a value that is not being read afterward, it is being re-assigned later in both paths of an if statement. The assignment is redundant and can be removed.

Cleans up clang scan warning:
drivers/usb/serial/oti6858.c:412:2: warning: Value stored to 'divisor' is never read [deadcode.DeadStores]

---
 drivers/usb/serial/oti6858.c | 1 -
 1 file changed, 1 deletion(-)
drivers/usb/serial/oti6858.c +0 -1
index 6365cfe5402c..fa07f6ff9ecc 100644
@@ -409,7 +409,6 @@ static void oti6858_set_termios(struct tty_struct *tty,
 	cflag = tty->termios.c_cflag;
 
 	spin_lock_irqsave(&priv->lock, flags);
-	divisor = priv->pending_setup.divisor;
 	frame_fmt = priv->pending_setup.frame_fmt;
 	control = priv->pending_setup.control;
 	spin_unlock_irqrestore(&priv->lock, flags);
Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw
Quoted 9 lines · Colin Ian King

The variable divisor is being assigned a value that is not being read afterward, it is being re-assigned later in both paths of an if statement. The assignment is redundant and can be removed.

Cleans up clang scan warning:
drivers/usb/serial/oti6858.c:412:2: warning: Value stored to 'divisor' is never read [deadcode.DeadStores]

Applied, thanks.

Johan