[PATCH] tracing: Explicitly cast divisor to fix Coccinelle warning

From: Thorsten Blum
Date: Mon Mar 18 2024 - 06:54:39 EST


Explicitly cast the divisor to u32 to fix a Coccinelle/coccicheck warning
reported by do_div.cocci.

Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxxx>
---
kernel/trace/trace_benchmark.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_benchmark.c b/kernel/trace/trace_benchmark.c
index 54d5fa35c90a..218b40050629 100644
--- a/kernel/trace/trace_benchmark.c
+++ b/kernel/trace/trace_benchmark.c
@@ -105,7 +105,7 @@ static void trace_do_benchmark(void)
stddev = 0;

delta = bm_total;
- do_div(delta, bm_cnt);
+ do_div(delta, (u32)bm_cnt);
avg = delta;

if (stddev > 0) {
--
2.44.0