Commit 1fd213f3 authored by Anson Huang's avatar Anson Huang Committed by Daniel Lezcano

thermal: imx_sc_thermal: Align imx sc thermal msg structs to 4

The i.MX SCU API strongly assumes that messages are composed out
of 4-bytes words but some of our message structs have odd sizeofs,
use __packed __aligned(4) to avoid potential oopses.
Signed-off-by: default avatarAnson Huang <Anson.Huang@nxp.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/1583117485-30922-1-git-send-email-Anson.Huang@nxp.com
parent 7375f2ac
...@@ -27,12 +27,12 @@ struct imx_sc_sensor { ...@@ -27,12 +27,12 @@ struct imx_sc_sensor {
struct req_get_temp { struct req_get_temp {
u16 resource_id; u16 resource_id;
u8 type; u8 type;
} __packed; } __packed __aligned(4);
struct resp_get_temp { struct resp_get_temp {
u16 celsius; u16 celsius;
u8 tenths; u8 tenths;
} __packed; } __packed __aligned(4);
struct imx_sc_msg_misc_get_temp { struct imx_sc_msg_misc_get_temp {
struct imx_sc_rpc_msg hdr; struct imx_sc_rpc_msg hdr;
...@@ -40,7 +40,7 @@ struct imx_sc_msg_misc_get_temp { ...@@ -40,7 +40,7 @@ struct imx_sc_msg_misc_get_temp {
struct req_get_temp req; struct req_get_temp req;
struct resp_get_temp resp; struct resp_get_temp resp;
} data; } data;
}; } __packed __aligned(4);
static int imx_sc_thermal_get_temp(void *data, int *temp) static int imx_sc_thermal_get_temp(void *data, int *temp)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment