From 62f2084595521d0d60630fa368dd89d97f8f9cb9 Mon Sep 17 00:00:00 2001
From: Laura Abbott <lauraa@codeaurora.org>
Date: Tue, 11 Mar 2014 17:35:07 -0700
Subject: [PATCH] linux-ramdump-parser-v2: Use array_index in pagetypeinfo

array_index properly accounts for the changes in sizes of array
items. Use it.

Change-Id: I0dd0fb70f968a2b837a3d2aa02ae3d02ad5a578a
---
 linux-ramdump-parser-v2/parsers/pagetypeinfo.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linux-ramdump-parser-v2/parsers/pagetypeinfo.py b/linux-ramdump-parser-v2/parsers/pagetypeinfo.py
index 5ccb6bc..841d57d 100644
--- a/linux-ramdump-parser-v2/parsers/pagetypeinfo.py
+++ b/linux-ramdump-parser-v2/parsers/pagetypeinfo.py
@@ -33,7 +33,7 @@ class Pagetypeinfo(RamParser):
         total_orders_str = 'Total pages:                    '
 
         for mtype in range(0, migrate_types):
-            mname_addr = ramdump.read_word(migratetype_names + mtype * 4)
+            mname_addr = ramdump.read_word(ramdump.array_index(migratetype_names, 'char *', mtype))
             mname = ramdump.read_cstring(mname_addr, 12)
             pageinfo = ('zone {0:8} type {1:12} '.format(zname, mname))
             nums = ''
-- 
GitLab