From 0a7a3ce7dcdc5a7296c57cde0a83092cf30d9462 Mon Sep 17 00:00:00 2001 From: Hao Xu Date: Wed, 18 Nov 2020 14:23:43 +0800 Subject: [PATCH 2227/2944] alinux: io_uring: fix compile warning in io_ioctl() fs/io_uring.c:4449:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] struct fd f = fdget(fd); Fixes: a06dffa17e66 ("alinux: io_uring: support ioctl") Signed-off-by: Hao Xu Acked-by: Joseph Qi --- fs/io_uring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 9e02614..141c3eb 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4420,6 +4420,7 @@ static int io_ioctl(struct io_kiocb *req, bool force_nonblock) unsigned int fd; unsigned int cmd; unsigned long arg; + struct fd f; cmd = req->ioctl.cmd; /* @@ -4434,8 +4435,7 @@ static int io_ioctl(struct io_kiocb *req, bool force_nonblock) fd = req->ioctl.fd; arg = req->ioctl.arg; - struct fd f = fdget(fd); - + f = fdget(fd); if (!f.file) return -EBADF; -- 1.8.3.1