io_uring: remove redundant variable pointer nxt and io_wq_assign_next call
diff mbox series

Message ID 20200406225439.654486-1-colin.king@canonical.com
State New
Headers show
Series
  • io_uring: remove redundant variable pointer nxt and io_wq_assign_next call
Related show

Commit Message

Colin King April 6, 2020, 10:54 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

An earlier commit "io_uring: remove @nxt from handlers" removed the
setting of pointer nxt and now it is always null, hence the non-null
check and call to io_wq_assign_next is redundant and can be removed.

Addresses-Coverity: ("'Constant' variable guard")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/io_uring.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Chaitanya Kulkarni April 6, 2020, 10:59 p.m. UTC | #1
On 04/06/2020 03:54 PM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> An earlier commit "io_uring: remove @nxt from handlers" removed the
> setting of pointer nxt and now it is always null, hence the non-null
> check and call to io_wq_assign_next is redundant and can be removed.
>
> Addresses-Coverity: ("'Constant' variable guard")
> Signed-off-by: Colin Ian King<colin.king@canonical.com>

Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Jens Axboe April 6, 2020, 11:33 p.m. UTC | #2
On 4/6/20 3:54 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> An earlier commit "io_uring: remove @nxt from handlers" removed the
> setting of pointer nxt and now it is always null, hence the non-null
> check and call to io_wq_assign_next is redundant and can be removed.

Thanks, applied.
Pavel Begunkov April 7, 2020, 6:12 a.m. UTC | #3
On 07/04/2020 01:54, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> An earlier commit "io_uring: remove @nxt from handlers" removed the
> setting of pointer nxt and now it is always null, hence the non-null
> check and call to io_wq_assign_next is redundant and can be removed.
> 
> Addresses-Coverity: ("'Constant' variable guard")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  fs/io_uring.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 14efcf0a3070..b594fa0bd210 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -3509,14 +3509,11 @@ static void __io_sync_file_range(struct io_kiocb *req)
>  static void io_sync_file_range_finish(struct io_wq_work **workptr)
>  {
>  	struct io_kiocb *req = container_of(*workptr, struct io_kiocb, work);
> -	struct io_kiocb *nxt = NULL;
>  
>  	if (io_req_cancelled(req))
>  		return;
>  	__io_sync_file_range(req);
>  	io_put_req(req); /* put submission ref */
> -	if (nxt)
> -		io_wq_assign_next(workptr, nxt);

Works, but it should be io_steal_work() instead

Patch
diff mbox series

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 14efcf0a3070..b594fa0bd210 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3509,14 +3509,11 @@  static void __io_sync_file_range(struct io_kiocb *req)
 static void io_sync_file_range_finish(struct io_wq_work **workptr)
 {
 	struct io_kiocb *req = container_of(*workptr, struct io_kiocb, work);
-	struct io_kiocb *nxt = NULL;
 
 	if (io_req_cancelled(req))
 		return;
 	__io_sync_file_range(req);
 	io_put_req(req); /* put submission ref */
-	if (nxt)
-		io_wq_assign_next(workptr, nxt);
 }
 
 static int io_sync_file_range(struct io_kiocb *req, bool force_nonblock)