The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH][next] USB: serial: oti6858: Remove redundant assignment to variable divisor
@ 2024-02-07 10:18 Colin Ian King
  2024-03-04 13:46 ` Johan Hovold
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2024-02-07 10:18 UTC (permalink / raw)
  To: Johan Hovold, Greg Kroah-Hartman, linux-usb; +Cc: kernel-janitors, linux-kernel

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]

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

diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c
index 6365cfe5402c..fa07f6ff9ecc 100644
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -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);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] USB: serial: oti6858: Remove redundant assignment to variable divisor
  2024-02-07 10:18 [PATCH][next] USB: serial: oti6858: Remove redundant assignment to variable divisor Colin Ian King
@ 2024-03-04 13:46 ` Johan Hovold
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2024-03-04 13:46 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors, linux-kernel

On Wed, Feb 07, 2024 at 10:18:33AM +0000, Colin Ian King wrote:
> 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]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Applied, thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-04 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-07 10:18 [PATCH][next] USB: serial: oti6858: Remove redundant assignment to variable divisor Colin Ian King
2024-03-04 13:46 ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox