fs/aio.c | 1 - 1 file changed, 1 deletion(-)
Commit 84c4e1f89fef ("aio: simplify - and fix - fget/fput for io_submit()")
refactored aio_read() and some error cases into early return, which made
some intermediate assignment of the return variable needless.
Drop this needless assignment in aio_read().
No functional change. No change in resulting object code.
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
I cc'ed Linus as he is the author of the referred commit, but I expect
that this clean-up just goes the usual way to Al Viro and then in some
git pull to Linus.
fs/aio.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/aio.c b/fs/aio.c
index eb0948bb74f1..7b761d9d774a 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1552,7 +1552,6 @@ static int aio_read(struct kiocb *req, const struct iocb *iocb,
file = req->ki_filp;
if (unlikely(!(file->f_mode & FMODE_READ)))
return -EBADF;
- ret = -EINVAL;
if (unlikely(!file->f_op->read_iter))
return -EINVAL;
--
2.17.1
On Mon, Mar 14, 2022 at 8:46 AM Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote:
>
> Drop this needless assignment in aio_read().
>
> No functional change. No change in resulting object code.
Ack, that assignment is indeed dead. As such, compilers will remove it
and it doesn't "hurt", but it is pointless and possibly confusing.
> I cc'ed Linus as he is the author of the referred commit, but I expect
> that this clean-up just goes the usual way to Al Viro and then in some
> git pull to Linus.
Sounds good to me.
Linus
On Mon, Mar 14, 2022 at 04:46:05PM +0100, Lukas Bulwahn wrote:
> Commit 84c4e1f89fef ("aio: simplify - and fix - fget/fput for io_submit()")
> refactored aio_read() and some error cases into early return, which made
> some intermediate assignment of the return variable needless.
>
> Drop this needless assignment in aio_read().
>
> No functional change. No change in resulting object code.
>
> Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
> ---
> I cc'ed Linus as he is the author of the referred commit, but I expect
> that this clean-up just goes the usual way to Al Viro and then in some
> git pull to Linus.
Applied...
© 2016 - 2026 Red Hat, Inc.