linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] riscv: Fix implicit declaration of 'page_to_section'
@ 2019-10-23  3:23 Kefeng Wang
  2019-10-23  3:23 ` [PATCH 2/2] riscv: Fix undefined reference to vmemmap_populate_basepages Kefeng Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kefeng Wang @ 2019-10-23  3:23 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: linux-riscv, Palmer Dabbelt, Logan Gunthorpe, Kefeng Wang, Albert Ou

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.

Cc: Logan Gunthorpe <logang@deltatee.com>
Fixes: d95f1a542c3d ("RISC-V: Implement sparsemem")
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/include/asm/pgtable.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index 42292d99cc74..1db2144f9221 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -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))
 
-- 
2.20.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-10-24  0:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-23  3:23 [PATCH 1/2] riscv: Fix implicit declaration of 'page_to_section' Kefeng Wang
2019-10-23  3:23 ` [PATCH 2/2] riscv: Fix undefined reference to vmemmap_populate_basepages Kefeng Wang
2019-10-23 15:58   ` Logan Gunthorpe
2019-10-23 18:26     ` Paul Walmsley
2019-10-23 15:56 ` [PATCH 1/2] riscv: Fix implicit declaration of 'page_to_section' Logan Gunthorpe
2019-10-23 18:47 ` Paul Walmsley
2019-10-24  0:45   ` Kefeng Wang

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).