Skip to content

Commit da080d9

Browse files
tobluxvinodkoul
authored andcommitted
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: Thorsten Blum <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 8bce552 commit da080d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/dmatest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ static unsigned long long dmatest_persec(s64 runtime, unsigned int val)
500500

501501
per_sec *= val;
502502
per_sec = INT_TO_FIXPT(per_sec);
503-
do_div(per_sec, runtime);
503+
do_div(per_sec, (u32)runtime);
504504

505505
return per_sec;
506506
}

0 commit comments

Comments
 (0)