mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tracing: Explicitly cast divisor to fix Coccinelle warning
@ 2024-03-18 10:52 Thorsten Blum
  2024-03-20 10:27 ` Masami Hiramatsu
  0 siblings, 1 reply; 6+ messages in thread
From: Thorsten Blum @ 2024-03-18 10:52 UTC (permalink / raw)
  To: Steven Rostedt, Masami Hiramatsu
  Cc: Mathieu Desnoyers, linux-kernel, linux-trace-kernel, Thorsten Blum

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

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
---
 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-03-29 16:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-18 10:52 [PATCH] tracing: Explicitly cast divisor to fix Coccinelle warning Thorsten Blum
2024-03-20 10:27 ` Masami Hiramatsu
2024-03-20 15:01   ` Thorsten Blum
2024-03-20 16:30     ` Thorsten Blum
2024-03-20 21:55       ` [PATCH v2] tracing: Improve performance by using do_div() Thorsten Blum
2024-03-29 16:02         ` [RESEND PATCH " Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®