cpu_freq: Change to 64 bit integers Remove unnecessary cast to size_t
Aaron Marcher me@drkhsh.at
Sat, 07 Jul 2018 10:54:12 +0200
1 files changed,
3 insertions(+),
2 deletions(-)
jump to
M
components/cpu.c
→
components/cpu.c
@@ -53,7 +53,8 @@
const char * cpu_freq(void) { - int freq, mib[2]; + int mib[2]; + uintmax_t freq; size_t size; mib[0] = CTL_HW;@@ -67,7 +68,7 @@ warn("sysctl 'HW_CPUSPEED':");
return NULL; } - return fmt_human((size_t)freq * 1000 * 1000, 1000); + return fmt_human(freq * 1000 * 1000, 1000); } const char *