diff mbox

[v4,API-NEXT,12/12] linux-generic: sysinfo: rename variable cpu_hz to cpu_hz_max

Message ID 1452152313-27276-13-git-send-email-hongbo.zhang@linaro.org
State Superseded
Headers show

Commit Message

Hongbo Zhang Jan. 7, 2016, 7:38 a.m. UTC
From: Hongbo Zhang <hongbo.zhang@linaro.org>

The legacy variable cpu_hz holds the max frequency for odp_cpu_hz_max(),
so rename it to cpu_hz_max for better meaning.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
---
 platform/linux-generic/arch/mips64/odp_sysinfo_parse.c  | 2 +-
 platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c | 2 +-
 platform/linux-generic/arch/x86/odp_sysinfo_parse.c     | 3 ++-
 platform/linux-generic/include/odp_internal.h           | 2 +-
 platform/linux-generic/odp_system_info.c                | 4 ++--
 5 files changed, 7 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
index 868bd09..731e54c 100644
--- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
@@ -25,7 +25,7 @@  int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
 			if (pos) {
 				sscanf(pos, "BogoMIPS : %lf", &mhz);
 				/* bogomips seems to be 2x freq */
-				sysinfo->cpu_hz[id] = \
+				sysinfo->cpu_hz_max[id] = \
 					(uint64_t)(mhz * 1000000.0 / 2.0);
 				count--;
 			}
diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
index 2baed1e..9515757 100644
--- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
@@ -24,7 +24,7 @@  int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
 
 			if (pos) {
 				sscanf(pos, "clock : %lf", &mhz);
-				sysinfo->cpu_hz[id] = \
+				sysinfo->cpu_hz_max[id] = \
 					(uint64_t)(mhz * 1000000.0);
 				count--;
 			}
diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
index 02ec9ea..49e7f93 100644
--- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
@@ -26,7 +26,8 @@  int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
 			pos = strchr(sysinfo->model_str[id], '@');
 			*(pos - 1) = '\0';
 			if (sscanf(pos, "@ %lfGHz", &ghz) == 1)
-				sysinfo->cpu_hz[id] = (uint64_t)(ghz * 1000000000.0);
+				sysinfo->cpu_hz_max[id] = \
+					(uint64_t)(ghz * 1000000000.0);
 
 			id++;
 		}
diff --git a/platform/linux-generic/include/odp_internal.h b/platform/linux-generic/include/odp_internal.h
index 2eeba42..c6b98b0 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -26,7 +26,7 @@  extern __thread int __odp_errno;
 #define MAX_CPU_NUMBER 128
 
 typedef struct {
-	uint64_t cpu_hz[MAX_CPU_NUMBER];
+	uint64_t cpu_hz_max[MAX_CPU_NUMBER];
 	uint64_t huge_page_size;
 	uint64_t page_size;
 	int      cache_line_size;
diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c
index ed0897d..6df529e 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -169,7 +169,7 @@  static int systemcpu(odp_system_info_t *sysinfo)
 	ODP_DBG("Warning: use dummy values for freq and model string\n");
 	ODP_DBG("Refer to https://bugs.linaro.org/show_bug.cgi?id=1870\n");
 	for (i = 0; i < MAX_CPU_NUMBER; i++) {
-		sysinfo->cpu_hz[i] = 1400000000;
+		sysinfo->cpu_hz_max[i] = 1400000000;
 		strcpy(sysinfo->model_str[i], "UNKNOWN");
 	}
 
@@ -232,7 +232,7 @@  uint64_t odp_cpu_hz_max(void)
 uint64_t odp_cpu_hz_max_id(int id)
 {
 	if (id >= 0 && id < MAX_CPU_NUMBER)
-		return odp_global_data.system_info.cpu_hz[id];
+		return odp_global_data.system_info.cpu_hz_max[id];
 	else
 		return 0;
 }