arm64: clean up has_vhe()
Mark Rutland
reviewerPATCH 1/1 arm64: clean up has_vhe()
Currently, has_vhe() has a redundant if statement, and unlike other cpucap helpers, it doesn't check whether the relevant config option (CONFIG_ARM64_VHE) is enabled, leading to redundant code in some minimal kernel configurations.
This patches fixes both of these issues.
--- arch/arm64/include/asm/virt.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
arch/arm64/include/asm/virt.h +2 -4
@@ -96,10 +96,8 @@ static inline bool is_kernel_in_hyp_mode(void)static inline bool has_vhe (void ) { -if (cpus_have_const_cap (ARM64_HAS_VIRT_HOST_EXTN )) -return true; - -return false; +return IS_ENABLED (CONFIG_ARM64_VHE ) && +cpus_have_const_cap (ARM64_HAS_VIRT_HOST_EXTN ); }#endif /* __ASSEMBLY__ */
Signature · 7 lines
2.11.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 23 lines · Mark Rutland
Currently,
has_vhe()has a redundant if statement, and unlike other cpucap helpers, it doesn't check whether the relevant config option (CONFIG_ARM64_VHE) is enabled, leading to redundant code in some minimal kernel configurations.This patches fixes both of these issues.
Signed-off-by Mark Rutland <[email protected]>Cc Catalin Marinas <[email protected]>Cc Christoffer Dall <[email protected]>Cc Marc Zyngier <[email protected]>Cc Will Deacon <[email protected]>--- arch/arm64/include/asm/virt.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)arch/arm64/include/asm/virt.h +0
-0@@ -96,10 +96,8 @@ static inline bool is_kernel_in_hyp_mode(void)static inline bool has_vhe (void )
arch/arm64/include/asm/virt.h static inline bool is_kernel_in_hyp_mode(void) · line 103
Quoted 10 lines
arch/arm64/include/asm/virt.h +2
-4{ -if (cpus_have_const_cap (ARM64_HAS_VIRT_HOST_EXTN )) -return true; - -return false; +return IS_ENABLED (CONFIG_ARM64_VHE ) && +cpus_have_const_cap (ARM64_HAS_VIRT_HOST_EXTN ); }#endif /* __ASSEMBLY__ */
M.
Signature · 6 lines
Jazz is not dead, it just smell funny. _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 22 lines · Mark Rutland
Currently,
has_vhe()has a redundant if statement, and unlike other cpucap helpers, it doesn't check whether the relevant config option (CONFIG_ARM64_VHE) is enabled, leading to redundant code in some minimal kernel configurations.This patches fixes both of these issues.
Signed-off-by Mark Rutland <[email protected]>Cc Catalin Marinas <[email protected]>Cc Christoffer Dall <[email protected]>Cc Marc Zyngier <[email protected]>Cc Will Deacon <[email protected]>--- arch/arm64/include/asm/virt.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)arch/arm64/include/asm/virt.h +0
-0@@ -96,10 +96,8 @@ static inline bool is_kernel_in_hyp_mode(void)static inline bool has_vhe (void )
arch/arm64/include/asm/virt.h static inline bool is_kernel_in_hyp_mode(void) · line 103
Quoted 10 lines
arch/arm64/include/asm/virt.h +2
-4{ -if (cpus_have_const_cap (ARM64_HAS_VIRT_HOST_EXTN )) -return true; - -return false; +return IS_ENABLED (CONFIG_ARM64_VHE ) && +cpus_have_const_cap (ARM64_HAS_VIRT_HOST_EXTN ); }#endif /* __ASSEMBLY__ */
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 6 lines · Mark Rutland
Currently,
has_vhe()has a redundant if statement, and unlike other cpucap helpers, it doesn't check whether the relevant config option (CONFIG_ARM64_VHE) is enabled, leading to redundant code in some minimal kernel configurations.This patches fixes both of these issues.
Quoted 8 lines
Signed-off-by Mark Rutland <[email protected]>Cc Catalin Marinas <[email protected]>Cc Christoffer Dall <[email protected]>Cc Marc Zyngier <[email protected]>Cc Will Deacon <[email protected]>--- arch/arm64/include/asm/virt.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Thanks, I'll queue this up with Marc and Christoffer's acks.
Will
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel