diff mbox series

splice: Remove redundant assignment to ret

Message ID 20230307084918.28632-1-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Mainlined, archived
Headers show
Series splice: Remove redundant assignment to ret | expand

Commit Message

Jiapeng Chong March 7, 2023, 8:49 a.m. UTC
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(-)

Comments

Chaitanya Kulkarni March 9, 2023, 1:03 a.m. UTC | #1
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
Chaitanya Kulkarni March 9, 2023, 1:03 a.m. UTC | #2
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
Christian Brauner March 9, 2023, 9:15 a.m. UTC | #3
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
Al Viro March 10, 2023, 3:48 a.m. UTC | #4
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?
Christian Brauner March 10, 2023, 8:36 a.m. UTC | #5
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.
diff mbox series

Patch

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;