RE: [PATCH V8 2/7] clk: imx: add scu clock common part
From: Aisheng Dong <aisheng.dong@nxp.com>
Date: 2018-12-06 00:42:01
Also in:
linux-clk
-----Original Message----- From: Stephen Boyd [mailto:sboyd@kernel.org] Quoting Aisheng DONG (2018-12-03 17:26:01)quoted
quoted
quoted
+}; + +/* + * struct imx_sc_msg_get_clock_rate - clock get rate protocol + * @hdr: SCU protocol header + * @req: get rate request protocol + * @resp: get rate response protocol + * + * This structure describes the SCU protocol of clock rate get +*/ struct imx_sc_msg_get_clock_rate { + struct imx_sc_rpc_msg hdr; + union { + struct req_get_clock_rate req; + struct resp_get_clock_rate resp; + } data; +} __packed;Does this need __packed? struct imx_sc_rpc_msg is naturally aligned so I think we don't need this.I think this is more safe way. But struct imx_sc_rpc_msg is unlikely to change. So I guess it's safe to remove it.If the struct is naturally aligned then I would say remove __packed and only add the marking if it is really needed. It makes more work now, but is cleaner to do it this way so we don't have to think about it later and we may be able to generate slightly better code if the compiler doesn't have to worry about packed either.
Thanks for the detailed explanation and it helps a further understanding. I've removed it and sent a updated patch series with all your suggestions addressed. https://patchwork.kernel.org/cover/10712007/ Please have a look at it. Regards Dong Aisheng _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel