diff options
Diffstat (limited to 'util/cbmem')
-rw-r--r-- | util/cbmem/cbmem.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c index 4c563c8d89..5cc55da376 100644 --- a/util/cbmem/cbmem.c +++ b/util/cbmem/cbmem.c @@ -362,7 +362,7 @@ static int parse_cbtable(u64 address, size_t table_size, uint8_t abort_on_failur #if defined(linux) && (defined(__i386__) || defined(__x86_64__)) /* - * read CPU frequency from a sysfs file, return an frequency in Kilohertz as + * read CPU frequency from a sysfs file, return an frequency in Megahertz as * an int or exit on any error. */ static unsigned long arch_tick_frequency(void) @@ -394,7 +394,8 @@ static unsigned long arch_tick_frequency(void) rv = strtoull(freqs, &endp, 10); if (*endp == '\0' || *endp == '\n') - return rv; + /* cpuinfo_max_freq is in kHz. Convert it to MHz. */ + return rv / 1000; fprintf(stderr, "Wrong formatted value ^%s^ read from %s\n", freqs, freq_file); exit(1); |