diff mbox series

thermal: imx_sc_thermal: Fix incorrect data type

Message ID 1584606380-9972-1-git-send-email-Anson.Huang@nxp.com (mailing list archive)
State Mainlined
Commit 968ea0dffa9396e9f8e00f12fd69be95f5a09191
Headers show
Series thermal: imx_sc_thermal: Fix incorrect data type | expand

Commit Message

Anson Huang March 19, 2020, 8:26 a.m. UTC
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(-)

Comments

Amit Kucheria March 19, 2020, 8:54 a.m. UTC | #1
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
>
Daniel Lezcano March 19, 2020, 11:55 a.m. UTC | #2
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 {
>
diff mbox series

Patch

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 {