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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  b66d7e4f022057e1de6df634a0d61f481c026c35
Gitweb:     http://git.kernel.org/tip/b66d7e4f022057e1de6df634a0d61f481c026c35
Author:     Michael Ellerman <michael@xxxxxxxxxxxxxx>
AuthorDate: Tue, 17 Jul 2012 15:00:15 +1000
Committer:  Pekka Enberg <penberg@xxxxxxxxxx>
CommitDate: Tue, 17 Jul 2012 17:07:21 +0300

kvm tools, powerpc: Use ARRAY_SIZE() in find_cpu_info()

Acked-by: Matt Evans <matt@xxxxxxxxxx>
Signed-off-by: Michael Ellerman <michael@xxxxxxxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
---
 tools/kvm/powerpc/cpu_info.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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;
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux