* [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
* [PATCH 2/2] riscv: Fix undefined reference to vmemmap_populate_basepages
2019-10-23 3:23 [PATCH 1/2] riscv: Fix implicit declaration of 'page_to_section' Kefeng Wang
@ 2019-10-23 3:23 ` Kefeng Wang
2019-10-23 15:58 ` Logan Gunthorpe
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
2 siblings, 1 reply; 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
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'
Cc: Logan Gunthorpe <logang@deltatee.com>
Fixes: d95f1a542c3d ("RISC-V: Implement sparsemem")
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
arch/riscv/mm/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 83f7d12042fb..a1ca6200c31f 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -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)
{
--
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
* Re: [PATCH 2/2] riscv: Fix undefined reference to vmemmap_populate_basepages
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
0 siblings, 1 reply; 7+ messages in thread
From: Logan Gunthorpe @ 2019-10-23 15:58 UTC (permalink / raw)
To: Kefeng Wang, Paul Walmsley; +Cc: linux-riscv, Palmer Dabbelt, Albert Ou
On 2019-10-22 9:23 p.m., Kefeng Wang wrote:
> 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'
>
> Cc: Logan Gunthorpe <logang@deltatee.com>
> Fixes: d95f1a542c3d ("RISC-V: Implement sparsemem")
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Yup!
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
> ---
> arch/riscv/mm/init.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 83f7d12042fb..a1ca6200c31f 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -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
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] riscv: Fix undefined reference to vmemmap_populate_basepages
2019-10-23 15:58 ` Logan Gunthorpe
@ 2019-10-23 18:26 ` Paul Walmsley
0 siblings, 0 replies; 7+ messages in thread
From: Paul Walmsley @ 2019-10-23 18:26 UTC (permalink / raw)
To: Logan Gunthorpe; +Cc: Kefeng Wang, Palmer Dabbelt, linux-riscv, Albert Ou
On Wed, 23 Oct 2019, Logan Gunthorpe wrote:
> On 2019-10-22 9:23 p.m., Kefeng Wang wrote:
> > 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'
> >
> > Cc: Logan Gunthorpe <logang@deltatee.com>
> > Fixes: d95f1a542c3d ("RISC-V: Implement sparsemem")
> > Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>
> Yup!
>
> Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Thanks, queued for v5.4-rc.
- Paul
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] riscv: Fix implicit declaration of 'page_to_section'
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:56 ` Logan Gunthorpe
2019-10-23 18:47 ` Paul Walmsley
2 siblings, 0 replies; 7+ messages in thread
From: Logan Gunthorpe @ 2019-10-23 15:56 UTC (permalink / raw)
To: Kefeng Wang, Paul Walmsley; +Cc: linux-riscv, Palmer Dabbelt, Albert Ou
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] riscv: Fix implicit declaration of 'page_to_section'
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: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
2 siblings, 1 reply; 7+ messages in thread
From: Paul Walmsley @ 2019-10-23 18:47 UTC (permalink / raw)
To: Kefeng Wang; +Cc: linux-riscv, Palmer Dabbelt, Logan Gunthorpe, Albert Ou
[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]
On Wed, 23 Oct 2019, 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>
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
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] riscv: Fix implicit declaration of 'page_to_section'
2019-10-23 18:47 ` Paul Walmsley
@ 2019-10-24 0:45 ` Kefeng Wang
0 siblings, 0 replies; 7+ messages in thread
From: Kefeng Wang @ 2019-10-24 0:45 UTC (permalink / raw)
To: Paul Walmsley; +Cc: linux-riscv, Palmer Dabbelt, Logan Gunthorpe, Albert Ou
On 2019/10/24 2:47, Paul Walmsley wrote:
> On Wed, 23 Oct 2019, 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>
>
> 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
> ---
>
oops.
> Please run 'checkpatch.pl --strict' on patches before submitting.
>
Ok, will do next time.
> Anyway, these have been fixed up here and queued for v5.4-rc with Logan's
> Reviewed-by:.
>
Thanks.
>
> - Paul
>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [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).