Skip to contentSkip to conversation

splice: Remove redundant assignment to ret

PATCH In review Jiapeng Chong 4 participants 6 messages Mar 7, 2023 – Mar 10, 2023 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 fs/splice.c | 1 -
 1 file changed, 1 deletion(-)
fs/splice.c +0 -1
index 2e76dbb81a8f..2c3dec2b6dfa 100644
@@ -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;
Signature · 1 line
2.20.1.7.g153144c
#1 lore raw
Quoted 16 lines · Jiapeng Chong

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

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

---
  fs/splice.c | 1 -
  1 file changed, 1 deletion(-)
fs/splice.c +0 -0
index 2e76dbb81a8f..2c3dec2b6dfa 100644

fs/splice.c ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, · line 942

Quoted 7 lines
fs/splice.c +0 -1
@@ -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

Reviewed-by on v1 1/1
#2 lore raw
In reply to Jiapeng Chong
Quoted 16 lines · Jiapeng Chong

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

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

---
  fs/splice.c | 1 -
  1 file changed, 1 deletion(-)
fs/splice.c +0 -0
index 2e76dbb81a8f..2c3dec2b6dfa 100644

fs/splice.c ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd, · line 942

Quoted 7 lines
fs/splice.c +0 -1
@@ -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.

-ck

#3 lore raw
In reply to Jiapeng Chong

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

Quoted 5 lines · Jiapeng Chong

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
maintainer
#4 lore raw
Quoted 6 lines · Christian Brauner

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

Quoted 2 lines · Jiapeng Chong

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

Quoted 8 lines
Quoted 3 lines

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?

#5 lore raw
Quoted 11 lines · Al Viro
Quoted 10 lines · Christian Brauner

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

Quoted 5 lines · Jiapeng Chong

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

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

Quoted 6 lines
Quoted 4 lines

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.