Re: [PATCH] KVM: PPC: use assign_bit() where applicable
From: Gautam Menghani
Date: Mon Sep 21 2026 - 07:59:57 EST
On Sun, Sep 20, 2026 at 10:26:17AM +0800, 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.
>
> 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;
> }
> --
> 2.51.0
>
>
Thanks for the cleanup.
Reviewed-by: Gautam Menghani <gautam@xxxxxxxxxxxxx>