Patch "media: cxd2841er: fix 64-bit division on gcc-9" has been added to the 6.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    media: cxd2841er: fix 64-bit division on gcc-9

to the 6.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     media-cxd2841er-fix-64-bit-division-on-gcc-9.patch
and it can be found in the queue-6.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6dd2e2901dcc31baf8d011c7d402bb2661eaa3bf
Author: Arnd Bergmann <arnd@xxxxxxxx>
Date:   Mon Nov 11 11:41:42 2024 +0100

    media: cxd2841er: fix 64-bit division on gcc-9
    
    [ Upstream commit 8d46603eeeb4c6abff1d2e49f2a6ae289dac765e ]
    
    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@xxxxxxxxxx>
    Reported-by: Naresh Kamboju <naresh.kamboju@xxxxxxxxxx>
    Closes: https://lore.kernel.org/linux-media/CA+G9fYvvNm-aYodLaAwwTjEGtX0YxR-1R14FOA5aHKt0sSVsYg@xxxxxxxxxxxxxx/
    Reported-by: Linux Kernel Functional Testing <lkft@xxxxxxxxxx>
    Closes: https://lore.kernel.org/linux-media/CA+G9fYvvNm-aYodLaAwwTjEGtX0YxR-1R14FOA5aHKt0sSVsYg@xxxxxxxxxxxxxx/
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Signed-off-by: Hans Verkuil <hverkuil@xxxxxxxxx>
    [hverkuil: added Closes tags]
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c
index d925ca24183b5..415f1f91cc307 100644
--- a/drivers/media/dvb-frontends/cxd2841er.c
+++ b/drivers/media/dvb-frontends/cxd2841er.c
@@ -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)
 {
-	u64 tmp;
-
-	tmp = (u64) ifhz * 16777216;
-	do_div(tmp, ((xtal == SONY_XTAL_24000) ? 48000000 : 41000000));
-
-	return (u32) tmp;
+	return div_u64(ifhz * 16777216ull,
+		       (xtal == SONY_XTAL_24000) ? 48000000 : 41000000);
 }
 
 static u32 cxd2841er_calc_iffreq(u32 ifhz)




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux