Skip to contentSkip to conversation

aio: drop needless assignment in aio_read()

PATCH Applied Lukas Bulwahn 3 participants 3 messages Mar 14, 2022 – Mar 15, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aio: drop needless assignment in aio_read()

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.

---
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(-)
fs/aio.c +0 -1
index eb0948bb74f1..7b761d9d774a 100644
@@ -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;
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 4 lines · Lukas Bulwahn

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.

Quoted 3 lines

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

maintainer Applied
#2 lore raw
In reply to Lukas Bulwahn
Quoted 6 lines · Lukas Bulwahn

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().

Quoted 7 lines

No functional change. No change in resulting object code.

---
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...