From 758cb36c0a5141c03a4ea249f9ca3f101488c5d0 Mon Sep 17 00:00:00 2001 From: Donghyeok Choe Date: Wed, 16 May 2018 14:15:56 +0900 Subject: [PATCH] [COMMON] lib: dss: change variable form enabed log count to total log count Change-Id: Ife95505db80cac47d7852a511f8c5b71140a4b5e Signed-off-by: Donghyeok Choe --- lib/debug-snapshot-helper.c | 6 +++--- lib/debug-snapshot-local.h | 2 +- lib/debug-snapshot-sysfs.c | 2 +- lib/debug-snapshot.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/debug-snapshot-helper.c b/lib/debug-snapshot-helper.c index a1061b1b881a..03ae0603bbda 100644 --- a/lib/debug-snapshot-helper.c +++ b/lib/debug-snapshot-helper.c @@ -156,7 +156,7 @@ unsigned int dbg_snapshot_get_item_size(char* name) { unsigned long i; - for (i = 0; i < dss_desc.log_enable_cnt; i++) { + for (i = 0; i < dss_desc.log_cnt; i++) { if (!strncmp(dss_items[i].name, name, strlen(name))) return dss_items[i].entry.size; } @@ -168,7 +168,7 @@ unsigned long dbg_snapshot_get_item_vaddr(char *name) { unsigned long i; - for (i = 0; i < dss_desc.log_enable_cnt; i++) { + for (i = 0; i < dss_desc.log_cnt; i++) { if (!strncmp(dss_items[i].name, name, strlen(name))) return dss_items[i].entry.vaddr; } @@ -179,7 +179,7 @@ unsigned int dbg_snapshot_get_item_paddr(char* name) { unsigned long i; - for (i = 0; i < dss_desc.log_enable_cnt; i++) { + for (i = 0; i < dss_desc.log_cnt; i++) { if (!strncmp(dss_items[i].name, name, strlen(name))) return dss_items[i].entry.paddr; } diff --git a/lib/debug-snapshot-local.h b/lib/debug-snapshot-local.h index 186a74429de1..d38b1fcef78a 100644 --- a/lib/debug-snapshot-local.h +++ b/lib/debug-snapshot-local.h @@ -164,7 +164,7 @@ struct dbg_snapshot_desc { unsigned int log_sfr_num; unsigned int log_pstore_num; unsigned int log_etm_num; - unsigned int log_enable_cnt; + unsigned int log_cnt; unsigned int callstack; unsigned long hardlockup_core_mask; diff --git a/lib/debug-snapshot-sysfs.c b/lib/debug-snapshot-sysfs.c index 17c5c09efadb..ed79f549f96a 100644 --- a/lib/debug-snapshot-sysfs.c +++ b/lib/debug-snapshot-sysfs.c @@ -55,7 +55,7 @@ static ssize_t dss_enable_show(struct kobject *kobj, ssize_t n = 0; /* item */ - for (i = 0; i < dss_desc.log_enable_cnt; i++) { + for (i = 0; i < dss_desc.log_cnt; i++) { item = &dss_items[i]; n += scnprintf(buf + n, 24, "%-12s : %sable\n", item->name, item->entry.enabled ? "en" : "dis"); diff --git a/lib/debug-snapshot.c b/lib/debug-snapshot.c index 8eee4b13daf4..8b8aad111d62 100644 --- a/lib/debug-snapshot.c +++ b/lib/debug-snapshot.c @@ -382,7 +382,7 @@ static int __init dbg_snapshot_remap(void) dss_items[i].curr_ptr = (unsigned char *)dss_items[i].entry.vaddr; } } - dss_desc.log_enable_cnt = enabled_count; + dss_desc.log_cnt = ARRAY_SIZE(dss_items); return enabled_count; } -- 2.20.1