linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] aio: remove redundant assignment to variable ret
@ 2019-08-22 11:07 Colin King
  2019-08-22 13:33 ` Jeff Moyer
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-08-22 11:07 UTC (permalink / raw)
  To: Benjamin LaHaise, Alexander Viro, linux-aio, linux-fsdevel
  Cc: kernel-janitors, linux-kernel

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;
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] aio: remove redundant assignment to variable ret
  2019-08-22 11:07 [PATCH] aio: remove redundant assignment to variable ret Colin King
@ 2019-08-22 13:33 ` Jeff Moyer
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Moyer @ 2019-08-22 13:33 UTC (permalink / raw)
  To: Colin King
  Cc: Benjamin LaHaise, Alexander Viro, linux-aio, linux-fsdevel,
	kernel-janitors, linux-kernel

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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-22 13:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-22 11:07 [PATCH] aio: remove redundant assignment to variable ret Colin King
2019-08-22 13:33 ` Jeff Moyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).