All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] orangefs: remove redundant assignment to variable buffer_index
@ 2022-10-17 21:49 Colin Ian King
  0 siblings, 0 replies; 15+ messages in thread
From: Colin Ian King @ 2022-10-17 21:49 UTC (permalink / raw)
  To: Mike Marshall, Martin Brandenburg, devel; +Cc: kernel-janitors, linux-kernel

The variable buffer_index is assigned a value that is never read,
it is assigned just before the function returns. The assignment is
redundant and can be removed.

Cleans up clang scan build warning:
fs/orangefs/file.c:276:3: warning: Value stored to 'buffer_index'
is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/orangefs/file.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
index 732661aa2680..167fa43b24f9 100644
--- a/fs/orangefs/file.c
+++ b/fs/orangefs/file.c
@@ -273,7 +273,6 @@ ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inode,
 		gossip_debug(GOSSIP_FILE_DEBUG,
 			"%s(%pU): PUT buffer_index %d\n",
 			__func__, handle, buffer_index);
-		buffer_index = -1;
 	}
 	op_release(new_op);
 	return ret;
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [PATCH] orangefs: remove redundant assignment to variable buffer_index
@ 2019-05-11 13:27 ` Colin King
  0 siblings, 0 replies; 15+ messages in thread
From: Colin King @ 2019-05-11 13:27 UTC (permalink / raw)
  To: Mike Marshall, Martin Brandenburg, devel; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable buffer_index is being initialized however this is never
read and later it is being reassigned to a new value. The initialization
is redundant and hence can be removed.

Addresses-Coverity: ("Unused Value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 fs/orangefs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
index a35c17017210..80f06ee794c5 100644
--- a/fs/orangefs/file.c
+++ b/fs/orangefs/file.c
@@ -52,7 +52,7 @@ ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inode,
 	struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
 	struct orangefs_khandle *handle = &orangefs_inode->refn.khandle;
 	struct orangefs_kernel_op_s *new_op = NULL;
-	int buffer_index = -1;
+	int buffer_index;
 	ssize_t ret;
 	size_t copy_amount;
 
-- 
2.20.1


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

end of thread, other threads:[~2022-10-17 21:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 21:49 [PATCH] orangefs: remove redundant assignment to variable buffer_index Colin Ian King
  -- strict thread matches above, loose matches on Subject: below --
2019-05-11 13:27 Colin King
2019-05-11 13:27 ` Colin King
2019-05-16 16:06 ` Mike Marshall
2019-05-16 16:06   ` Mike Marshall
2019-05-21 15:03   ` Dan Carpenter
2019-05-21 15:03     ` Dan Carpenter
2019-06-25 18:55     ` Mike Marshall
2019-06-25 18:55       ` Mike Marshall
2019-06-26  6:18       ` Dan Carpenter
2019-06-26  6:18         ` Dan Carpenter
2019-06-26 14:56         ` Colin Ian King
2019-06-26 14:56           ` Colin Ian King
2019-05-21 15:01 ` Dan Carpenter
2019-05-21 15:01   ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.