Skip to contentSkip to conversation

KVM: PPC: booke: Use min() in watchdog_next_timeout()

PATCH Applied Thorsten Blum 3 participants 5 messages Aug 4 – Aug 9

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

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

---
 arch/powerpc/kvm/booke.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kvm/booke.c +1 -1
index f3ddb24ece74..543479fc9630 100644
@@ -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)
#1 lore raw

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

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

---
 arch/powerpc/kvm/powerpc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kvm/powerpc.c +2 -2
index 00302399fc37..f76322be907d 100644
@@ -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;
maintainer Applied
#4 lore raw
In reply to Thorsten Blum
Quoted 4 lines · Thorsten Blum

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