arm64/cpufeature: Drop redundant define(ID_AA64MMFR0..._SUPPORTED_LPA2)
PATCH 1/1 arm64/cpufeature: Drop redundant define(ID_AA64MMFR0..._SUPPORTED_LPA2)
ID_AA64MMFR0_EL1_TGRAN_2_SUPPORTED_LPA2 is always defined as 0x3. Hence any defined() test on the macro always going to be evaluated as true. Hence the very test itself is redundant and can be dropped off safely.
Although similar defined(ID_AA64MMFR0_EL1_TGRAN_LPA2) test is retained back as the macro does depend on the configured granule size.
---
This patch applies on v7.2-rc3
arch/arm64/kernel/cpufeature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/cpufeature.c +1 -1
@@ -1904,7 +1904,7 @@ static bool has_nv1(const struct arm64_cpu_capabilities *entry, int scope) is_midr_in_range_list(nv1_ni_list))); } -#if defined(ID_AA64MMFR0_EL1_TGRAN_LPA2 ) && defined(ID_AA64MMFR0_EL1_TGRAN_2_SUPPORTED_LPA2 ) +#if defined(ID_AA64MMFR0_EL1_TGRAN_LPA2 )static bool has_lpa2_at_stage1 (u64 mmfr0) {unsigned int tgran;
Signature · 1 line
2.43.0
Quoted 8 lines · Anshuman Khandual
ID_AA64MMFR0_EL1_TGRAN_2_SUPPORTED_LPA2is always defined as0x3. Hence anydefined()test on the macro always going to be evaluated as true. Hence the very test itself is redundant and can be dropped off safely.Although similar
defined(ID_AA64MMFR0_EL1_TGRAN_LPA2)test is retained back as the macro does depend on the configured granule size.[...]
Applied to arm64 (for-next/misc), thanks!
[1/1] arm64/cpufeature: Drop redundant define(ID_AA64MMFR0..._SUPPORTED_LPA2)
https://git.kernel.org/arm64/c/f73411ae5be6