s390/mm: Silence compiler warning when compiling without CONFIG_PGSTE
PATCH 1/1 s390/mm: Silence compiler warning when compiling without CONFIG_PGSTE
If CONFIG_PGSTE is not set (e.g. when compiling without KVM), GCC complains:
CC arch/s390/mm/pgtable.oarch/s390/mm/pgtable.c:413:15: warning: ‘pmd_alloc_map’ defined but not
used [-Wunused-function]
static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr)
^~~~~~~~~~~~~
Wrap the function with "#ifdef CONFIG_PGSTE" to silence the warning.
--- arch/s390/mm/pgtable.c | 2 ++ 1 file changed, 2 insertions(+)
arch/s390/mm/pgtable.c +2 -0
@@ -410,6 +410,7 @@ static inline pmd_t pmdp_flush_lazy(struct mm_struct *mm,return old; } +#ifdef CONFIG_PGSTE static pmd_t *pmd_alloc_map (struct mm_struct *mm,unsigned long addr) {pgd_t *pgd;
@@ -427,6 +428,7 @@ static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr) pmd =pmd_alloc (mm, pud, addr); return pmd; } +#endif pmd_t pmdp_xchg_direct (struct mm_struct *mm,unsigned long addr,pmd_t *pmdp,pmd_t new)
Signature · 1 line
2.21.0
Quoted 28 lines · Thomas Huth
If
CONFIG_PGSTEis not set (e.g. when compiling without KVM), GCC complains:CC
arch/s390/mm/pgtable.oarch/s390/mm/pgtable.c:413:15: warning: ‘pmd_alloc_map’ defined but not
used [-Wunused-function]
staticpmd_t*pmd_alloc_map(structmm_struct*mm, unsigned long addr)^~~~~~~~~~~~~Wrap the function with "#ifdef
CONFIG_PGSTE" to silence the warning.Signed-off-by Thomas Huth <[email protected]>--- arch/s390/mm/pgtable.c | 2 ++ 1 file changed, 2 insertions(+)arch/s390/mm/pgtable.c +1
-0@@ -410,6 +410,7 @@ static inline pmd_t pmdp_flush_lazy(struct mm_struct *mm,return old; } +#ifdef CONFIG_PGSTE static pmd_t *pmd_alloc_map (struct mm_struct *mm,unsigned long addr) {pgd_t *pgd;
arch/s390/mm/pgtable.c static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr) · line 432
Quoted 5 lines
arch/s390/mm/pgtable.c +1
-0@@ -427,6 +428,7 @@ static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr) pmd =pmd_alloc (mm, pud, addr); return pmd; } +#endif
We could also move the function down to the functions where it is used
Signature · 3 lines
Thanks, David / dhildenb
Quoted 24 lines · David Hildenbrand
Quoted 23 lines · Thomas Huth
If
CONFIG_PGSTEis not set (e.g. when compiling without KVM), GCC complains:CC
arch/s390/mm/pgtable.oarch/s390/mm/pgtable.c:413:15: warning: ‘pmd_alloc_map’ defined but not
used [-Wunused-function]
staticpmd_t*pmd_alloc_map(structmm_struct*mm, unsigned long addr)^~~~~~~~~~~~~Wrap the function with "#ifdef
CONFIG_PGSTE" to silence the warning.Signed-off-by Thomas Huth <[email protected]>--- arch/s390/mm/pgtable.c | 2 ++ 1 file changed, 2 insertions(+)arch/s390/mm/pgtable.c +0
-0@@ -410,6 +410,7 @@ static inline pmd_t pmdp_flush_lazy(struct mm_struct *mm,return old; }
Quoted 12 lines
arch/s390/mm/pgtable.c static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr) · line 432
Quoted 10 lines
arch/s390/mm/pgtable.c +2
-0+#ifdef CONFIG_PGSTE static pmd_t *pmd_alloc_map (struct mm_struct *mm,unsigned long addr) {pgd_t *pgd;@@ -427,6 +428,7 @@ static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr) pmd =pmd_alloc (mm, pud, addr); return pmd; } +#endif We could also move the function down to the functions where it is used
Yeah, I thought about that, too. Both have advantages:
- If we keep the code here, "git blame" shows a nicer history of these lines
- If we move the code, we need less #ifdefs
I'll leave the decision to the maintainers... Martin, Heiko?
Quoted 1 line
Reviewed-by David Hildenbrand <[email protected]>
Thanks,
Thomas
Quoted 38 lines · Thomas Huth
Quoted 24 lines · David Hildenbrand
Quoted 23 lines · Thomas Huth
If
CONFIG_PGSTEis not set (e.g. when compiling without KVM), GCC complains:CC
arch/s390/mm/pgtable.oarch/s390/mm/pgtable.c:413:15: warning: ‘pmd_alloc_map’ defined but not
used [-Wunused-function]
staticpmd_t*pmd_alloc_map(structmm_struct*mm, unsigned long addr)^~~~~~~~~~~~~Wrap the function with "#ifdef
CONFIG_PGSTE" to silence the warning.Signed-off-by Thomas Huth <[email protected]>--- arch/s390/mm/pgtable.c | 2 ++ 1 file changed, 2 insertions(+)arch/s390/mm/pgtable.c +0
-0@@ -410,6 +410,7 @@ static inline pmd_t pmdp_flush_lazy(struct mm_struct *mm,return old; }Quoted 12 lines
arch/s390/mm/pgtable.c static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr) · line 432
Quoted 10 lines
arch/s390/mm/pgtable.c +2
-0+#ifdef CONFIG_PGSTE static pmd_t *pmd_alloc_map (struct mm_struct *mm,unsigned long addr) {pgd_t *pgd;@@ -427,6 +428,7 @@ static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr) pmd =pmd_alloc (mm, pud, addr); return pmd; } +#endif We could also move the function down to the functions where it is used
Quoted 7 lines
Yeah, I thought about that, too. Both have advantages:
- If we keep the code here, "git blame" shows a nicer history of these lines
- If we move the code, we need less #ifdefsI'll leave the decision to the maintainers... Martin, Heiko?
Applied without changes. Thanks!