From f10789e4f6d6e2d0592620e6e3f6b4ff35d3488d Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Sat, 11 May 2019 14:27:00 +0100 Subject: [PATCH 1/2] orangefs: remove redundant assignment to variable buffer_index 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 Signed-off-by: Mike Marshall --- 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; From e65682b55956e9fbf8a88f303a48e7c1430ffe15 Mon Sep 17 00:00:00 2001 From: Mike Marshall Date: Wed, 3 Jul 2019 21:26:44 +0000 Subject: [PATCH 2/2] orangefs: eliminate needless variable assignments Signed-off-by: Mike Marshall --- fs/orangefs/file.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index 80f06ee794c5..86f63e014ffb 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -134,7 +134,6 @@ ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inode, */ if (ret == -EAGAIN && op_state_purged(new_op)) { orangefs_bufmap_put(buffer_index); - buffer_index = -1; if (type == ORANGEFS_IO_WRITE) iov_iter_revert(iter, total_size); gossip_debug(GOSSIP_FILE_DEBUG, @@ -262,7 +261,6 @@ ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inode, "%s(%pU): PUT buffer_index %d\n", __func__, handle, buffer_index); } - buffer_index = -1; } op_release(new_op); return ret;