From patchwork Tue Jul 17 05:00:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 1202991 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3168EDF25A for ; Tue, 17 Jul 2012 05:01:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754352Ab2GQFAz (ORCPT ); Tue, 17 Jul 2012 01:00:55 -0400 Received: from ozlabs.org ([203.10.76.45]:53839 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754065Ab2GQFAw (ORCPT ); Tue, 17 Jul 2012 01:00:52 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 14DEF2C0162; Tue, 17 Jul 2012 15:00:51 +1000 (EST) From: Michael Ellerman To: Cc: , , , , , David Gibson Subject: [PATCH 05/10] kvm tools, powerpc: Use ARRAY_SIZE() in find_cpu_info() Date: Tue, 17 Jul 2012 15:00:15 +1000 Message-Id: <1342501220-10209-6-git-send-email-michael@ellerman.id.au> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1342501220-10209-1-git-send-email-michael@ellerman.id.au> References: <1342501220-10209-1-git-send-email-michael@ellerman.id.au> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/cpu_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;