Skip to content

Commit c6890f3

Browse files
arndbhtejun
authored andcommitted
workqueue: avoid unguarded 64-bit division
The printk() requires a division that is not allowed on 32-bit architectures: x86_64-linux-ld: lib/test_workqueue.o: in function `test_workqueue_init': test_workqueue.c:(.init.text+0x36f): undefined reference to `__udivdi3' Use div_u64() to print the resulting elapsed microseconds. Fixes: 24b2e73 ("workqueue: add test_workqueue benchmark module") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 41e3ccc commit c6890f3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/test_workqueue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static int __init run_bench(int n_threads, const char *scope, const char *label)
242242

243243
pr_info("test_workqueue: %-16s %llu items/sec\tp50=%llu\tp90=%llu\tp95=%llu ns\n",
244244
label,
245-
elapsed_us ? total_items * 1000000ULL / elapsed_us : 0,
245+
elapsed_us ? div_u64(total_items * 1000000ULL, elapsed_us) : 0,
246246
all_latencies[total_items * 50 / 100],
247247
all_latencies[total_items * 90 / 100],
248248
all_latencies[total_items * 95 / 100]);

0 commit comments

Comments
 (0)