public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] splice: Remove redundant assignment to ret
@ 2023-03-07  8:49 Jiapeng Chong
  2023-03-09  1:03 ` Chaitanya Kulkarni
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jiapeng Chong @ 2023-03-07  8:49 UTC (permalink / raw)
  To: viro; +Cc: brauner, linux-fsdevel, linux-kernel, Jiapeng Chong, Abaci Robot

The variable ret belongs to redundant assignment and can be deleted.

fs/splice.c:940:2: warning: Value stored to 'ret' is never read.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4406
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 fs/splice.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/splice.c b/fs/splice.c
index 2e76dbb81a8f..2c3dec2b6dfa 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -937,7 +937,6 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
 	/*
 	 * Do the splice.
 	 */
-	ret = 0;
 	bytes = 0;
 	len = sd->total_len;
 	flags = sd->flags;
-- 
2.20.1.7.g153144c


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

* Re: [PATCH] splice: Remove redundant assignment to ret
  2023-03-07  8:49 [PATCH] splice: Remove redundant assignment to ret Jiapeng Chong
@ 2023-03-09  1:03 ` Chaitanya Kulkarni
  2023-03-09  1:03 ` Chaitanya Kulkarni
  2023-03-09  9:15 ` Christian Brauner
  2 siblings, 0 replies; 6+ messages in thread
From: Chaitanya Kulkarni @ 2023-03-09  1:03 UTC (permalink / raw)
  To: Jiapeng Chong, viro@zeniv.linux.org.uk
  Cc: brauner@kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, Abaci Robot

On 3/7/23 00:49, Jiapeng Chong wrote:
> The variable ret belongs to redundant assignment and can be deleted.
>
> fs/splice.c:940:2: warning: Value stored to 'ret' is never read.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4406
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>   fs/splice.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/fs/splice.c b/fs/splice.c
> index 2e76dbb81a8f..2c3dec2b6dfa 100644
> --- a/fs/splice.c
> +++ b/fs/splice.c
> @@ -937,7 +937,6 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
>   	/*
>   	 * Do the splice.
>   	 */
> -	ret = 0;
>   	bytes = 0;
>   	len = sd->total_len;
>   	flags = sd->flags;

The variable return is only used in the while loop twice,
each time it is initialized from the function's return value.

-ck



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

* Re: [PATCH] splice: Remove redundant assignment to ret
  2023-03-07  8:49 [PATCH] splice: Remove redundant assignment to ret Jiapeng Chong
  2023-03-09  1:03 ` Chaitanya Kulkarni
@ 2023-03-09  1:03 ` Chaitanya Kulkarni
  2023-03-09  9:15 ` Christian Brauner
  2 siblings, 0 replies; 6+ messages in thread
From: Chaitanya Kulkarni @ 2023-03-09  1:03 UTC (permalink / raw)
  To: Jiapeng Chong, viro@zeniv.linux.org.uk
  Cc: brauner@kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, Abaci Robot

On 3/7/23 00:49, Jiapeng Chong wrote:
> The variable ret belongs to redundant assignment and can be deleted.
>
> fs/splice.c:940:2: warning: Value stored to 'ret' is never read.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4406
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>   fs/splice.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/fs/splice.c b/fs/splice.c
> index 2e76dbb81a8f..2c3dec2b6dfa 100644
> --- a/fs/splice.c
> +++ b/fs/splice.c
> @@ -937,7 +937,6 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
>   	/*
>   	 * Do the splice.
>   	 */
> -	ret = 0;
>   	bytes = 0;
>   	len = sd->total_len;
>   	flags = sd->flags;

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



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

* Re: [PATCH] splice: Remove redundant assignment to ret
  2023-03-07  8:49 [PATCH] splice: Remove redundant assignment to ret Jiapeng Chong
  2023-03-09  1:03 ` Chaitanya Kulkarni
  2023-03-09  1:03 ` Chaitanya Kulkarni
@ 2023-03-09  9:15 ` Christian Brauner
  2023-03-10  3:48   ` Al Viro
  2 siblings, 1 reply; 6+ messages in thread
From: Christian Brauner @ 2023-03-09  9:15 UTC (permalink / raw)
  To: viro, Jiapeng Chong
  Cc: Christian Brauner, linux-fsdevel, linux-kernel, Abaci Robot

From: Christian Brauner (Microsoft) <brauner@kernel.org>


On Tue, 07 Mar 2023 16:49:18 +0800, Jiapeng Chong wrote:
> The variable ret belongs to redundant assignment and can be deleted.
> 
> fs/splice.c:940:2: warning: Value stored to 'ret' is never read.
> 
> 

Thanks for the cleanup. Seems ok to do so I picked this up,

[1/1] splice: Remove redundant assignment to ret
      commit: c3a4aec055ec275c9f860e88d37e97248927d898

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

* Re: [PATCH] splice: Remove redundant assignment to ret
  2023-03-09  9:15 ` Christian Brauner
