aio: remove redundant assignment to variable ret
diff mbox series

Message ID 20190822110705.19065-1-colin.king@canonical.com
State New
Headers show
Series
  • aio: remove redundant assignment to variable ret
Related show

Commit Message

Colin King Aug. 22, 2019, 11:07 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable ret is being set to -EINVAL however this is never read
and later it is being reassigned to a new value. The assignment is
redundant and hence can be removed.

Addresses-Coverity: ("Unused Value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/aio.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Jeff Moyer Aug. 22, 2019, 1:33 p.m. UTC | #1
Colin King <colin.king@canonical.com> writes:

> From: Colin Ian King <colin.king@canonical.com>
>
> The variable ret is being set to -EINVAL however this is never read
> and later it is being reassigned to a new value. The assignment is
> redundant and hence can be removed.
>
> Addresses-Coverity: ("Unused Value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  fs/aio.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/fs/aio.c b/fs/aio.c
> index f9f441b59966..3e290dfac10a 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -1528,7 +1528,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;

Acked-by: Jeff Moyer <jmoyer@redhat.com>

Patch
diff mbox series

diff --git a/fs/aio.c b/fs/aio.c
index f9f441b59966..3e290dfac10a 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1528,7 +1528,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;