All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs: direct-io: Remove redundant assignment to retval
@ 2021-04-25 10:33 Jiapeng Chong
  0 siblings, 0 replies; only message in thread
From: Jiapeng Chong @ 2021-04-25 10:33 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, linux-kernel, Jiapeng Chong

Variable retval is set to zero but this value is never read as it is
overwritten with a new value later on, hence it is a redundant
assignment and can be removed.

Cleans up the following clang-analyzer warning:

fs/direct-io.c:1245:2: warning: Value stored to 'retval' is never read
[clang-analyzer-deadcode.DeadStores].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 fs/direct-io.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/direct-io.c b/fs/direct-io.c
index b2e86e7..b348264 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -1242,7 +1242,6 @@ static inline int drop_refcount(struct dio *dio)
 	 */
 	inode_dio_begin(inode);
 
-	retval = 0;
 	sdio.blkbits = blkbits;
 	sdio.blkfactor = i_blkbits - blkbits;
 	sdio.block_in_file = offset >> blkbits;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-25 10:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25 10:33 [PATCH] fs: direct-io: Remove redundant assignment to retval Jiapeng Chong

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.