mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-22 20:30:58 +02:00
media: cxd2841er: fix 64-bit division on gcc-9
It appears that do_div() once more gets confused by a complex expression that ends up not quite being constant despite __builtin_constant_p() thinking it is: ERROR: modpost: "__aeabi_uldivmod" [drivers/media/dvb-frontends/cxd2841er.ko] undefined! Use div_u64() instead, forcing the expression to be evaluated first, and making it a bit more readable. Cc: Dan Carpenter <dan.carpenter@linaro.org> Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Closes: https://lore.kernel.org/linux-media/CA+G9fYvvNm-aYodLaAwwTjEGtX0YxR-1R14FOA5aHKt0sSVsYg@mail.gmail.com/ Reported-by: Linux Kernel Functional Testing <lkft@linaro.org> Closes: https://lore.kernel.org/linux-media/CA+G9fYvvNm-aYodLaAwwTjEGtX0YxR-1R14FOA5aHKt0sSVsYg@mail.gmail.com/ Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> [hverkuil: added Closes tags]
This commit is contained in:
@@ -311,12 +311,8 @@ static int cxd2841er_set_reg_bits(struct cxd2841er_priv *priv,
|
|||||||
|
|
||||||
static u32 cxd2841er_calc_iffreq_xtal(enum cxd2841er_xtal xtal, u32 ifhz)
|
static u32 cxd2841er_calc_iffreq_xtal(enum cxd2841er_xtal xtal, u32 ifhz)
|
||||||
{
|
{
|
||||||
u64 tmp;
|
return div_u64(ifhz * 16777216ull,
|
||||||
|
(xtal == SONY_XTAL_24000) ? 48000000 : 41000000);
|
||||||
tmp = (u64) ifhz * 16777216;
|
|
||||||
do_div(tmp, ((xtal == SONY_XTAL_24000) ? 48000000 : 41000000));
|
|
||||||
|
|
||||||
return (u32) tmp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 cxd2841er_calc_iffreq(u32 ifhz)
|
static u32 cxd2841er_calc_iffreq(u32 ifhz)
|
||||||
|
Reference in New Issue
Block a user