All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: host: {e|o}hci-dbg: kill useless 'ret' variable initializers
@ 2022-02-14 19:56 Sergey Shtylyov
  2022-02-14 21:39 ` Alan Stern
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Shtylyov @ 2022-02-14 19:56 UTC (permalink / raw)
  To: linux-usb, Greg Kroah-Hartman, Alan Stern

The 'ret' local variables are often initialized to 0 but this value is
unused, thus we can kill those initializers...

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

---
This patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo.

 drivers/usb/host/ehci-dbg.c |    4 ++--
 drivers/usb/host/ohci-dbg.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Index: usb/drivers/usb/host/ehci-dbg.c
===================================================================
--- usb.orig/drivers/usb/host/ehci-dbg.c
+++ usb/drivers/usb/host/ehci-dbg.c
@@ -931,7 +931,7 @@ static struct debug_buffer *alloc_buffer
 
 static int fill_buffer(struct debug_buffer *buf)
 {
-	int ret = 0;
+	int ret;
 
 	if (!buf->output_buf)
 		buf->output_buf = vmalloc(buf->alloc_size);
@@ -956,7 +956,7 @@ static ssize_t debug_output(struct file
 		size_t len, loff_t *offset)
 {
 	struct debug_buffer *buf = file->private_data;
-	int ret = 0;
+	int ret;
 
 	mutex_lock(&buf->mutex);
 	if (buf->count == 0) {
Index: usb/drivers/usb/host/ohci-dbg.c
===================================================================
--- usb.orig/drivers/usb/host/ohci-dbg.c
+++ usb/drivers/usb/host/ohci-dbg.c
@@ -680,7 +680,7 @@ static struct debug_buffer *alloc_buffer
 
 static int fill_buffer(struct debug_buffer *buf)
 {
-	int ret = 0;
+	int ret;
 
 	if (!buf->page)
 		buf->page = (char *)get_zeroed_page(GFP_KERNEL);
@@ -705,7 +705,7 @@ static ssize_t debug_output(struct file
 			size_t len, loff_t *offset)
 {
 	struct debug_buffer *buf = file->private_data;
-	int ret = 0;
+	int ret;
 
 	mutex_lock(&buf->mutex);
 	if (buf->count == 0) {


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

* Re: [PATCH] usb: host: {e|o}hci-dbg: kill useless 'ret' variable initializers
  2022-02-14 19:56 [PATCH] usb: host: {e|o}hci-dbg: kill useless 'ret' variable initializers Sergey Shtylyov
@ 2022-02-14 21:39 ` Alan Stern
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2022-02-14 21:39 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: linux-usb, Greg Kroah-Hartman

On Mon, Feb 14, 2022 at 10:56:16PM +0300, Sergey Shtylyov wrote:
> The 'ret' local variables are often initialized to 0 but this value is
> unused, thus we can kill those initializers...
> 
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> 
> ---

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

> This patch is against the 'usb-next' branch of Greg KH's 'usb.git' repo.
> 
>  drivers/usb/host/ehci-dbg.c |    4 ++--
>  drivers/usb/host/ohci-dbg.c |    4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> Index: usb/drivers/usb/host/ehci-dbg.c
> ===================================================================
> --- usb.orig/drivers/usb/host/ehci-dbg.c
> +++ usb/drivers/usb/host/ehci-dbg.c
> @@ -931,7 +931,7 @@ static struct debug_buffer *alloc_buffer
>  
>  static int fill_buffer(struct debug_buffer *buf)
>  {
> -	int ret = 0;
> +	int ret;
>  
>  	if (!buf->output_buf)
>  		buf->output_buf = vmalloc(buf->alloc_size);
> @@ -956,7 +956,7 @@ static ssize_t debug_output(struct file
>  		size_t len, loff_t *offset)
>  {
>  	struct debug_buffer *buf = file->private_data;
> -	int ret = 0;
> +	int ret;
>  
>  	mutex_lock(&buf->mutex);
>  	if (buf->count == 0) {
> Index: usb/drivers/usb/host/ohci-dbg.c
> ===================================================================
> --- usb.orig/drivers/usb/host/ohci-dbg.c
> +++ usb/drivers/usb/host/ohci-dbg.c
> @@ -680,7 +680,7 @@ static struct debug_buffer *alloc_buffer
>  
>  static int fill_buffer(struct debug_buffer *buf)
>  {
> -	int ret = 0;
> +	int ret;
>  
>  	if (!buf->page)
>  		buf->page = (char *)get_zeroed_page(GFP_KERNEL);
> @@ -705,7 +705,7 @@ static ssize_t debug_output(struct file
>  			size_t len, loff_t *offset)
>  {
>  	struct debug_buffer *buf = file->private_data;
> -	int ret = 0;
> +	int ret;
>  
>  	mutex_lock(&buf->mutex);
>  	if (buf->count == 0) {
> 

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

end of thread, other threads:[~2022-02-14 21:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14 19:56 [PATCH] usb: host: {e|o}hci-dbg: kill useless 'ret' variable initializers Sergey Shtylyov
2022-02-14 21:39 ` Alan Stern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.