LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] thermal: imx_sc_thermal: Fix incorrect data type
@ 2020-03-19  8:26 Anson Huang
  2020-03-19  8:54 ` Amit Kucheria
  2020-03-19 11:55 ` Daniel Lezcano
  0 siblings, 2 replies; 3+ messages in thread
From: Anson Huang @ 2020-03-19  8:26 UTC (permalink / raw)
  To: rui.zhang, daniel.lezcano, amit.kucheria, shawnguo, s.hauer,
	kernel, festevam, linux-pm, linux-arm-kernel, linux-kernel
  Cc: Linux-imx

The temperature value passed from SCU could be negative value,
the data type should be signed instead of unsigned.

Fixes: ed0843633fee ("thermal: imx_sc: add i.MX system controller thermal support")
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/thermal/imx_sc_thermal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c
index dbb277a..a8723b1 100644
--- a/drivers/thermal/imx_sc_thermal.c
+++ b/drivers/thermal/imx_sc_thermal.c
@@ -30,8 +30,8 @@ struct req_get_temp {
 } __packed __aligned(4);
 
 struct resp_get_temp {
-	u16 celsius;
-	u8 tenths;
+	s16 celsius;
+	s8 tenths;
 } __packed __aligned(4);
 
 struct imx_sc_msg_misc_get_temp {
-- 
2.7.4


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

* Re: [PATCH] thermal: imx_sc_thermal: Fix incorrect data type
  2020-03-19  8:26 [PATCH] thermal: imx_sc_thermal: Fix incorrect data type Anson Huang
@ 2020-03-19  8:54 ` Amit Kucheria
  2020-03-19 11:55 ` Daniel Lezcano
  1 sibling, 0 replies; 3+ messages in thread
From: Amit Kucheria @ 2020-03-19  8:54 UTC (permalink / raw)
  To: Anson Huang
  Cc: Zhang Rui, Daniel Lezcano, Shawn Guo, Sascha Hauer, kernel,
	Fabio Estevam, Linux PM list, lakml, LKML, Linux-imx

On Thu, Mar 19, 2020 at 2:03 PM Anson Huang <Anson.Huang@nxp.com> wrote:
>
> The temperature value passed from SCU could be negative value,
> the data type should be signed instead of unsigned.
>
> Fixes: ed0843633fee ("thermal: imx_sc: add i.MX system controller thermal support")
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>

> ---
>  drivers/thermal/imx_sc_thermal.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c
> index dbb277a..a8723b1 100644
> --- a/drivers/thermal/imx_sc_thermal.c
> +++ b/drivers/thermal/imx_sc_thermal.c
> @@ -30,8 +30,8 @@ struct req_get_temp {
>  } __packed __aligned(4);
>
>  struct resp_get_temp {
> -       u16 celsius;
> -       u8 tenths;
> +       s16 celsius;
> +       s8 tenths;
>  } __packed __aligned(4);
>
>  struct imx_sc_msg_misc_get_temp {
> --
> 2.7.4
>

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

* Re: [PATCH] thermal: imx_sc_thermal: Fix incorrect data type
  2020-03-19  8:26 [PATCH] thermal: imx_sc_thermal: Fix incorrect data type Anson Huang
  2020-03-19  8:54 ` Amit Kucheria
@ 2020-03-19 11:55 ` Daniel Lezcano
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Lezcano @ 2020-03-19 11:55 UTC (permalink / raw)
  To: Anson Huang, rui.zhang, amit.kucheria, shawnguo, s.hauer, kernel,
	festevam, linux-pm, linux-arm-kernel, linux-kernel
  Cc: Linux-imx

On 19/03/2020 09:26, Anson Huang wrote:
> The temperature value passed from SCU could be negative value,
> the data type should be signed instead of unsigned.
> 
> Fixes: ed0843633fee ("thermal: imx_sc: add i.MX system controller thermal support")
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Applied, thanks

> ---
>  drivers/thermal/imx_sc_thermal.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c
> index dbb277a..a8723b1 100644
> --- a/drivers/thermal/imx_sc_thermal.c
> +++ b/drivers/thermal/imx_sc_thermal.c
> @@ -30,8 +30,8 @@ struct req_get_temp {
>  } __packed __aligned(4);
>  
>  struct resp_get_temp {
> -	u16 celsius;
> -	u8 tenths;
> +	s16 celsius;
> +	s8 tenths;
>  } __packed __aligned(4);
>  
>  struct imx_sc_msg_misc_get_temp {
> 


-- 
 <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

end of thread, other threads:[~2020-03-19 11:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19  8:26 [PATCH] thermal: imx_sc_thermal: Fix incorrect data type Anson Huang
2020-03-19  8:54 ` Amit Kucheria
2020-03-19 11:55 ` Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).