Skip to contentSkip to conversation

thermal: imx_sc_thermal: Fix incorrect data type

PATCH Applied Anson Huang 3 participants 3 messages Mar 19, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: imx_sc_thermal: Fix incorrect data type

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")
---
 drivers/thermal/imx_sc_thermal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/imx_sc_thermal.c +2 -2
index dbb277a..a8723b1 100644
@@ -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 {
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Anson Huang

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")
Quoted 22 lines
---
 drivers/thermal/imx_sc_thermal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/imx_sc_thermal.c +2 -3
index dbb277a..a8723b1 100644
@@ -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

#2 lore raw
In reply to Anson Huang
Quoted 5 lines · Anson Huang

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

Applied, thanks

Quoted 20 lines
---
 drivers/thermal/imx_sc_thermal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thermal/imx_sc_thermal.c +2 -2
index dbb277a..a8723b1 100644
@@ -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 {
Signature · 11 lines
 <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


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel