[05/10] kvm tools, powerpc: Use ARRAY_SIZE() in find_cpu_info()

Submitted by Michael Ellerman on July 17, 2012, 5 a.m.

Details

Message ID 1342501220-10209-6-git-send-email-michael@ellerman.id.au
State New
Headers show

Commit Message

Michael Ellerman July 17, 2012, 5 a.m.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 tools/kvm/powerpc/cpu_info.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/tools/kvm/powerpc/cpu_info.c b/tools/kvm/powerpc/cpu_info.c
index ad27451..7326f5b 100644
--- a/tools/kvm/powerpc/cpu_info.c
+++ b/tools/kvm/powerpc/cpu_info.c
@@ -75,7 +75,7 @@  static struct pvr_info host_pvr_info[] = {
 struct cpu_info *find_cpu_info(u32 pvr)
 {
 	unsigned int i;
-	for (i = 0; i < sizeof(host_pvr_info)/sizeof(struct pvr_info); i++) {
+	for (i = 0; i < ARRAY_SIZE(host_pvr_info); i++) {
 		if ((pvr & host_pvr_info[i].pvr_mask) ==
 		    host_pvr_info[i].pvr) {
 			return host_pvr_info[i].cpu_info;