Re: [PATCH 27/36] RAS/AMD/ATL: remove conditional return with no effect
From: Borislav Petkov
Date: Thu Jul 23 2026 - 15:51:39 EST
On Fri, Jul 24, 2026 at 03:45:29AM +0900, Sang-Heon Jeon wrote:
> Both branches of the check return the same value, so the check has
> no effect. Remove it and return the value directly.
>
> This is the result of running the Coccinelle script from
> scripts/coccinelle/misc/cond_return_no_effect.cocci.
>
> Signed-off-by: Sang-Heon Jeon <ekffu200098@xxxxxxxxx>
> ---
> drivers/ras/amd/atl/map.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/ras/amd/atl/map.c b/drivers/ras/amd/atl/map.c
> index 24a05af747d5..4ec9333ef745 100644
> --- a/drivers/ras/amd/atl/map.c
> +++ b/drivers/ras/amd/atl/map.c
> @@ -771,9 +771,5 @@ int get_address_map(struct addr_ctx *ctx)
>
> dump_address_map(&ctx->map);
>
> - ret = validate_address_map(ctx);
> - if (ret)
> - return ret;
> -
> - return ret;
> + return validate_address_map(ctx);
> }
> --
Applied, thanks.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette