fs/splice.c | 1 - 1 file changed, 1 deletion(-)
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
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
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?
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.
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
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
© 2016 - 2026 Red Hat, Inc.