@ 2023-03-10  3:48   ` Al Viro
  2023-03-10  8:36     ` Christian Brauner
  0 siblings, 1 reply; 6+ messages in thread
From: Al Viro @ 2023-03-10  3:48 UTC (permalink / raw)
  To: Christian Brauner; +Cc: Jiapeng Chong, linux-fsdevel, linux-kernel, Abaci Robot

On Thu, Mar 09, 2023 at 10:15:46AM +0100, Christian Brauner wrote:
> From: Christian Brauner (Microsoft) <brauner@kernel.org>
> 
> 
> On Tue, 07 Mar 2023 16:49:18 +0800, Jiapeng Chong wrote:
> > The variable ret belongs to redundant assignment and can be deleted.
> > 
> > fs/splice.c:940:2: warning: Value stored to 'ret' is never read.
> > 
> > 
> 
> Thanks for the cleanup. Seems ok to do so I picked this up,
> 
> [1/1] splice: Remove redundant assignment to ret
>       commit: c3a4aec055ec275c9f860e88d37e97248927d898

Which branch?

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

* Re: [PATCH] splice: Remove redundant assignment to ret
  2023-03-10  3:48   ` Al Viro
@ 2023-03-10  8:36     ` Christian Brauner
  0 siblings, 0 replies; 6+ messages in thread
From: Christian Brauner @ 2023-03-10  8:36 UTC (permalink / raw)
  To: Al Viro; +Cc: Jiapeng Chong, linux-fsdevel, linux-kernel, Abaci Robot

On Fri, Mar 10, 2023 at 03:48:24AM +0000, Al Viro wrote:
> On Thu, Mar 09, 2023 at 10:15:46AM +0100, Christian Brauner wrote:
> > From: Christian Brauner (Microsoft) <brauner@kernel.org>
> > 
> > 
> > On Tue, 07 Mar 2023 16:49:18 +0800, Jiapeng Chong wrote:
> > > The variable ret belongs to redundant assignment and can be deleted.
> > > 
> > > fs/splice.c:940:2: warning: Value stored to 'ret' is never read.
> > > 
> > > 
> > 
> > Thanks for the cleanup. Seems ok to do so I picked this up,
> > 
> > [1/1] splice: Remove redundant assignment to ret
> >       commit: c3a4aec055ec275c9f860e88d37e97248927d898
> 
> Which branch?

Currently still under

https://git.kernel.org/pub/scm/linux/kernel/git/vfs/idmapping.git/ fs.misc

I planned on sending a tag to Linus on Saturday.

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

end of thread, other threads:[~2023-03-10  8:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-07  8:49 [PATCH] splice: Remove redundant assignment to ret Jiapeng Chong
2023-03-09  1:03 ` Chaitanya Kulkarni
2023-03-09  1:03 ` Chaitanya Kulkarni
2023-03-09  9:15 ` Christian Brauner
2023-03-10  3:48   ` Al Viro
2023-03-10  8:36     ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox