From: Nathan Chancellor <nathan@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Yang Shi <shy828301@gmail.com>,
David Hildenbrand <david@redhat.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH] proc: Avoid unused variable warning in pagemap_pmd_range()
Date: Mon, 7 Feb 2022 10:10:50 -0700 [thread overview]
Message-ID: <20220207171049.1102239-1-nathan@kernel.org> (raw)
When building with CONFIG_TRANSPARENT_HUGEPAGE=n, there is a warning
about migration being unused:
fs/proc/task_mmu.c:1444:7: warning: unused variable 'migration' [-Wunused-variable]
bool migration = false;
^
1 warning generated.
Move the ifdef preprocessor directive up to include migration so it is
only included in the file when it is used.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
This is a fix for fs-proc-task_mmuc-dont-read-mapcount-for-migration-entry-v4.patch.
fs/proc/task_mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index bc2f46033231..6e97ed775074 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -1441,9 +1441,9 @@ static int pagemap_pmd_range(pmd_t *pmdp, unsigned long addr, unsigned long end,
spinlock_t *ptl;
pte_t *pte, *orig_pte;
int err = 0;
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
bool migration = false;
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
ptl = pmd_trans_huge_lock(pmdp, vma);
if (ptl) {
u64 flags = 0, frame = 0;
base-commit: b3c0a155ef77550d48f6eb7c6fdd6075764a5622
--
2.35.1
reply other threads:[~2022-02-07 17:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220207171049.1102239-1-nathan@kernel.org \
--to=nathan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shy828301@gmail.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.