[PATCH 1/2] KVM: PPC: booke: Use min() in watchdog_next_timeout()

Subsystems: kernel virtual machine for powerpc (kvm/powerpc), linux for powerpc (32-bit and 64-bit), the rest

STALE62d LANDED

Landed in mainline as ad0889338bfe on 2026-08-06.

5 messages, 3 authors, 2026-08-09 · open the first message on its own page

[PATCH 1/2] KVM: PPC: booke: Use min() in watchdog_next_timeout()

From: Thorsten Blum <hidden>
Date: 2026-08-04 11:20:42

Replace min_t() with the simpler min() macro since the values are
unsigned and compatible.

Signed-off-by: Thorsten Blum <redacted>
---
 arch/powerpc/kvm/booke.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index f3ddb24ece74..543479fc9630 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -598,7 +598,7 @@ static unsigned long watchdog_next_timeout(struct kvm_vcpu *vcpu)
 	if (do_div(nr_jiffies, tb_ticks_per_jiffy))
 		nr_jiffies++;
 
-	return min_t(unsigned long long, nr_jiffies, TIMER_NEXT_MAX_DELTA);
+	return min(nr_jiffies, TIMER_NEXT_MAX_DELTA);
 }
 
 static void arm_next_watchdog(struct kvm_vcpu *vcpu)

[PATCH 2/2] KVM: PPC: Use min() in kvm_vm_ioctl_check_extension()

From: Thorsten Blum <hidden>
Date: 2026-08-04 11:20:49

Replace min_t() with the simpler min() macro since the values are
unsigned and compatible.

Signed-off-by: Thorsten Blum <redacted>
---
 arch/powerpc/kvm/powerpc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 00302399fc37..f76322be907d 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -635,9 +635,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
 		 * implementations just count online CPUs.
 		 */
 		if (hv_enabled)
-			r = min_t(unsigned int, num_present_cpus(), KVM_MAX_VCPUS);
+			r = min(num_present_cpus(), KVM_MAX_VCPUS);
 		else
-			r = min_t(unsigned int, num_online_cpus(), KVM_MAX_VCPUS);
+			r = min(num_online_cpus(), KVM_MAX_VCPUS);
 		break;
 	case KVM_CAP_MAX_VCPUS:
 		r = KVM_MAX_VCPUS;

Re: [PATCH 1/2] KVM: PPC: booke: Use min() in watchdog_next_timeout()

From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Date: 2026-08-06 01:20:07

Thorsten Blum [off-list ref] writes:
Replace min_t() with the simpler min() macro since the values are
unsigned and compatible.

Signed-off-by: Thorsten Blum <redacted>
Looks good to me. Feel free to add:
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

Re: [PATCH 2/2] KVM: PPC: Use min() in kvm_vm_ioctl_check_extension()

From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Date: 2026-08-06 01:20:34

Thorsten Blum [off-list ref] writes:
Replace min_t() with the simpler min() macro since the values are
unsigned and compatible.

Signed-off-by: Thorsten Blum <redacted>
Looks good to me. Feel free to add:
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

Re: [PATCH 1/2] KVM: PPC: booke: Use min() in watchdog_next_timeout()

From: Madhavan Srinivasan <maddy@linux.ibm.com>
Date: 2026-08-09 13:14:17

On Tue, 04 Aug 2026 13:20:12 +0200, Thorsten Blum wrote:
Replace min_t() with the simpler min() macro since the values are
unsigned and compatible.
Applied to powerpc/next.

[1/2] KVM: PPC: booke: Use min() in watchdog_next_timeout()
      https://git.kernel.org/powerpc/c/ad0889338bfed33da6b8127d7d8ae0a4d6e4cd5d
[2/2] KVM: PPC: Use min() in kvm_vm_ioctl_check_extension()
      https://git.kernel.org/powerpc/c/0fcdb510932b90160c47d3c38f6ce43852d7e14f

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help