Re: [cocci] [PATCH 27/36] RAS/AMD/ATL: remove conditional return with no effect

Borislav Petkov <[email protected]> Thu, 23 Jul 2026 12:44:07 -0700
Newsgroups fr.inria.cocci,org.kernel.vger.linux-edac,org.kernel.vger.linux-kernel
Message-ID <20260723194407.GDamJvBzzMfuyu-NTQ@fat_crate.local>
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 <[email protected]>
> ---
>  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