Skip to content

Commit f7c696a

Browse files
tobluxaxboe
authored andcommitted
io_uring/napi: Remove unnecessary s64 cast
Since the do_div() macro casts the divisor to u32 anyway, remove the unnecessary s64 cast and fix 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: Jens Axboe <[email protected]>
1 parent 93d8032 commit f7c696a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/napi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void __io_napi_adjust_timeout(struct io_ring_ctx *ctx, struct io_wait_queue *iow
283283
s64 poll_to_ns = timespec64_to_ns(ts);
284284
if (poll_to_ns > 0) {
285285
u64 val = poll_to_ns + 999;
286-
do_div(val, (s64) 1000);
286+
do_div(val, 1000);
287287
poll_to = val;
288288
}
289289
}

0 commit comments

Comments
 (0)