All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "Jérôme Glisse" <jglisse@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>, John Hubbard <jhubbard@nvidia.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ralph Campbell <rcampbell@nvidia.com>,
	Dan Williams <dan.j.williams@intel.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mm/hmm: fix unused variable warning in hmm_vma_walk_pud
Date: Wed,  6 Mar 2019 12:00:55 +0100	[thread overview]
Message-ID: <20190306110109.2386057-1-arnd@arndb.de> (raw)

Without CONFIG_HUGETLB_PAGE, the 'vma' variable is never referenced
on x86, so we get this warning:

mm/hmm.c: In function 'hmm_vma_walk_pud':
mm/hmm.c:764:25: error: unused variable 'vma' [-Werror=unused-variable]

Remove the local variable by open-coding walk-vma in the only
place it is used.

Reported-by: John Hubbard <jhubbard@nvidia.com>
Suggested-by: John Hubbard <jhubbard@nvidia.com>
Fixes: 1bed8a07a556 ("mm/hmm: allow to mirror vma of a file on a DAX backed filesystem")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
Andrew, you already took a similar patch from me for a different
warning in the same file. Feel free to fold both patches into
one if you haven't already forwarded the first patch, or leave
them separate. Note that the warnings were introduced by different
patches from the same series originally.
---
 mm/hmm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/hmm.c b/mm/hmm.c
index c4beb1628cad..c1cbe82d12b5 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -761,7 +761,6 @@ static int hmm_vma_walk_pud(pud_t *pudp,
 {
 	struct hmm_vma_walk *hmm_vma_walk = walk->private;
 	struct hmm_range *range = hmm_vma_walk->range;
-	struct vm_area_struct *vma = walk->vma;
 	unsigned long addr = start, next;
 	pmd_t *pmdp;
 	pud_t pud;
@@ -807,7 +806,7 @@ static int hmm_vma_walk_pud(pud_t *pudp,
 		return 0;
 	}
 
-	split_huge_pud(vma, pudp, addr);
+	split_huge_pud(walk->vma, pudp, addr);
 	if (pud_none(*pudp))
 		goto again;
 
-- 
2.20.0


             reply	other threads:[~2019-03-06 11:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06 11:00 Arnd Bergmann [this message]
2019-03-06 16:08 ` [PATCH] mm/hmm: fix unused variable warning in hmm_vma_walk_pud Jerome Glisse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190306110109.2386057-1-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=jglisse@redhat.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rcampbell@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.