1 From 9da39ef332c417ce52732564c1c682a6e1209302 Mon Sep 17 00:00:00 2001
2 From: Florian Eckert <fe@dev.tdt.de>
3 Date: Mon, 4 Dec 2023 15:13:35 +0100
4 Subject: [PATCH] tools/thermal/tmon: Fix compilation warning for wrong format
6 The following warnings are shown during compilation:
8 tui.c: In function 'show_cooling_device':
9 tui.c:216:40: warning: format '%d' expects argument of type 'int', but
10 argument 7 has type 'long unsigned int' [-Wformat=]
11 216 | "%02d %12.12s%6d %6d",
17 219 | ptdata.cdi[j].cur_state,
18 | ~~~~~~~~~~~~~~~~~~~~~~~
21 tui.c:216:44: warning: format '%d' expects argument of type 'int', but
22 argument 8 has type 'long unsigned int' [-Wformat=]
23 216 | "%02d %12.12s%6d %6d",
29 220 | ptdata.cdi[j].max_state);
30 | ~~~~~~~~~~~~~~~~~~~~~~~
34 To fix this, the correct string format must be used for printing.
36 Signed-off-by: Florian Eckert <fe@dev.tdt.de>
37 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
38 Link: https://lore.kernel.org/r/20231204141335.2798194-1-fe@dev.tdt.de
40 tools/thermal/tmon/tui.c | 2 +-
41 1 file changed, 1 insertion(+), 1 deletion(-)
43 --- a/tools/thermal/tmon/tui.c
44 +++ b/tools/thermal/tmon/tui.c
45 @@ -213,7 +213,7 @@ void show_cooling_device(void)
46 * cooling device instances. skip unused idr.
48 mvwprintw(cooling_device_window, j + 2, 1,
49 - "%02d %12.12s%6d %6d",
50 + "%02d %12.12s%6lu %6lu",
51 ptdata.cdi[j].instance,
53 ptdata.cdi[j].cur_state,