diff mbox series

mm: pagewalk: fix unused variable warning

Message ID 20200107204607.1533842-1-arnd@arndb.de (mailing list archive)
State New, archived
Headers show
Series mm: pagewalk: fix unused variable warning | expand

Commit Message

Arnd Bergmann Jan. 7, 2020, 8:45 p.m. UTC
One of the pagewalk patches introduced a harmless warning:

mm/hmm.c: In function 'hmm_vma_walk_pud':
mm/hmm.c:478:9: error: unused variable 'pmdp' [-Werror=unused-variable]
  pmd_t *pmdp;
         ^~~~
mm/hmm.c:477:30: error: unused variable 'next' [-Werror=unused-variable]
  unsigned long addr = start, next;
                              ^~~~

Remove both of the now-unused variables.

Fixes: cb4d03d5fb4c ("mm: pagewalk: add p4d_entry() and pgd_entry()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 mm/hmm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

John Hubbard Jan. 7, 2020, 9 p.m. UTC | #1
On 1/7/20 12:45 PM, Arnd Bergmann wrote:
> One of the pagewalk patches introduced a harmless warning:
> 
> mm/hmm.c: In function 'hmm_vma_walk_pud':
> mm/hmm.c:478:9: error: unused variable 'pmdp' [-Werror=unused-variable]
>   pmd_t *pmdp;
>          ^~~~
> mm/hmm.c:477:30: error: unused variable 'next' [-Werror=unused-variable]
>   unsigned long addr = start, next;
>                               ^~~~
> 
> Remove both of the now-unused variables.
> 
> Fixes: cb4d03d5fb4c ("mm: pagewalk: add p4d_entry() and pgd_entry()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  mm/hmm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 

Reviewed-by: John Hubbard <jhubbard@nvidia.com>


thanks,
Steven Price Jan. 8, 2020, 11:22 a.m. UTC | #2
On Tue, Jan 07, 2020 at 08:45:50PM +0000, Arnd Bergmann wrote:
> One of the pagewalk patches introduced a harmless warning:
> 
> mm/hmm.c: In function 'hmm_vma_walk_pud':
> mm/hmm.c:478:9: error: unused variable 'pmdp' [-Werror=unused-variable]
>   pmd_t *pmdp;
>          ^~~~
> mm/hmm.c:477:30: error: unused variable 'next' [-Werror=unused-variable]
>   unsigned long addr = start, next;
>                               ^~~~
> 
> Remove both of the now-unused variables.
> 
> Fixes: cb4d03d5fb4c ("mm: pagewalk: add p4d_entry() and pgd_entry()")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Gah! Sorry about that, thanks for fixing it up.

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
>  mm/hmm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/hmm.c b/mm/hmm.c
> index a71295e99968..72e5a6d9a417 100644
> --- a/mm/hmm.c
> +++ b/mm/hmm.c
> @@ -474,8 +474,7 @@ static int hmm_vma_walk_pud(pud_t *pudp, unsigned long start, unsigned long end,
>  {
>  	struct hmm_vma_walk *hmm_vma_walk = walk->private;
>  	struct hmm_range *range = hmm_vma_walk->range;
> -	unsigned long addr = start, next;
> -	pmd_t *pmdp;
> +	unsigned long addr = start;
>  	pud_t pud;
>  	int ret = 0;
>  	spinlock_t *ptl = pud_trans_huge_lock(pudp, walk->vma);
> -- 
> 2.20.0
>
diff mbox series

Patch

diff --git a/mm/hmm.c b/mm/hmm.c
index a71295e99968..72e5a6d9a417 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -474,8 +474,7 @@  static int hmm_vma_walk_pud(pud_t *pudp, unsigned long start, unsigned long end,
 {
 	struct hmm_vma_walk *hmm_vma_walk = walk->private;
 	struct hmm_range *range = hmm_vma_walk->range;
-	unsigned long addr = start, next;
-	pmd_t *pmdp;
+	unsigned long addr = start;
 	pud_t pud;
 	int ret = 0;
 	spinlock_t *ptl = pud_trans_huge_lock(pudp, walk->vma);