From 884cbe908331284b71b034008996851803f5ea0a Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 31 Jul 2026 13:47:31 +0200 Subject: [PATCH] MT#55283 kernel-module: Use do_div() instead of 64-bit division operator On some 32-bit architectures, such as armhf, the CPU does not have a 64-bit division instruction, and the compiler injects an intrinsic function reference (such as __aeabi_ldivmod) that is provided for example by libgcc. When compiling Linux kernel code, we are not using libgcc, so such references end up being undefined, failing the link. Instead we need to use support provided by the kernel itself. In this case the do_div() macro. Change-Id: I5ed60aee487e66d6fcfc2293644d773b6820c178 (cherry picked from commit b6889883634fa16a5d69d2d6cd9eed0c730d48d0) (cherry picked from commit bbf6181dfef40d094ee58d7ee5a9d0cc2e4be165) --- kernel-module/nft_rtpengine.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel-module/nft_rtpengine.c b/kernel-module/nft_rtpengine.c index 5b685de87..9bb32ff5b 100644 --- a/kernel-module/nft_rtpengine.c +++ b/kernel-module/nft_rtpengine.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -1698,6 +1699,7 @@ static int proc_list_show(struct seq_file *f, void *v) { struct rtpengine_target *g = v; unsigned int i, j; unsigned long flags; + uint64_t last_packet; seq_printf(f, "local "); seq_addr_print(f, &g->target.local); @@ -1728,8 +1730,9 @@ static int proc_list_show(struct seq_file *f, void *v) { g->target.pt_media_idx[i]); } - seq_printf(f, " last packet: %lli\n", - (long long) atomic64_read(&g->target.stats->last_packet_us) / 1000000L); + last_packet = atomic64_read(&g->target.stats->last_packet_us); + do_div(last_packet, 1000000L); + seq_printf(f, " last packet: %lli\n", (long long) last_packet); seq_printf(f, " SSRC in:"); for (i = 0; i < ARRAY_SIZE(g->target.ssrc); i++) {