From b69883693d2f0625dd9e3ea77a0546f57d2dd718 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 3e57259b73f9371416dbdbae7a6752c6133a4414) --- kernel-module/xt_RTPENGINE.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel-module/xt_RTPENGINE.c b/kernel-module/xt_RTPENGINE.c index b301c75d1..f94570630 100644 --- a/kernel-module/xt_RTPENGINE.c +++ b/kernel-module/xt_RTPENGINE.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -1691,6 +1692,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); @@ -1720,8 +1722,9 @@ static int proc_list_show(struct seq_file *f, void *v) { (unsigned long long) atomic64_read(&g->target.pt_stats[i]->packets)); } - 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++) {