remoteproc: qcom: pil_info: avoid 64-bit division
authorArnd Bergmann <arnd@arndb.de>
Sun, 3 Jan 2021 13:56:12 +0000 (14:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 06:42:05 +0000 (08:42 +0200)
commitb267688ce0074109d49db14975731eb8c6690fec
tree3890d4b93ac521bbd581845e7af3a3989252f9a2
parentc7a175a24b0e44ea1547cf45ca8a8519dde76c7c
remoteproc: qcom: pil_info: avoid 64-bit division

[ Upstream commit 7029e783027706b427bbfbdf8558252c1dac6fa0 ]

On 32-bit machines with 64-bit resource_size_t, the driver causes
a link failure because of the 64-bit division:

arm-linux-gnueabi-ld: drivers/remoteproc/qcom_pil_info.o: in function `qcom_pil_info_store':
qcom_pil_info.c:(.text+0x1ec): undefined reference to `__aeabi_uldivmod'

Add a cast to an u32 to avoid this. If the resource exceeds 4GB,
there are bigger problems.

Fixes: 549b67da660d ("remoteproc: qcom: Introduce helper to store pil info in IMEM")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210103135628.3702427-1-arnd@kernel.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/remoteproc/qcom_pil_info.c