Skip to contentSkip to conversation

mm: pagewalk: fix unused variable warning

PATCH In review Arnd Bergmann 3 participants 3 messages Jan 7, 2020 – Jan 8, 2020

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

PATCH 1/1 mm: pagewalk: fix unused variable warning

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()")
---
 mm/hmm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
mm/hmm.c +1 -2
index a71295e99968..72e5a6d9a417 100644
@@ -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);
Signature · 1 line
2.20.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

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;
                              ^~~~
Quoted 8 lines

Remove both of the now-unused variables.

Fixes cb4d03d5fb4c ("mm: pagewalk: add p4d_entry() and pgd_entry()")
---
 mm/hmm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

thanks,

Signature · 2 lines
John Hubbard
NVIDIA
Quoted 15 lines
mm/hmm.c +1 -2
index a71295e99968..72e5a6d9a417 100644
@@ -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);
Reviewed-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 10 lines · Arnd Bergmann

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;
                              ^~~~
Quoted 4 lines

Remove both of the now-unused variables.

Fixes cb4d03d5fb4c ("mm: pagewalk: add p4d_entry() and pgd_entry()")

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

Quoted 21 lines
---
 mm/hmm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
mm/hmm.c +1 -2
index a71295e99968..72e5a6d9a417 100644
@@ -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);
Signature · 1 line
2.20.0