mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] afs: remove redundant assignment to variable ret
@ 2019-05-11 12:36 Colin King
  2019-05-11 15:35 ` Joe Perches
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Colin King @ 2019-05-11 12:36 UTC (permalink / raw)
  To: David Howells, linux-afs; +Cc: kernel-janitors, linux-kernel

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

The variable ret is being assigned a value however this is never
read and later it is being reassigned to a new value. The assignment
is redundant and hence can be removed.

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

diff --git a/fs/afs/xattr.c b/fs/afs/xattr.c
index c81f85003fc7..25cb7ad4fca3 100644
--- a/fs/afs/xattr.c
+++ b/fs/afs/xattr.c
@@ -71,7 +71,6 @@ static int afs_xattr_get_acl(const struct xattr_handler *handler,
 	if (ret == 0) {
 		ret = acl->size;
 		if (size > 0) {
-			ret = -ERANGE;
 			if (acl->size > size)
 				return -ERANGE;
 			memcpy(buffer, acl->data, acl->size);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH] afs: remove redundant assignment to variable ret
@ 2020-05-27 12:06 Colin King
  0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2020-05-27 12:06 UTC (permalink / raw)
  To: David Howells, linux-afs; +Cc: kernel-janitors, linux-kernel

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

The variable ret is being assigned a value that is never read. The
assignment is redundant and can be removed.

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

diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index d1e1caa23c8b..5608665ccb71 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -579,7 +579,6 @@ static int afs_do_lookup_one(struct inode *dir, struct dentry *dentry,
 		return ret;
 	}
 
-	ret = -ENOENT;
 	if (!cookie.found) {
 		_leave(" = -ENOENT [not found]");
 		return -ENOENT;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH] afs: remove redundant assignment to variable ret
@ 2020-07-22 15:22 Colin King
  0 siblings, 0 replies; 6+ messages in thread
From: Colin King @ 2020-07-22 15:22 UTC (permalink / raw)
  To: David Howells, linux-afs; +Cc: kernel-janitors, linux-kernel

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

The variable ret is being assigned a value that is never read because
the next statment returns from the function. The assignment is redundant
and can be removed.

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

diff --git a/fs/afs/server.c b/fs/afs/server.c
index e82e452e2612..429cd226e4da 100644
--- a/fs/afs/server.c
+++ b/fs/afs/server.c
@@ -701,7 +701,6 @@ bool afs_check_server_record(struct afs_operation *op, struct afs_server *server
 	retries++;
 	if (retries == 4) {
 		_leave(" = f [stale]");
-		ret = -ESTALE;
 		return false;
 	}
 	goto retry;
-- 
2.27.0


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

end of thread, other threads:[~2020-07-22 15:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-11 12:36 [PATCH] afs: remove redundant assignment to variable ret Colin King
2019-05-11 15:35 ` Joe Perches
2019-05-12  6:55 ` David Howells
2019-05-12  6:56 ` David Howells
2020-05-27 12:06 Colin King
2020-07-22 15:22 Colin King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®