kernel: bump 6.6 to 6.6.26
[openwrt/openwrt.git] / target / linux / generic / pending-6.6 / 980-tools-thermal-tmon-Fix-compilation-warning-for-wrong.patch
1 From a7a94ca21ac0f347f683d33c72b4aab57ce5eec3 Mon Sep 17 00:00:00 2001
2 From: Florian Eckert <fe@dev.tdt.de>
3 Date: Mon, 20 Nov 2023 11:13:20 +0100
4 Subject: [PATCH] tools/thermal/tmon: Fix compilation warning for wrong format
5
6 The following warnings are shown during compilation:
7
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",
12 | ~~^
13 | |
14 | int
15 | %6ld
16 ......
17 219 | ptdata.cdi[j].cur_state,
18 | ~~~~~~~~~~~~~~~~~~~~~~~
19 | |
20 | long unsigned int
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",
24 | ~~^
25 | |
26 | int
27 | %6ld
28 ......
29 220 | ptdata.cdi[j].max_state);
30 | ~~~~~~~~~~~~~~~~~~~~~~~
31 | |
32 | long unsigned int
33
34 To fix this, the correct string format must be used for printing.
35
36 Signed-off-by: Florian Eckert <fe@dev.tdt.de>
37 ---
38 tools/thermal/tmon/tui.c | 2 +-
39 1 file changed, 1 insertion(+), 1 deletion(-)
40
41 --- a/tools/thermal/tmon/tui.c
42 +++ b/tools/thermal/tmon/tui.c
43 @@ -213,7 +213,7 @@ void show_cooling_device(void)
44 * cooling device instances. skip unused idr.
45 */
46 mvwprintw(cooling_device_window, j + 2, 1,
47 - "%02d %12.12s%6d %6d",
48 + "%02d %12.12s%6lu %6lu",
49 ptdata.cdi[j].instance,
50 ptdata.cdi[j].type,
51 ptdata.cdi[j].cur_state,