Re: [PATCH] KVM: PPC: use assign_bit() where applicable
From: Shrikanth Hegde
Date: Mon Sep 21 2026 - 05:11:39 EST
Hi Peng.
On 9/20/26 7:56 AM, Peng Fan (OSS) wrote:
From: Peng Fan <peng.fan@xxxxxxx>
Convert open-coded if/else with set_bit/clear_bit to the assign_bit API.
Reviewed-by: Shrikanth Hegde <sshegde@xxxxxxxxxxxxx>
Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
arch/powerpc/kvm/powerpc.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 9194cf492d1c..a567b63a5f1f 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -2210,10 +2210,7 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
break;
if (!kvmppc_book3s_hcall_implemented(kvm, hcall))
break;
- if (cap->args[1])
- set_bit(hcall / 4, kvm->arch.enabled_hcalls);
- else
- clear_bit(hcall / 4, kvm->arch.enabled_hcalls);
+ assign_bit(hcall / 4, kvm->arch.enabled_hcalls, cap->args[1]);
r = 0;
break;
}
Just ensure you have covered all such possible open coding where applicable
in arch/powerpc/.