diff mbox series

[-next,v2,3/3] cacheinfo: Remove unused check in init_cache_level()

Message ID 20230124154053.355376-4-pierre.gondois@arm.com (mailing list archive)
State New, archived
Headers show
Series cacheinfo: Fix misbehaviours around init_cache_level() | expand

Commit Message

Pierre Gondois Jan. 24, 2023, 3:40 p.m. UTC
commit e75d18cecbb3 ("arm64: cacheinfo: Fix incorrect assignment
of signed error value to unsigned fw_level")
checks the fw_level value in init_cache_level() in case the value is
negative.
Remove this check as the error code is not returned through
fw_level anymore, and reset fw_level if acpi_get_cache_info()
failed. This allows to try fetching the cache information from
clidr_el1.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
---
 arch/arm64/kernel/cacheinfo.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Conor Dooley Jan. 24, 2023, 5:01 p.m. UTC | #1
On Tue, Jan 24, 2023 at 04:40:48PM +0100, Pierre Gondois wrote:
> commit e75d18cecbb3 ("arm64: cacheinfo: Fix incorrect assignment
> of signed error value to unsigned fw_level")
> checks the fw_level value in init_cache_level() in case the value is
> negative.
> Remove this check as the error code is not returned through
> fw_level anymore, and reset fw_level if acpi_get_cache_info()
> failed. This allows to try fetching the cache information from
> clidr_el1.

I dunno anything about clidr_el1, but the mechanics of the change seem
fair. There is a non-acpi path too, which shouldn't return negative
numbers either so LGTM.

> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
> ---
>  arch/arm64/kernel/cacheinfo.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/arch/arm64/kernel/cacheinfo.c b/arch/arm64/kernel/cacheinfo.c
> index bf348b8d321f..c307f69e9b55 100644
> --- a/arch/arm64/kernel/cacheinfo.c
> +++ b/arch/arm64/kernel/cacheinfo.c
> @@ -62,9 +62,6 @@ int init_cache_level(unsigned int cpu)
>  			fw_level = 0;
>  	}
>  
> -	if (fw_level < 0)
> -		return fw_level;
> -
>  	if (level < fw_level) {
>  		/*
>  		 * some external caches not specified in CLIDR_EL1
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/arch/arm64/kernel/cacheinfo.c b/arch/arm64/kernel/cacheinfo.c
index bf348b8d321f..c307f69e9b55 100644
--- a/arch/arm64/kernel/cacheinfo.c
+++ b/arch/arm64/kernel/cacheinfo.c
@@ -62,9 +62,6 @@  int init_cache_level(unsigned int cpu)
 			fw_level = 0;
 	}
 
-	if (fw_level < 0)
-		return fw_level;
-
 	if (level < fw_level) {
 		/*
 		 * some external caches not specified in CLIDR_EL1