提交 03f6a22a 编写于 作者: W Wei Yongjun 提交者: Paolo Bonzini

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: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 add6a0cd
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册