mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] staging: greybus: remove unnecessary goto
@ 2026-10-20 16:36 Haasham Khan
  2026-10-20 17:05 ` Alex Elder
  2026-10-21  6:17 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Haasham Khan @ 2026-10-20 16:36 UTC (permalink / raw)
  To: pure.logic, johan, elder, gregkh
  Cc: greybus-dev, linux-staging, linux-kernel, outreachy, Haasham Khan

Remove the conditional jump to gb_error, as both success and error
paths proceed to free the request and return the result.

This simplifies the control flow without changing the function's
behavior.

Signed-off-by: Haasham Khan <haasham93@gmail.com>
---
 drivers/staging/greybus/loopback.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
index efc69c10cffe..284935fded12 100644
--- a/drivers/staging/greybus/loopback.c
+++ b/drivers/staging/greybus/loopback.c
@@ -609,10 +609,6 @@ static int gb_loopback_async_transfer(struct gb_loopback *gb, u32 len)
 					     request, len + sizeof(*request),
 					     len + response_len,
 					     gb_loopback_async_transfer_complete);
-	if (retval)
-		goto gb_error;
-
-gb_error:
 	kfree(request);
 	return retval;
 }
-- 
2.53.0


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

* Re: [PATCH v2] staging: greybus: remove unnecessary goto
  2026-10-20 16:36 [PATCH v2] staging: greybus: remove unnecessary goto Haasham Khan
@ 2026-10-20 17:05 ` Alex Elder
  2026-10-21  6:17 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Elder @ 2026-10-20 17:05 UTC (permalink / raw)
  To: Haasham Khan, pure.logic, johan, elder, gregkh
  Cc: greybus-dev, linux-staging, linux-kernel, outreachy

On 10/20/26 11:36 AM, Haasham Khan wrote:
> Remove the conditional jump to gb_error, as both success and error
> paths proceed to free the request and return the result.
> 
> This simplifies the control flow without changing the function's
> behavior.
> 
> Signed-off-by: Haasham Khan <haasham93@gmail.com>

Looks good.

Reviewed-by: Alex Elder <elder@riscstar.com>

> ---
>   drivers/staging/greybus/loopback.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
> index efc69c10cffe..284935fded12 100644
> --- a/drivers/staging/greybus/loopback.c
> +++ b/drivers/staging/greybus/loopback.c
> @@ -609,10 +609,6 @@ static int gb_loopback_async_transfer(struct gb_loopback *gb, u32 len)
>   					     request, len + sizeof(*request),
>   					     len + response_len,
>   					     gb_loopback_async_transfer_complete);
> -	if (retval)
> -		goto gb_error;
> -
> -gb_error:
>   	kfree(request);
>   	return retval;
>   }


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

* Re: [PATCH v2] staging: greybus: remove unnecessary goto
  2026-10-20 16:36 [PATCH v2] staging: greybus: remove unnecessary goto Haasham Khan
  2026-10-20 17:05 ` Alex Elder
@ 2026-10-21  6:17 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2026-10-21  6:17 UTC (permalink / raw)
  To: Haasham Khan
  Cc: pure.logic, johan, elder, greybus-dev, linux-staging,
	linux-kernel, outreachy

On Tue, Oct 20, 2026 at 04:36:36PM +0000, Haasham Khan wrote:
> Remove the conditional jump to gb_error, as both success and error
> paths proceed to free the request and return the result.
> 
> This simplifies the control flow without changing the function's
> behavior.
> 
> Signed-off-by: Haasham Khan <haasham93@gmail.com>
> ---
>  drivers/staging/greybus/loopback.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
> index efc69c10cffe..284935fded12 100644
> --- a/drivers/staging/greybus/loopback.c
> +++ b/drivers/staging/greybus/loopback.c
> @@ -609,10 +609,6 @@ static int gb_loopback_async_transfer(struct gb_loopback *gb, u32 len)
>  					     request, len + sizeof(*request),
>  					     len + response_len,
>  					     gb_loopback_async_transfer_complete);
> -	if (retval)
> -		goto gb_error;
> -
> -gb_error:
>  	kfree(request);
>  	return retval;
>  }
> -- 
> 2.53.0
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- This looks like a new version of a previously submitted patch, but you
  did not list below the --- line any changes from the previous version.
  Please read the section entitled "The canonical patch format" in the
  kernel file, Documentation/process/submitting-patches.rst for what
  needs to be done here to properly describe this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

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

end of thread, other threads:[~2026-10-21  6:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20 16:36 [PATCH v2] staging: greybus: remove unnecessary goto Haasham Khan
2026-10-20 17:05 ` Alex Elder
2026-10-21  6:17 ` Greg KH

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®