diff mbox series

io_uring/napi: Remove unnecessary s64 cast

Message ID 20240710010520.384009-2-thorsten.blum@toblux.com (mailing list archive)
State New
Headers show
Series io_uring/napi: Remove unnecessary s64 cast | expand

Commit Message

Thorsten Blum July 10, 2024, 1:05 a.m. UTC
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 <thorsten.blum@toblux.com>
---
 io_uring/napi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jens Axboe July 10, 2024, 6:23 a.m. UTC | #1
On Wed, 10 Jul 2024 03:05:21 +0200, Thorsten Blum wrote:
> 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
> 
> 
> [...]

Applied, thanks!

[1/1] io_uring/napi: Remove unnecessary s64 cast
      commit: f7c696a56cc7d70515774a24057b473757ec6089

Best regards,
diff mbox series

Patch

diff --git a/io_uring/napi.c b/io_uring/napi.c
index 8c18ede595c4..762254a7ff3f 100644
--- a/io_uring/napi.c
+++ b/io_uring/napi.c
@@ -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;
 			}
 		}