Skip to content

Commit

Permalink
io_uring/napi: Remove unnecessary s64 cast
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
toblux authored and axboe committed Jul 10, 2024
1 parent 93d8032 commit f7c696a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion io_uring/napi.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ void __io_napi_adjust_timeout(struct io_ring_ctx *ctx, struct io_wait_queue *iow
s64 poll_to_ns = timespec64_to_ns(ts);
if (poll_to_ns > 0) {
u64 val = poll_to_ns + 999;
do_div(val, (s64) 1000);
do_div(val, 1000);
poll_to = val;
}
}
Expand Down

0 comments on commit f7c696a

Please sign in to comment.