mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH linux] usb-storage: Remove redundant assignments
@ 2021-12-30  6:38 cgel.zte
  2021-12-30 14:49 ` Alan Stern
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2021-12-30  6:38 UTC (permalink / raw)
  To: Alan Stern
  Cc: Greg Kroah-Hartman, linux-usb, usb-storage, linux-kernel,
	luo penghao, Zeal Robot

From: luo penghao <luo.penghao@zte.com.cn>

The assignments in these two places will be overwritten, so they
should be deleted.

The clang_analyzer complains as follows:

drivers/usb/storage/sierra_ms.c:

Value stored to 'retries' is never read
Value stored to 'result' is never read

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
---
 drivers/usb/storage/sierra_ms.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/storage/sierra_ms.c b/drivers/usb/storage/sierra_ms.c
index b9f78ef..0774ba2 100644
--- a/drivers/usb/storage/sierra_ms.c
+++ b/drivers/usb/storage/sierra_ms.c
@@ -130,8 +130,6 @@ int sierra_ms_init(struct us_data *us)
 	struct swoc_info *swocInfo;
 	struct usb_device *udev;
 
-	retries = 3;
-	result = 0;
 	udev = us->pusb_dev;
 
 	/* Force Modem mode */
-- 
2.15.2



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

* Re: [PATCH linux] usb-storage: Remove redundant assignments
  2021-12-30  6:38 [PATCH linux] usb-storage: Remove redundant assignments cgel.zte
@ 2021-12-30 14:49 ` Alan Stern
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2021-12-30 14:49 UTC (permalink / raw)
  To: cgel.zte
  Cc: Greg Kroah-Hartman, linux-usb, usb-storage, linux-kernel,
	luo penghao, Zeal Robot

On Thu, Dec 30, 2021 at 06:38:19AM +0000, cgel.zte@gmail.com wrote:
> From: luo penghao <luo.penghao@zte.com.cn>
> 
> The assignments in these two places will be overwritten, so they
> should be deleted.
> 
> The clang_analyzer complains as follows:
> 
> drivers/usb/storage/sierra_ms.c:
> 
> Value stored to 'retries' is never read
> Value stored to 'result' is never read
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
> ---

Acked-by: Alan Stern <stern@rowland.harvard.edu>

>  drivers/usb/storage/sierra_ms.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/usb/storage/sierra_ms.c b/drivers/usb/storage/sierra_ms.c
> index b9f78ef..0774ba2 100644
> --- a/drivers/usb/storage/sierra_ms.c
> +++ b/drivers/usb/storage/sierra_ms.c
> @@ -130,8 +130,6 @@ int sierra_ms_init(struct us_data *us)
>  	struct swoc_info *swocInfo;
>  	struct usb_device *udev;
>  
> -	retries = 3;
> -	result = 0;
>  	udev = us->pusb_dev;
>  
>  	/* Force Modem mode */
> -- 
> 2.15.2
> 
> 

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

end of thread, other threads:[~2021-12-30 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-30  6:38 [PATCH linux] usb-storage: Remove redundant assignments cgel.zte
2021-12-30 14:49 ` Alan Stern

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

all inboxes | Powered by JetHome®