Skip to content

Commit 62103ec

Browse files
Kefeng Wangpaul-walmsley-sifive
authored andcommitted
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. Cc: Logan Gunthorpe <[email protected]> Fixes: d95f1a5 ("RISC-V: Implement sparsemem") Signed-off-by: Kefeng Wang <[email protected]> [[email protected]: fixed checkpatch errors] Signed-off-by: Paul Walmsley <[email protected]>
1 parent 90db7b2 commit 62103ec

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

arch/riscv/include/asm/pgtable.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,7 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t prot)
184184
return __pte((pfn << _PAGE_PFN_SHIFT) | pgprot_val(prot));
185185
}
186186

187-
static inline pte_t mk_pte(struct page *page, pgprot_t prot)
188-
{
189-
return pfn_pte(page_to_pfn(page), prot);
190-
}
187+
#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
191188

192189
#define pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
193190

0 commit comments

Comments
 (0)