From 355d2d4d934fc8675d475af1ae7928555ee776e9 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 069ce8ca165301942d3f82950401c85d47b89b17) --- 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 f40168923..19b192045 100644 --- a/kernel-module/nft_rtpengine.c +++ b/kernel-module/nft_rtpengine.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -1808,6 +1809,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); @@ -1838,8 +1840,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++) {