Skip to contentSkip to conversation

Fix 32-bit build of nomiss KUnit test

PATCH In review Gabriele Monaco 2 participants 2 messages Aug 3 – Aug 4

Subsystems (2)
lore
Share & tools
lore

Gabriele Monaco

author maintainer
#0 lore raw

PATCH 1/1 Fix 32-bit build of nomiss KUnit test

Commit 8da2a8838365 ("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 8da2a8838365 ("rv: Add KUnit tests for some DA/HA monitors")
---
 kernel/trace/rv/monitors/nomiss/nomiss_kunit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/rv/monitors/nomiss/nomiss_kunit.c +1 -1
index 1f64249dfcce..763129e2a990 100644
@@ -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);
 	}
 }

base-commit: 984b5a36fd12d1849511a45fda32036fe2b0d004

Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Gabriele Monaco

Commit 8da2a8838365 ("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 8da2a8838365 ("rv: Add KUnit tests for some DA/HA monitors")