All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] orangefs: remove redundant assignment to variable buffer_index
@ 2019-05-11 13:27 ` Colin King
  0 siblings, 0 replies; 21+ 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] 21+ messages in thread
* [PATCH] orangefs: remove redundant assignment to err
  2019-05-11 13:27 ` Colin King
@ 2019-07-28 18:04 ` Colin King
  -1 siblings, 0 replies; 21+ messages in thread
From: Colin King @ 2019-07-28 18:04 UTC (permalink / raw)
  To: Mike Marshall, Martin Brandenburg, devel; +Cc: kernel-janitors, linux-kernel

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

Variable err is initialized to a value that is never read and it
is re-assigned later.  The initialization is redundant and can
be removed.

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

diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index 0c337d8bdaab..efb12197da18 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -940,7 +940,7 @@ int orangefs_setattr(struct dentry *dentry, struct iattr *iattr)
 int orangefs_getattr(const struct path *path, struct kstat *stat,
 		     u32 request_mask, unsigned int flags)
 {
-	int ret = -ENOENT;
+	int ret;
 	struct inode *inode = path->dentry->d_inode;
 
 	gossip_debug(GOSSIP_INODE_DEBUG,
-- 
2.20.1


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

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

The variable ret is being initialized with a value that is
never read and it is being updated later with a new value. The
initialization is redundant and can be removed.

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

diff --git a/fs/orangefs/orangefs-mod.c b/fs/orangefs/orangefs-mod.c
index c010c1fddafc..289b648ae196 100644
--- a/fs/orangefs/orangefs-mod.c
+++ b/fs/orangefs/orangefs-mod.c
@@ -79,7 +79,7 @@ DECLARE_WAIT_QUEUE_HEAD(orangefs_request_list_waitq);
 
 static int __init orangefs_init(void)
 {
-	int ret = -1;
+	int ret;
 	__u32 i = 0;
 
 	if (op_timeout_secs < 0)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [PATCH] orangefs: remove redundant assignment to variable buffer_index
@ 2022-10-17 21:49 Colin Ian King
  0 siblings, 0 replies; 21+ 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] 21+ messages in thread

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

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-11 13:27 [PATCH] orangefs: remove redundant assignment to variable buffer_index 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
2019-07-28 18:04 [PATCH] orangefs: remove redundant assignment to err Colin King
2019-07-28 18:04 ` Colin King
2020-05-24 22:48 [PATCH] orangefs: remove redundant assignment to variable ret Colin King
2020-05-24 22:48 ` Colin King
2020-06-01 11:15 ` Mike Marshall
2020-06-01 11:15   ` Mike Marshall
2022-10-17 21:49 [PATCH] orangefs: remove redundant assignment to variable buffer_index Colin Ian King

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.