* [PATCH v2] staging: greybus: remove unnecessary goto
@ 2026-10-20 16:36 Haasham Khan
2026-10-20 17:05 ` Alex Elder
0 siblings, 1 reply; 2+ 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] 2+ 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
0 siblings, 0 replies; 2+ 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] 2+ messages in thread
end of thread, other threads:[~2026-10-20 17:05 UTC | newest]
Thread overview: 2+ 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
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®