diff mbox

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

Message ID 1530493906-19711-1-git-send-email-rishabhb@codeaurora.org (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show

Commit Message

Rishabh Bhatnagar July 2, 2018, 1:11 a.m. UTC
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
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
---
 lib/rhashtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

NeilBrown July 2, 2018, 1:32 a.m. UTC | #1
(added netdev@vger.kernel.org)

On Sun, Jul 01 2018, Rishabh Bhatnagar wrote:

> 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
> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>

Thanks for catching that!
Reviewed-by: NeilBrown <neilb@suse.com>

Thanks,
NeilBrown

> ---
>  lib/rhashtable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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;
>  				}
>  			}
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
Herbert Xu July 2, 2018, 7:06 a.m. UTC | #2
On Sun, Jul 01, 2018 at 06:11:46PM -0700, Rishabh Bhatnagar wrote:
> 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
> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanks,
Herbert Xu July 2, 2018, 7:07 a.m. UTC | #3
On Sun, Jul 01, 2018 at 06:11:46PM -0700, Rishabh Bhatnagar wrote:
> 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
> Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>

I think you need to resend this patch via netdev@vger.kernel.org.

Please add the acks when you repost.

Thanks,
diff mbox

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;
 				}
 			}