summaryrefslogtreecommitdiffstats
path: root/io_uring/cancel.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-03-29 17:19:45 -0600
committerJens Axboe <axboe@kernel.dk>2024-04-15 08:10:26 -0600
commit1da2f311ba53a1ee106a637cf17aba05d2acc1ff (patch)
treecb0b80c63f554fc3bdf0427b885f60f05e071599 /io_uring/cancel.c
parentf15ed8b4d0ce2c0831232ff85117418740f0c529 (diff)
downloadlinux-1da2f311ba53a1ee106a637cf17aba05d2acc1ff.tar.gz
linux-1da2f311ba53a1ee106a637cf17aba05d2acc1ff.tar.bz2
linux-1da2f311ba53a1ee106a637cf17aba05d2acc1ff.zip
io_uring: fix warnings on shadow variables
There are a few of those: io_uring/fdinfo.c:170:16: warning: declaration shadows a local variable [-Wshadow] 170 | struct file *f = io_file_from_index(&ctx->file_table, i); | ^ io_uring/fdinfo.c:53:67: note: previous declaration is here 53 | __cold void io_uring_show_fdinfo(struct seq_file *m, struct file *f) | ^ io_uring/cancel.c:187:25: warning: declaration shadows a local variable [-Wshadow] 187 | struct io_uring_task *tctx = node->task->io_uring; | ^ io_uring/cancel.c:166:31: note: previous declaration is here 166 | struct io_uring_task *tctx, | ^ io_uring/register.c:371:25: warning: declaration shadows a local variable [-Wshadow] 371 | struct io_uring_task *tctx = node->task->io_uring; | ^ io_uring/register.c:312:24: note: previous declaration is here 312 | struct io_uring_task *tctx = NULL; | ^ and a simple cleanup gets rid of them. For the fdinfo case, make a distinction between the file being passed in (for the ring), and the registered files we iterate. For the other two cases, just get rid of shadowed variable, there's no reason to have a new one. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/cancel.c')
-rw-r--r--io_uring/cancel.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/io_uring/cancel.c b/io_uring/cancel.c
index acfcdd7f059a..a6e58a20efdd 100644
--- a/io_uring/cancel.c
+++ b/io_uring/cancel.c
@@ -184,9 +184,7 @@ static int __io_async_cancel(struct io_cancel_data *cd,
io_ring_submit_lock(ctx, issue_flags);
ret = -ENOENT;
list_for_each_entry(node, &ctx->tctx_list, ctx_node) {
- struct io_uring_task *tctx = node->task->io_uring;
-
- ret = io_async_cancel_one(tctx, cd);
+ ret = io_async_cancel_one(node->task->io_uring, cd);
if (ret != -ENOENT) {
if (!all)
break;