public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/thermal/tmon: Fix compilation warning for wrong format
@ 2023-12-04 14:13 Florian Eckert
  2023-12-19 18:12 ` Daniel Lezcano
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Eckert @ 2023-12-04 14:13 UTC (permalink / raw)
  To: Eckert.Florian, rafael, daniel.lezcano, rui.zhang, lukasz.luba
  Cc: linux-pm, linux-kernel

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>
---
 tools/thermal/tmon/tui.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/thermal/tmon/tui.c b/tools/thermal/tmon/tui.c
index 031b258667d8..7f5dd2b87f15 100644
--- a/tools/thermal/tmon/tui.c
+++ b/tools/thermal/tmon/tui.c
@@ -213,7 +213,7 @@ void show_cooling_device(void)
 		 * cooling device instances. skip unused idr.
 		 */
 		mvwprintw(cooling_device_window, j + 2, 1,
-			"%02d %12.12s%6d %6d",
+			"%02d %12.12s%6lu %6lu",
 			ptdata.cdi[j].instance,
 			ptdata.cdi[j].type,
 			ptdata.cdi[j].cur_state,
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/thermal/tmon: Fix compilation warning for wrong format
  2023-12-04 14:13 [PATCH] tools/thermal/tmon: Fix compilation warning for wrong format Florian Eckert
@ 2023-12-19 18:12 ` Daniel Lezcano
  2023-12-20  7:30   ` Florian Eckert
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Lezcano @ 2023-12-19 18:12 UTC (permalink / raw)
  To: Florian Eckert, Eckert.Florian, rafael, rui.zhang, lukasz.luba
  Cc: linux-pm, linux-kernel

On 04/12/2023 15:13, Florian Eckert wrote:
> 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>
> ---

Applied, thanks

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tools/thermal/tmon: Fix compilation warning for wrong format
  2023-12-19 18:12 ` Daniel Lezcano
@ 2023-12-20  7:30   ` Florian Eckert
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Eckert @ 2023-12-20  7:30 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Eckert.Florian, rafael, rui.zhang, lukasz.luba, linux-pm,
	linux-kernel



On 2023-12-19 19:12, Daniel Lezcano wrote:
> On 04/12/2023 15:13, Florian Eckert wrote:
>> 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>
>> ---
> 
> Applied, thanks

Thanks :+1:

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-20  7:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-04 14:13 [PATCH] tools/thermal/tmon: Fix compilation warning for wrong format Florian Eckert
2023-12-19 18:12 ` Daniel Lezcano
2023-12-20  7:30   ` Florian Eckert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox