riscv: Fix implicit declaration of 'page_to_section'
PATCH 1/2 riscv: Fix implicit declaration of 'page_to_section'
With CONFIG_SPARSEMEM and !CONFIG_SPARSEMEM_VMEMMAP,
arch/riscv/include/asm/pgtable.h: In function ‘mk_pte’:include/asm-generic/memory_model.h:64:14: error: implicit declaration of function ‘page_to_section’; did you mean ‘present_section’? [-Werror=implicit-function-declaration]
int __sec = page_to_section(__pg); \
^~~~~~~~~~~~~~~Fixed by changing mk_pte() from inline function to macro.
--- arch/riscv/include/asm/pgtable.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
arch/riscv/include/asm/pgtable.h +1 -4
@@ -184,10 +184,7 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t prot)return __pte ((pfn << _PAGE_PFN_SHIFT) |pgprot_val (prot)); } -static inline pte_t mk_pte (struct page *page,pgprot_t prot) -{ -return pfn_pte (page_to_pfn (page), prot); -} +#define mk_pte (page,prot) pfn_pte(page_to_pfn(page),prot)#define pte_index (addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
Signature · 7 lines
2.20.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
PATCH 2/2 riscv: Fix undefined reference to vmemmap_populate_basepages
Using CONFIG_SPARSEMEM_VMEMMAP instead of CONFIG_SPARSEMEM to fix following build issue.
riscv64-linux-ld: arch/riscv/mm/init.o: in function 'vmemmap_populate':
init.c:(.meminit.text+0x8): undefined reference to 'vmemmap_populate_basepages'
--- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/mm/init.c +1 -1
@@ -458,7 +458,7 @@ void __init paging_init(void)zone_sizes_init (); } -#ifdef CONFIG_SPARSEMEM +#ifdef CONFIG_SPARSEMEM_VMEMMAP int __meminit vmemmap_populate (unsigned long start,unsigned long end,int node,struct vmem_altmap *altmap) {
Signature · 7 lines
2.20.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [PATCH 2/2] riscv: Fix undefined reference to vmemmap_populate_basepages
Quoted 9 lines · Kefeng Wang
Using
CONFIG_SPARSEMEM_VMEMMAPinstead ofCONFIG_SPARSEMEMto fix following build issue.riscv64-linux-ld:
arch/riscv/mm/init.o: in function 'vmemmap_populate':
init.c:(.meminit.text+0x8): undefined reference to 'vmemmap_populate_basepages'Cc Logan Gunthorpe <[email protected]>Fixes d95f1a542c3d ("RISC-V: Implement sparsemem")Signed-off-by Kefeng Wang <[email protected]>
Yup!
Quoted 10 lines
--- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/mm/init.c +0
-0
arch/riscv/mm/init.c void __init paging_init(void) · line 464
Quoted 8 lines
arch/riscv/mm/init.c +1
-1@@ -458,7 +458,7 @@ void __init paging_init(void)zone_sizes_init (); } -#ifdef CONFIG_SPARSEMEM +#ifdef CONFIG_SPARSEMEM_VMEMMAP int __meminit vmemmap_populate (unsigned long start,unsigned long end,int node,struct vmem_altmap *altmap) {
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Re: [PATCH 2/2] riscv: Fix undefined reference to vmemmap_populate_basepages
Quoted 7 lines · Logan Gunthorpe
Quoted 6 lines · Kefeng Wang
Using
CONFIG_SPARSEMEM_VMEMMAPinstead ofCONFIG_SPARSEMEMto fix following build issue.riscv64-linux-ld:
arch/riscv/mm/init.o: in function 'vmemmap_populate':
init.c:(.meminit.text+0x8): undefined reference to 'vmemmap_populate_basepages'
Quoted 7 lines
Quoted 3 lines
Cc Logan Gunthorpe <[email protected]>Fixes d95f1a542c3d ("RISC-V: Implement sparsemem")Signed-off-by Kefeng Wang <[email protected]>Yup!
Reviewed-by Logan Gunthorpe <[email protected]>
Thanks, queued for v5.4-rc.
- Paul
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 4 lines · Kefeng Wang
With
CONFIG_SPARSEMEMand !CONFIG_SPARSEMEM_VMEMMAP,
arch/riscv/include/asm/pgtable.h: In function ‘mk_pte’:include/asm-generic/memory_model.h:64:14: error: implicit declaration of function ‘page_to_section’; did you mean ‘present_section’? [-Werror=implicit-function-declaration]
Quoted 8 lines
int __sec = page_to_section(__pg); \ ^~~~~~~~~~~~~~~Fixed by changing
mk_pte()from inline function to macro.Cc Logan Gunthorpe <[email protected]>Fixes d95f1a542c3d ("RISC-V: Implement sparsemem")Signed-off-by Kefeng Wang <[email protected]>
Makes sense.
Quoted 11 lines
--- arch/riscv/include/asm/pgtable.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)arch/riscv/include/asm/pgtable.h +0
-0@@ -184,10 +184,7 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t prot)return __pte ((pfn << _PAGE_PFN_SHIFT) |pgprot_val (prot));
arch/riscv/include/asm/pgtable.h static inline pte_t pfn_pte(unsigned long pfn, pgprot_t prot) · line 190
Quoted 10 lines
arch/riscv/include/asm/pgtable.h +1
-4} -static inline pte_t mk_pte (struct page *page,pgprot_t prot) -{ -return pfn_pte (page_to_pfn (page), prot); -} +#define mk_pte (page,prot) pfn_pte(page_to_pfn(page),prot)#define pte_index (addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 4 lines · Kefeng Wang
With
CONFIG_SPARSEMEMand !CONFIG_SPARSEMEM_VMEMMAP,
arch/riscv/include/asm/pgtable.h: In function ‘mk_pte’:include/asm-generic/memory_model.h:64:14: error: implicit declaration of function ‘page_to_section’; did you mean ‘present_section’? [-Werror=implicit-function-declaration]
Quoted 8 lines
int __sec = page_to_section(__pg); \ ^~~~~~~~~~~~~~~Fixed by changing
mk_pte()from inline function to macro.Cc Logan Gunthorpe <[email protected]>Fixes d95f1a542c3d ("RISC-V: Implement sparsemem")Signed-off-by Kefeng Wang <[email protected]>
Thanks for the fix, but this patch adds checkpatch errors:
---
ERROR: space required after that ',' (ctx:VxV)
#37: FILE: arch/riscv/include/asm/pgtable.h:187:
+#define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot)
^
ERROR: space required after that ',' (ctx:VxV)
#37: FILE: arch/riscv/include/asm/pgtable.h:187:
+#define mk_pte(page,prot) pfn_pte(page_to_pfn(page),prot)
^
total: 2 errors, 0 warnings, 0 checks, 11 lines checked
---
Please run 'checkpatch.pl --strict' on patches before submitting.
Anyway, these have been fixed up here and queued for v5.4-rc with Logan's Reviewed-by:.
- Paul
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 23 lines · Paul Walmsley
Quoted 4 lines · Kefeng Wang
With
CONFIG_SPARSEMEMand !CONFIG_SPARSEMEM_VMEMMAP,
arch/riscv/include/asm/pgtable.h: In function ‘mk_pte’:include/asm-generic/memory_model.h:64:14: error: implicit declaration of function ‘page_to_section’; did you mean ‘present_section’? [-Werror=implicit-function-declaration]Quoted 8 lines
int __sec = page_to_section(__pg); \ ^~~~~~~~~~~~~~~Fixed by changing
mk_pte()from inline function to macro.Cc Logan Gunthorpe <[email protected]>Fixes d95f1a542c3d ("RISC-V: Implement sparsemem")Signed-off-by Kefeng Wang <[email protected]>Thanks for the fix, but this patch adds checkpatch errors:
---
ERROR: space required after that ',' (ctx:VxV)
#37: FILE:arch/riscv/include/asm/pgtable.h:187:
+#definemk_pte(page,prot)pfn_pte(page_to_pfn(page),prot)^
Quoted 8 lines
ERROR: space required after that ',' (ctx:VxV)
#37: FILE:arch/riscv/include/asm/pgtable.h:187:
+#definemk_pte(page,prot)pfn_pte(page_to_pfn(page),prot)^total: 2 errors, 0 warnings, 0 checks, 11 lines checked
---
oops.
Quoted 2 lines
Please run 'checkpatch.pl --strict' on patches before submitting.
Ok, will do next time.
Quoted 3 lines
Anyway, these have been fixed up here and queued for v5.4-rc with Logan's Reviewed-by:.
Thanks.
Quoted 3 lines
- Paul
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv