[Qemu-devel] [PATCH v2 24/29] kvm: use DIV_ROUND_UP

Marc-André Lureau posted 29 patches 8 years, 7 months ago
[Qemu-devel] [PATCH v2 24/29] kvm: use DIV_ROUND_UP
Posted by Marc-André Lureau 8 years, 7 months ago
I used the clang-tidy qemu-round check to generate the fix:
https://github.com/elmarco/clang-tools-extra

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 linux-headers/asm-x86/kvm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h
index c2824d02ba..1930b95bcb 100644
--- a/linux-headers/asm-x86/kvm.h
+++ b/linux-headers/asm-x86/kvm.h
@@ -153,7 +153,7 @@ struct kvm_sregs {
 	__u64 cr0, cr2, cr3, cr4, cr8;
 	__u64 efer;
 	__u64 apic_base;
-	__u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];
+	__u64 interrupt_bitmap[DIV_ROUND_UP(KVM_NR_INTERRUPTS, 64)];
 };
 
 /* for KVM_GET_FPU and KVM_SET_FPU */
-- 
2.13.1.395.gf7b71de06


Re: [Qemu-devel] [PATCH v2 24/29] kvm: use DIV_ROUND_UP
Posted by Richard Henderson 8 years, 7 months ago
On 07/13/2017 06:32 AM, Marc-André Lureau wrote:
> I used the clang-tidy qemu-round check to generate the fix:
> https://github.com/elmarco/clang-tools-extra
> 
> Signed-off-by: Marc-André Lureau<marcandre.lureau@redhat.com>
> ---
>   linux-headers/asm-x86/kvm.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~