mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KVM: PPC: use assign_bit() where applicable
@ 2026-09-20  2:26 Peng Fan (OSS)
  2026-09-21  9:09 ` Shrikanth Hegde
  2026-09-21 11:59 ` Gautam Menghani
  0 siblings, 2 replies; 4+ messages in thread
From: Peng Fan (OSS) @ 2026-09-20  2:26 UTC (permalink / raw)
  To: Madhavan Srinivasan, Nicholas Piggin, Michael Ellerman,
	Christophe Leroy (CS GROUP), Ritesh Harjani (IBM),
	Shrikanth Hegde
  Cc: linux-kernel, Peng Fan, linuxppc-dev, kvm

From: Peng Fan <peng.fan@nxp.com>

Convert open-coded if/else with set_bit/clear_bit to the assign_bit API.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-21 12:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-20  2:26 [PATCH] KVM: PPC: use assign_bit() where applicable Peng Fan (OSS)
2026-09-21  9:09 ` Shrikanth Hegde
2026-09-21 12:37   ` Peng Fan
2026-09-21 11:59 ` Gautam Menghani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®