rv: Fix 32-bit build of nomiss KUnit test

Commit 8da2a88383 ("rv: Add KUnit tests for some DA/HA monitors")
introduced a division of a 64-bit value by 1000 in the nomiss KUnit
test. This does not compile on 32-bit systems, as standard division of
64-bit values leads to an undefined reference to __udivdi3.

Fix the build on 32-bit systems by using div_u64().

Fixes: 8da2a88383 ("rv: Add KUnit tests for some DA/HA monitors")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202608020311.hYjqOG5k-lkp@intel.com
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/r/20260803150622.322806-1-gmonaco@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
This commit is contained in:
Gabriele Monaco 2026-08-03 17:06:22 +02:00
parent 984b5a36fd
commit 785095112f

View File

@ -28,7 +28,7 @@ static void rv_test_nomiss(struct kunit *test)
udelay(10);
rv_nomiss_ops.handle_sched_switch(NULL, 0, target, other, TASK_RUNNING);
RV_KUNIT_EXPECT_REACTION_HERE(test, ctx) {
udelay(15 + *rv_nomiss_ops.deadline_thresh / 1000);
udelay(15 + div_u64(*rv_nomiss_ops.deadline_thresh, 1000));
rv_nomiss_ops.handle_sched_switch(NULL, 0, other, target, TASK_RUNNING);
}
}