2021-03-09 06:34:29

by Yang Li

[permalink] [raw]
Subject: [PATCH] io_uring: remove unneeded variable 'ret'

Fix the following coccicheck warning:
./fs/io_uring.c:8984:5-8: Unneeded variable: "ret". Return "0" on line
8998

Reported-by: Abaci Robot <[email protected]>
Signed-off-by: Yang Li <[email protected]>
---
fs/io_uring.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 92c25b5..387dbb7 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8981,7 +8981,6 @@ static unsigned long io_uring_nommu_get_unmapped_area(struct file *file,

static int io_sqpoll_wait_sq(struct io_ring_ctx *ctx)
{
- int ret = 0;
DEFINE_WAIT(wait);

do {
@@ -8995,7 +8994,7 @@ static int io_sqpoll_wait_sq(struct io_ring_ctx *ctx)
} while (!signal_pending(current));

finish_wait(&ctx->sqo_sq_wait, &wait);
- return ret;
+ return 0;
}

static int io_get_ext_arg(unsigned flags, const void __user *argp, size_t *argsz,
--
1.8.3.1


2021-03-09 20:57:32

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH] io_uring: remove unneeded variable 'ret'

On 3/8/21 11:30 PM, Yang Li wrote:
> Fix the following coccicheck warning:
> ./fs/io_uring.c:8984:5-8: Unneeded variable: "ret". Return "0" on line
> 8998

Applied, thanks.

--
Jens Axboe