diff mbox series

[thermal:,thermal/next] thermal/tools/tmon: Include pthread and time headers in tmon.h

Message ID 165902290212.15455.15524124968973893519.tip-bot2@tip-bot2
State New
Headers show
Series [thermal:,thermal/next] thermal/tools/tmon: Include pthread and time headers in tmon.h | expand

Commit Message

thermal-bot for Lad Prabhakar July 28, 2022, 3:41 p.m. UTC
The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     0cf51bfe999524377fbb71becb583b4ca6d07cfc
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//0cf51bfe999524377fbb71becb583b4ca6d07cfc
Author:        Markus Mayer <mmayer@broadcom.com>
AuthorDate:    Sun, 17 Jul 2022 20:10:39 -07:00
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Thu, 28 Jul 2022 17:29:51 +02:00

thermal/tools/tmon: Include pthread and time headers in tmon.h

Include sys/time.h and pthread.h in tmon.h, so that types
"pthread_mutex_t" and "struct timeval tv" are known when tmon.h
references them.

Without these headers, compiling tmon against musl-libc will fail with
these errors:

In file included from sysfs.c:31:0:
tmon.h:47:8: error: unknown type name 'pthread_mutex_t'
 extern pthread_mutex_t input_lock;
        ^~~~~~~~~~~~~~~
make[3]: *** [<builtin>: sysfs.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from tui.c:31:0:
tmon.h:54:17: error: field 'tv' has incomplete type
  struct timeval tv;
                 ^~
make[3]: *** [<builtin>: tui.o] Error 1
make[2]: *** [Makefile:83: tmon] Error 2

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Acked-by: Alejandro González <alejandro.gonzalez.correo@gmail.com>
Tested-by: Alejandro González <alejandro.gonzalez.correo@gmail.com>
Fixes: 94f69966faf8 ("tools/thermal: Introduce tmon, a tool for thermal  subsystem")
Link: https://lore.kernel.org/r/20220718031040.44714-1-f.fainelli@gmail.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 tools/thermal/tmon/tmon.h | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/tools/thermal/tmon/tmon.h b/tools/thermal/tmon/tmon.h
index c9066ec..44d16d7 100644
--- a/tools/thermal/tmon/tmon.h
+++ b/tools/thermal/tmon/tmon.h
@@ -27,6 +27,9 @@ 
 #define NR_LINES_TZDATA 1
 #define TMON_LOG_FILE "/var/tmp/tmon.log"
 
+#include <sys/time.h>
+#include <pthread.h>
+
 extern unsigned long ticktime;
 extern double time_elapsed;
 extern unsigned long target_temp_user;