* [PATCH] fs/proc: task_mmu.c: Fix the error-unused variable 'migration'
@ 2022-02-09 2:35 Cai Huoqing
2022-02-09 2:53 ` Stephen Rothwell
0 siblings, 1 reply; 2+ messages in thread
From: Cai Huoqing @ 2022-02-09 2:35 UTC (permalink / raw)
To: cai.huoqing
Cc: Andrew Morton, Peter Xu, Yang Shi, David Hildenbrand,
Stephen Rothwell, Miaohe Lin, Axel Rasmussen, Colin Cross,
Alistair Popple, linux-kernel, linux-fsdevel
Avoid the error-unused variable 'migration' when
CONFIG_TRANSPARENT_HUGEPAGE and CONFIG_ARCH_ENABLE_THP_MIGRATION
are not enabled.
Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
---
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..b055ff29204d 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -1441,7 +1441,7 @@ 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;
- bool migration = false;
+ bool migration __maybe_unused = false;
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
ptl = pmd_trans_huge_lock(pmdp, vma);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fs/proc: task_mmu.c: Fix the error-unused variable 'migration'
2022-02-09 2:35 [PATCH] fs/proc: task_mmu.c: Fix the error-unused variable 'migration' Cai Huoqing
@ 2022-02-09 2:53 ` Stephen Rothwell
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2022-02-09 2:53 UTC (permalink / raw)
To: Cai Huoqing
Cc: Andrew Morton, Peter Xu, Yang Shi, David Hildenbrand, Miaohe Lin,
Axel Rasmussen, Colin Cross, Alistair Popple, linux-kernel,
linux-fsdevel
[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]
Hi Cai,
On Wed, 9 Feb 2022 10:35:59 +0800 Cai Huoqing <cai.huoqing@linux.dev> wrote:
>
> Avoid the error-unused variable 'migration' when
> CONFIG_TRANSPARENT_HUGEPAGE and CONFIG_ARCH_ENABLE_THP_MIGRATION
> are not enabled.
>
> Signed-off-by: Cai Huoqing <cai.huoqing@linux.dev>
> ---
> 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..b055ff29204d 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -1441,7 +1441,7 @@ 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;
> - bool migration = false;
> + bool migration __maybe_unused = false;
>
> #ifdef CONFIG_TRANSPARENT_HUGEPAGE
> ptl = pmd_trans_huge_lock(pmdp, vma);
> --
> 2.25.1
>
This has already been fixed in Andrew's patch set by moving the "#ifdef
CONFIG_TRANSPARENT_HUGEPAGE" above the "migration" declaration.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-09 3:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09 2:35 [PATCH] fs/proc: task_mmu.c: Fix the error-unused variable 'migration' Cai Huoqing
2022-02-09 2:53 ` Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).