Commit da080d98 authored by Thorsten Blum's avatar Thorsten Blum Committed by Vinod Koul
Browse files

dmaengine: dmatest: Explicitly cast divisor to u32



As the comment explains, the while loop ensures that runtime fits into
32 bits. Since do_div() casts the divisor to u32 anyway, explicitly cast
runtime to u32 to remove the following Coccinelle/coccicheck warning
reported by do_div.cocci:

  WARNING: do_div() does a 64-by-32 division, please consider using div64_s64 instead

Signed-off-by: default avatarThorsten Blum <thorsten.blum@toblux.com>
Link: https://lore.kernel.org/r/20240711132001.92157-1-thorsten.blum@toblux.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 8bce5522
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -500,7 +500,7 @@ static unsigned long long dmatest_persec(s64 runtime, unsigned int val)

	per_sec *= val;
	per_sec = INT_TO_FIXPT(per_sec);
	do_div(per_sec, runtime);
	do_div(per_sec, (u32)runtime);

	return per_sec;
}