diff mbox series

KVM: SVM: Use str_enabled_disabled() helper in sev_hardware_setup()

Message ID 20241227094450.674104-2-thorsten.blum@linux.dev (mailing list archive)
State New
Headers show
Series KVM: SVM: Use str_enabled_disabled() helper in sev_hardware_setup() | expand

Commit Message

Thorsten Blum Dec. 27, 2024, 9:44 a.m. UTC
Remove hard-coded strings by using the str_enabled_disabled() helper
function.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/x86/kvm/svm/sev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Nikunj A. Dadhania Jan. 2, 2025, 8:32 a.m. UTC | #1
On 12/27/2024 3:14 PM, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_enabled_disabled() helper
> function.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Looks good to me.

Reviewed-by: Nikunj A Dadhania <nikunj@amd.com>

> ---
>  arch/x86/kvm/svm/sev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> index 943bd074a5d3..87ed8cde68a7 100644
> --- a/arch/x86/kvm/svm/sev.c
> +++ b/arch/x86/kvm/svm/sev.c
> @@ -3051,11 +3051,11 @@ void __init sev_hardware_setup(void)
>  			min_sev_asid, max_sev_asid);
>  	if (boot_cpu_has(X86_FEATURE_SEV_ES))
>  		pr_info("SEV-ES %s (ASIDs %u - %u)\n",
> -			sev_es_supported ? "enabled" : "disabled",
> +			str_enabled_disabled(sev_es_supported),
>  			min_sev_asid > 1 ? 1 : 0, min_sev_asid - 1);
>  	if (boot_cpu_has(X86_FEATURE_SEV_SNP))
>  		pr_info("SEV-SNP %s (ASIDs %u - %u)\n",
> -			sev_snp_supported ? "enabled" : "disabled",
> +			str_enabled_disabled(sev_snp_supported),
>  			min_sev_asid > 1 ? 1 : 0, min_sev_asid - 1);
>  
>  	sev_enabled = sev_supported;
Paluri, PavanKumar Jan. 2, 2025, 2:57 p.m. UTC | #2
On 12/27/2024 3:44 AM, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_enabled_disabled() helper
> function.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

LGTM.

Reviewed-by: Pavan Kumar Paluri <papaluri@amd.com>
> ---
>  arch/x86/kvm/svm/sev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> index 943bd074a5d3..87ed8cde68a7 100644
> --- a/arch/x86/kvm/svm/sev.c
> +++ b/arch/x86/kvm/svm/sev.c
> @@ -3051,11 +3051,11 @@ void __init sev_hardware_setup(void)
>  			min_sev_asid, max_sev_asid);
>  	if (boot_cpu_has(X86_FEATURE_SEV_ES))
>  		pr_info("SEV-ES %s (ASIDs %u - %u)\n",
> -			sev_es_supported ? "enabled" : "disabled",
> +			str_enabled_disabled(sev_es_supported),
>  			min_sev_asid > 1 ? 1 : 0, min_sev_asid - 1);
>  	if (boot_cpu_has(X86_FEATURE_SEV_SNP))
>  		pr_info("SEV-SNP %s (ASIDs %u - %u)\n",
> -			sev_snp_supported ? "enabled" : "disabled",
> +			str_enabled_disabled(sev_snp_supported),
>  			min_sev_asid > 1 ? 1 : 0, min_sev_asid - 1);
>  
>  	sev_enabled = sev_supported;
diff mbox series

Patch

diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
index 943bd074a5d3..87ed8cde68a7 100644
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -3051,11 +3051,11 @@  void __init sev_hardware_setup(void)
 			min_sev_asid, max_sev_asid);
 	if (boot_cpu_has(X86_FEATURE_SEV_ES))
 		pr_info("SEV-ES %s (ASIDs %u - %u)\n",
-			sev_es_supported ? "enabled" : "disabled",
+			str_enabled_disabled(sev_es_supported),
 			min_sev_asid > 1 ? 1 : 0, min_sev_asid - 1);
 	if (boot_cpu_has(X86_FEATURE_SEV_SNP))
 		pr_info("SEV-SNP %s (ASIDs %u - %u)\n",
-			sev_snp_supported ? "enabled" : "disabled",
+			str_enabled_disabled(sev_snp_supported),
 			min_sev_asid > 1 ? 1 : 0, min_sev_asid - 1);
 
 	sev_enabled = sev_supported;