phy: qcom: use struct_size instead of sizeof
authorGuo Zhengkui <guozhengkui@vivo.com>
Thu, 9 Dec 2021 03:21:14 +0000 (11:21 +0800)
committerVinod Koul <vkoul@kernel.org>
Thu, 9 Dec 2021 11:54:54 +0000 (17:24 +0530)
commite87f13c33e126ab2c72f9acb5ae98fbb93ddfd32
tree22a22b89bc63bf767e111e87fe289d105e86e6c1
parent15aa1f668c5464fe201cf15d0d76f9429fdf163f
phy: qcom: use struct_size instead of sizeof

Use struct_size() to get the accurate size of `clk_hw_onecell_data`
with a variable size array, instead of sizeof(data) to get the size
of a pointer.

Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Guo Zhengkui <guozhengkui@vivo.com>
Fixes: f199223cb490 ("phy: qcom: Introduce new eDP PHY driver")
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211209032114.9416-1-guozhengkui@vivo.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/qualcomm/phy-qcom-edp.c