lib: rhashtable: Correct self-assignment in rhashtable.c

Message ID 1530549334-13890-1-git-send-email-rishabhb@codeaurora.org
State Accepted
Delegated to: David Miller
Headers show
Series
  • lib: rhashtable: Correct self-assignment in rhashtable.c
Related show

Commit Message

Rishabh Bhatnagar July 2, 2018, 4:35 p.m.
In file lib/rhashtable.c line 777, skip variable is assigned to
itself. The following error was observed:

lib/rhashtable.c:777:41: warning: explicitly assigning value of
variable of type 'int' to itself [-Wself-assign] error, forbidden
warning: rhashtable.c:777
This error was found when compiling with Clang 6.0. Change it to iter->skip.

Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: NeilBrown <neilb@suse.com>
---
 lib/rhashtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller July 3, 2018, 2:26 p.m. | #1
From: Rishabh Bhatnagar <rishabhb@codeaurora.org>
Date: Mon,  2 Jul 2018 09:35:34 -0700

> In file lib/rhashtable.c line 777, skip variable is assigned to
> itself. The following error was observed:
> 
> lib/rhashtable.c:777:41: warning: explicitly assigning value of
> variable of type 'int' to itself [-Wself-assign] error, forbidden
> warning: rhashtable.c:777
> This error was found when compiling with Clang 6.0. Change it to iter->skip.
> 
> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
> Reviewed-by: NeilBrown <neilb@suse.com>

Applied, thanks.

Patch

diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 9427b57..3109b2e 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -774,7 +774,7 @@  int rhashtable_walk_start_check(struct rhashtable_iter *iter)
 				skip++;
 				if (list == iter->list) {
 					iter->p = p;
-					skip = skip;
+					iter->skip = skip;
 					goto found;
 				}
 			}