Skip to contentSkip to conversation

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

PATCH In review Rishabh Bhatnagar 3 participants 4 messages Jul 2, 2018

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: rhashtable: Correct self-assignment in rhashtable.c

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.

Change-Id I5abd1ce5ba76737a73bd6eca94b07b1bd5267523
---
 lib/rhashtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/rhashtable.c +1 -1
index 9427b57..3109b2e 100644
@@ -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;
 				}
 			}
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Reviewed-by on v1 1/1
#1 lore raw

(added [email protected])

Quoted 10 lines · Rishabh Bhatnagar

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.

Change-Id I5abd1ce5ba76737a73bd6eca94b07b1bd5267523

Thanks for catching that!

Thanks,
NeilBrown

Quoted 20 lines
---
 lib/rhashtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/rhashtable.c +1 -1
index 9427b57..3109b2e 100644
@@ -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;
 				}
 			}
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Rishabh Bhatnagar
Quoted 10 lines · Rishabh Bhatnagar

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.

Change-Id I5abd1ce5ba76737a73bd6eca94b07b1bd5267523

Thanks,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
maintainer
#3 lore raw
In reply to Rishabh Bhatnagar
Quoted 10 lines · Rishabh Bhatnagar

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.

Change-Id I5abd1ce5ba76737a73bd6eca94b07b1bd5267523

I think you need to resend this patch via [email protected].

Please add the acks when you repost.

Thanks,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt