iwlwifi: fix build warnings with format string
diff mbox series

Message ID 1578322389-13716-1-git-send-email-akinobu.mita@gmail.com
State In Next
Commit dd44f8c98ef7d452af956d1b7742a5a686a11800
Headers show
Series
  • iwlwifi: fix build warnings with format string
Related show

Commit Message

Akinobu Mita Jan. 6, 2020, 2:53 p.m. UTC
This fixes build warnings introduced by commit "iwlegacy: use
<linux/units.h> helpers" (iwlegacy-use-linux-unitsh-helpers.patch in -mm)

The format '%d' has to be changed to '%ld' because the return type of
kelvin_to_celsius() is 'long'.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/r/20200106171452.201c3b4c@canb.auug.org.au
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
 drivers/net/wireless/intel/iwlegacy/4965.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Kalle Valo Jan. 10, 2020, 1:16 p.m. UTC | #1
(please cc linux-wireless on all wireless patches)

Akinobu Mita <akinobu.mita@gmail.com> writes:

> This fixes build warnings introduced by commit "iwlegacy: use
> <linux/units.h> helpers" (iwlegacy-use-linux-unitsh-helpers.patch in -mm)
>
> The format '%d' has to be changed to '%ld' because the return type of
> kelvin_to_celsius() is 'long'.
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Link: https://lore.kernel.org/r/20200106171452.201c3b4c@canb.auug.org.au
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: Stanislaw Gruszka <stf_xl@wp.pl>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>

I don't know what's Andrew's workflow, but shouldn't the original patch
be fixed instead?

Patch
diff mbox series

diff --git a/drivers/net/wireless/intel/iwlegacy/4965.c b/drivers/net/wireless/intel/iwlegacy/4965.c
index 31b346c..34d0579 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965.c
@@ -1611,7 +1611,7 @@  il4965_hw_get_temperature(struct il_priv *il)
 	temperature =
 	    (temperature * 97) / 100 + TEMPERATURE_CALIB_KELVIN_OFFSET;
 
-	D_TEMP("Calibrated temperature: %dK, %dC\n", temperature,
+	D_TEMP("Calibrated temperature: %dK, %ldC\n", temperature,
 	       kelvin_to_celsius(temperature));
 
 	return temperature;
@@ -1671,11 +1671,11 @@  il4965_temperature_calib(struct il_priv *il)
 
 	if (il->temperature != temp) {
 		if (il->temperature)
-			D_TEMP("Temperature changed " "from %dC to %dC\n",
+			D_TEMP("Temperature changed " "from %ldC to %ldC\n",
 			       kelvin_to_celsius(il->temperature),
 			       kelvin_to_celsius(temp));
 		else
-			D_TEMP("Temperature " "initialized to %dC\n",
+			D_TEMP("Temperature " "initialized to %ldC\n",
 			       kelvin_to_celsius(temp));
 	}