Skip to contentSkip to conversation

cpupower: Include stdint.h for int64_t in the CPPC helper

PATCH In review Florian Fainelli 2 participants 2 messages Oct 20 – Oct 21 CPU power monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpupower: Include stdint.h for int64_t in the CPPC helper

cppc_show_perf_and_freq() uses int64_t without including the header that defines it. Building cpupower against musl fails with "unknown type name 'int64_t'" because the other included headers do not provide the type.

Include stdint.h directly instead of relying on transitive declarations from other C library headers.

Fixes 68f34fad760b ("cpupower: Add generic CPPC performance display")
---
 tools/power/cpupower/utils/helpers/cppc.c | 1 +
 1 file changed, 1 insertion(+)
tools/power/cpupower/utils/helpers/cppc.c +1 -0
index 3493ce8551ea..e0e9784fe589 100644
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0
 
 #include <stdio.h>
+#include <stdint.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 18 lines · Florian Fainelli

cppc_show_perf_and_freq() uses int64_t without including the header that defines it. Building cpupower against musl fails with "unknown type name 'int64_t'" because the other included headers do not provide the type.

Include stdint.h directly instead of relying on transitive declarations from other C library headers.

Fixes 68f34fad760b ("cpupower: Add generic CPPC performance display")
---
  tools/power/cpupower/utils/helpers/cppc.c | 1 +
  1 file changed, 1 insertion(+)
tools/power/cpupower/utils/helpers/cppc.c +0 -0
index 3493ce8551ea..e0e9784fe589 100644

tools/power/cpupower/utils/helpers/cppc.c line 7

Quoted 7 lines
tools/power/cpupower/utils/helpers/cppc.c +1 -0
@@ -1,6 +1,7 @@
  // SPDX-License-Identifier: GPL-2.0
 
  #include <stdio.h>
+#include <stdint.h>
  #include <errno.h>
  #include <stdlib.h>
  #include <string.h>

Looks good, thanks