[PATCH] mm/mmu_notifier: fix mmu_notifier_range_init warning
From: Arnd Bergmann
Date: Tue Dec 11 2018 - 15:06:18 EST
The macro version of mmu_notifier_range_init() for CONFIG_MMU_NOTIFIER=n
does not evaluate all its arguments, leading to a warning in one case:
mm/migrate.c: In function 'migrate_vma_pages':
mm/migrate.c:2711:20: error: unused variable 'mm' [-Werror=unused-variable]
struct mm_struct *mm = vma->vm_mm;
Pass down the 'mm' as into the inline function as well so gcc can
see why the variable exists.
Fixes: 137d92bd73b1 ("mm/mmu_notifier: use structure for invalidate_range_start/end calls v2")
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
include/linux/mmu_notifier.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h
index 29f7b9670ba3..b13ea00ded5d 100644
--- a/include/linux/mmu_notifier.h
+++ b/include/linux/mmu_notifier.h
@@ -476,6 +476,7 @@ struct mmu_notifier_range {
};
static inline void _mmu_notifier_range_init(struct mmu_notifier_range *range,
+ struct mm_struct *mm,
unsigned long start,
unsigned long end)
{
@@ -484,7 +485,7 @@ static inline void _mmu_notifier_range_init(struct mmu_notifier_range *range,
}
#define mmu_notifier_range_init(range, mm, start, end, event) \
- _mmu_notifier_range_init(range, start, end)
+ _mmu_notifier_range_init(range, mm, start, end)
static inline int mm_has_notifiers(struct mm_struct *mm)
--
2.20.0