KVM: x86: Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element

Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Wei Yongjun 2016-07-04 15:13:07 +00:00 committed by Paolo Bonzini
parent add6a0cd1c
commit 03f6a22a39
1 changed files with 1 additions and 1 deletions

View File

@ -1112,7 +1112,7 @@ static inline bool cpu_has_broken_vmx_preemption_timer(void)
/* Clear the reserved bits */
eax &= ~(0x3U << 14 | 0xfU << 28);
for (i = 0; i < sizeof(vmx_preemption_cpu_tfms)/sizeof(u32); i++)
for (i = 0; i < ARRAY_SIZE(vmx_preemption_cpu_tfms); i++)
if (eax == vmx_preemption_cpu_tfms[i])
return true;