2023-03-07 08:49:32

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH] splice: Remove redundant assignment to ret

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 <[email protected]>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4406
Signed-off-by: Jiapeng Chong <[email protected]>
---
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



2023-03-09 01:03:41

by Chaitanya Kulkarni

[permalink] [raw]
Subject: Re: [PATCH] splice: Remove redundant assignment to ret

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 <[email protected]>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4406
> Signed-off-by: Jiapeng Chong <[email protected]>
> ---
> 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


2023-03-09 01:04:33

by Chaitanya Kulkarni

[permalink] [raw]
Subject: Re: [PATCH] splice: Remove redundant assignment to ret

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 <[email protected]>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4406
> Signed-off-by: Jiapeng Chong <[email protected]>
> ---
> 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 <[email protected]>

-ck


2023-03-09 09:16:32

by Christian Brauner

[permalink] [raw]
Subject: Re: [PATCH] splice: Remove redundant assignment to ret

From: Christian Brauner (Microsoft) <[email protected]>


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

2023-03-10 03:48:52

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH] splice: Remove redundant assignment to ret

On Thu, Mar 09, 2023 at 10:15:46AM +0100, Christian Brauner wrote:
> From: Christian Brauner (Microsoft) <[email protected]>
>
>
> 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?

2023-03-10 08:39:34

by Christian Brauner

[permalink] [raw]
Subject: Re: [PATCH] splice: Remove redundant assignment to ret

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) <[email protected]>
> >
> >
> > 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.