[Linux-cachefs] [PATCH][next] fs: cachefiles: remove redundant initialization of variable ret

Colin King colin.king at canonical.com
Fri Jan 29 15:02:28 UTC 2021


From: Colin Ian King <colin.king at 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 at canonical.com>
---
 fs/cachefiles/rdwr2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cachefiles/rdwr2.c b/fs/cachefiles/rdwr2.c
index 4cea5a2a2d6e..c7000d01b47a 100644
--- a/fs/cachefiles/rdwr2.c
+++ b/fs/cachefiles/rdwr2.c
@@ -193,7 +193,7 @@ static int cachefiles_write(struct netfs_cache_resources *cres,
 	struct inode *inode;
 	struct file *file = cres->cache_priv2;
 	unsigned int old_nofs;
-	ssize_t ret = -ENOBUFS;
+	ssize_t ret;
 	size_t len = iov_iter_count(iter);
 
 	_enter("%pD,%li,%llx,%zx/%llx",
-- 
2.29.2




More information about the Linux-cachefs mailing list