Skip to content

Commit 9da39ef

Browse files
feckertdlezcano
authored andcommitted
tools/thermal/tmon: Fix compilation warning for wrong format
The following warnings are shown during compilation: tui.c: In function 'show_cooling_device': tui.c:216:40: warning: format '%d' expects argument of type 'int', but argument 7 has type 'long unsigned int' [-Wformat=] 216 | "%02d %12.12s%6d %6d", | ~~^ | | | int | %6ld ...... 219 | ptdata.cdi[j].cur_state, | ~~~~~~~~~~~~~~~~~~~~~~~ | | | long unsigned int tui.c:216:44: warning: format '%d' expects argument of type 'int', but argument 8 has type 'long unsigned int' [-Wformat=] 216 | "%02d %12.12s%6d %6d", | ~~^ | | | int | %6ld ...... 220 | ptdata.cdi[j].max_state); | ~~~~~~~~~~~~~~~~~~~~~~~ | | | long unsigned int To fix this, the correct string format must be used for printing. Signed-off-by: Florian Eckert <fe@dev.tdt.de> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20231204141335.2798194-1-fe@dev.tdt.de
1 parent 4bddb0c commit 9da39ef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/thermal/tmon/tui.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ void show_cooling_device(void)
213213
* cooling device instances. skip unused idr.
214214
*/
215215
mvwprintw(cooling_device_window, j + 2, 1,
216-
"%02d %12.12s%6d %6d",
216+
"%02d %12.12s%6lu %6lu",
217217
ptdata.cdi[j].instance,
218218
ptdata.cdi[j].type,
219219
ptdata.cdi[j].cur_state,

0 commit comments

Comments
 (0)