diff mbox series

[-next] mm/hmm: remove set but not used variable 'devmem'

Message ID 1543629971-128377-1-git-send-email-yuehaibing@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] mm/hmm: remove set but not used variable 'devmem' | expand

Commit Message

Yue Haibing Dec. 1, 2018, 2:06 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

mm/hmm.c: In function 'hmm_devmem_ref_kill':
mm/hmm.c:995:21: warning:
 variable 'devmem' set but not used [-Wunused-but-set-variable]

It not used any more since commit 35d39f953d4e ("mm, hmm: replace
hmm_devmem_pages_create() with devm_memremap_pages()")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 mm/hmm.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Jerome Glisse Dec. 3, 2018, 12:48 a.m. UTC | #1
On Sat, Dec 01, 2018 at 02:06:11AM +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> mm/hmm.c: In function 'hmm_devmem_ref_kill':
> mm/hmm.c:995:21: warning:
>  variable 'devmem' set but not used [-Wunused-but-set-variable]
> 
> It not used any more since commit 35d39f953d4e ("mm, hmm: replace
> hmm_devmem_pages_create() with devm_memremap_pages()")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Jérôme Glisse <jglisse@redhat.com>

> ---
>  mm/hmm.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/mm/hmm.c b/mm/hmm.c
> index 50fbaf8..361f370 100644
> --- a/mm/hmm.c
> +++ b/mm/hmm.c
> @@ -992,9 +992,6 @@ static void hmm_devmem_ref_exit(void *data)
>  
>  static void hmm_devmem_ref_kill(struct percpu_ref *ref)
>  {
> -	struct hmm_devmem *devmem;
> -
> -	devmem = container_of(ref, struct hmm_devmem, ref);
>  	percpu_ref_kill(ref);
>  }
> 
> 
>
David Hildenbrand Dec. 3, 2018, 11:11 a.m. UTC | #2
On 01.12.18 03:06, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> mm/hmm.c: In function 'hmm_devmem_ref_kill':
> mm/hmm.c:995:21: warning:
>  variable 'devmem' set but not used [-Wunused-but-set-variable]
> 
> It not used any more since commit 35d39f953d4e ("mm, hmm: replace
> hmm_devmem_pages_create() with devm_memremap_pages()")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  mm/hmm.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/mm/hmm.c b/mm/hmm.c
> index 50fbaf8..361f370 100644
> --- a/mm/hmm.c
> +++ b/mm/hmm.c
> @@ -992,9 +992,6 @@ static void hmm_devmem_ref_exit(void *data)
>  
>  static void hmm_devmem_ref_kill(struct percpu_ref *ref)
>  {
> -	struct hmm_devmem *devmem;
> -
> -	devmem = container_of(ref, struct hmm_devmem, ref);
>  	percpu_ref_kill(ref);
>  }
> 
> 
> 

Reviewed-by: David Hildenbrand <david@redhat.com>
diff mbox series

Patch

diff --git a/mm/hmm.c b/mm/hmm.c
index 50fbaf8..361f370 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -992,9 +992,6 @@  static void hmm_devmem_ref_exit(void *data)
 
 static void hmm_devmem_ref_kill(struct percpu_ref *ref)
 {
-	struct hmm_devmem *devmem;
-
-	devmem = container_of(ref, struct hmm_devmem, ref);
 	percpu_ref_kill(ref);
 }