From: Logan Gunthorpe <logang@deltatee.com>
To: Kefeng Wang <wangkefeng.wang@huawei.com>,
Paul Walmsley <paul.walmsley@sifive.com>
Cc: linux-riscv@lists.infradead.org,
Palmer Dabbelt <palmer@sifive.com>,
Albert Ou <aou@eecs.berkeley.edu>
Subject: Re: [PATCH 1/2] riscv: Fix implicit declaration of 'page_to_section'
Date: Wed, 23 Oct 2019 09:56:46 -0600 [thread overview]
Message-ID: <54385600-0cd9-6113-ed16-41df15fc8fe0@deltatee.com> (raw)
In-Reply-To: <20191023032302.160388-1-wangkefeng.wang@huawei.com>
On 2019-10-22 9:23 p.m., Kefeng Wang wrote:
> 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>
Makes sense.
Reviewed-by: Logan Gunthorpe <logang@deltatee.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))
>
>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2019-10-23 15:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Logan Gunthorpe [this message]
2019-10-23 18:47 ` [PATCH 1/2] riscv: Fix implicit declaration of 'page_to_section' Paul Walmsley
2019-10-24 0:45 ` Kefeng Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54385600-0cd9-6113-ed16-41df15fc8fe0@deltatee.com \
--to=logang@deltatee.com \
--cc=aou@eecs.berkeley.edu \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@sifive.com \
--cc=paul.walmsley@sifive.com \
--cc=wangkefeng.wang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).