linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] USB: serial: usb_wwan: remove redundant assignment to variable i
@ 2022-03-07 18:31 Colin Ian King
  2022-03-08 17:53 ` Johan Hovold
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-03-07 18:31 UTC (permalink / raw)
  To: Johan Hovold, Greg Kroah-Hartman, linux-usb
  Cc: kernel-janitors, linux-kernel, llvm

Variable i is being assigned a value that is never read, it is being
re-assigned two statements later in a for-loop. The assignment is
redundant and can be removed.

Cleans up clang scan build warning:
drivers/usb/serial/usb_wwan.c:151:2: warning: Value stored to 'i'
is never read [deadcode.DeadStores]

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

diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index cb01283d4d15..dab38b63eaf7 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -148,7 +148,6 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
 
 	dev_dbg(&port->dev, "%s: write (%d chars)\n", __func__, count);
 
-	i = 0;
 	left = count;
 	for (i = 0; left > 0 && i < N_OUT_URB; i++) {
 		todo = left;
-- 
2.35.1


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

* Re: [PATCH] USB: serial: usb_wwan: remove redundant assignment to variable i
  2022-03-07 18:31 [PATCH] USB: serial: usb_wwan: remove redundant assignment to variable i Colin Ian King
@ 2022-03-08 17:53 ` Johan Hovold
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2022-03-08 17:53 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Greg Kroah-Hartman, linux-usb, kernel-janitors, linux-kernel, llvm

On Mon, Mar 07, 2022 at 06:31:00PM +0000, Colin Ian King wrote:
> Variable i is being assigned a value that is never read, it is being
> re-assigned two statements later in a for-loop. The assignment is
> redundant and can be removed.
> 
> Cleans up clang scan build warning:
> drivers/usb/serial/usb_wwan.c:151:2: warning: Value stored to 'i'
> 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:[~2022-03-08 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07 18:31 [PATCH] USB: serial: usb_wwan: remove redundant assignment to variable i Colin Ian King
2022-03-08 17:53 ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).