Skip to contentSkip to conversation

fs/proc: task_mmu.c: Fix the error-unused variable 'migration'

PATCH In review Cai Huoqing 2 participants 2 messages Feb 9, 2022

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

PATCH 1/1 fs/proc: task_mmu.c: Fix the error-unused variable 'migration'

Avoid the error-unused variable 'migration' when CONFIG_TRANSPARENT_HUGEPAGE and CONFIG_ARCH_ENABLE_THP_MIGRATION are not enabled.

---
 fs/proc/task_mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/task_mmu.c +1 -1
index bc2f46033231..b055ff29204d 100644
@@ -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);
Signature · 1 line
2.25.1
#1 lore raw

Hi Cai,

Quoted 26 lines · On Wed, 9 Feb 2022 10:35:59 +0800 Cai Huoqing <[email protected]> wrote:

Avoid the error-unused variable 'migration' when CONFIG_TRANSPARENT_HUGEPAGE and CONFIG_ARCH_ENABLE_THP_MIGRATION are not enabled.

---
 fs/proc/task_mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/proc/task_mmu.c +1 -1
index bc2f46033231..b055ff29204d 100644
@@ -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);
Signature · 1 line
2.25.1

This has already been fixed in Andrew's patch set by moving the "#ifdef CONFIG_TRANSPARENT_HUGEPAGE" above the "migration" declaration.

Signature · 2 lines
Cheers,
Stephen Rothwell