linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback()
@ 2023-11-29 13:19 Michael Ellerman
  2023-11-29 13:19 ` [PATCH 2/5] powerpc/512x: Make pdm360ng_init() static Michael Ellerman
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Michael Ellerman @ 2023-11-29 13:19 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: arnd

With HIBERNATION=y the build breaks with:

  arch/powerpc/kernel/swsusp_64.c:14:6: error: no previous prototype for ‘do_after_copyback’ [-Werror=missing-prototypes]
  14 | void do_after_copyback(void)
     |      ^~~~~~~~~~~~~~~~~

do_after_copyback() is only called from asm, so there is no prototype,
nor any header where it makes sense to place one. Just add a prototype
in the C file to fix the build error.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/swsusp_64.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kernel/swsusp_64.c b/arch/powerpc/kernel/swsusp_64.c
index 16ee3baaf09a..50fa8fc9ef95 100644
--- a/arch/powerpc/kernel/swsusp_64.c
+++ b/arch/powerpc/kernel/swsusp_64.c
@@ -11,6 +11,8 @@
 #include <linux/interrupt.h>
 #include <linux/nmi.h>
 
+void do_after_copyback(void);
+
 void do_after_copyback(void)
 {
 	iommu_restore();
-- 
2.41.0


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

* [PATCH 2/5] powerpc/512x:  Make pdm360ng_init() static
  2023-11-29 13:19 [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback() Michael Ellerman
@ 2023-11-29 13:19 ` Michael Ellerman
  2023-11-29 13:19 ` [PATCH 3/5] powerpc/512x: Fix missing prototype warnings Michael Ellerman
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Michael Ellerman @ 2023-11-29 13:19 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: arnd

The mpc512x_defconfig config fails with:

  arch/powerpc/platforms/512x/pdm360ng.c:104:13: error: no previous prototype for ‘pdm360ng_init’ [-Werror=missing-prototypes]
  104 | void __init pdm360ng_init(void)
      |             ^~~~~~~~~~~~~

Fix it by making pdm360ng_init() static.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/platforms/512x/pdm360ng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/512x/pdm360ng.c b/arch/powerpc/platforms/512x/pdm360ng.c
index ce51cfeeb066..8bbbf78bb42b 100644
--- a/arch/powerpc/platforms/512x/pdm360ng.c
+++ b/arch/powerpc/platforms/512x/pdm360ng.c
@@ -101,7 +101,7 @@ static inline void __init pdm360ng_touchscreen_init(void)
 }
 #endif /* CONFIG_TOUCHSCREEN_ADS7846 */
 
-void __init pdm360ng_init(void)
+static void __init pdm360ng_init(void)
 {
 	mpc512x_init();
 	pdm360ng_touchscreen_init();
-- 
2.41.0


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

* [PATCH 3/5] powerpc/512x: Fix missing prototype warnings
  2023-11-29 13:19 [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback() Michael Ellerman
  2023-11-29 13:19 ` [PATCH 2/5] powerpc/512x: Make pdm360ng_init() static Michael Ellerman
@ 2023-11-29 13:19 ` Michael Ellerman
  2023-11-29 13:19 ` [PATCH 4/5] powerpc/44x: Make ppc44x_idle_init() static Michael Ellerman
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Michael Ellerman @ 2023-11-29 13:19 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: arnd

The mpc512x_defconfig build fails with:

  arch/powerpc/platforms/512x/mpc5121_ads_cpld.c:142:1: error: no previous prototype for ‘mpc5121_ads_cpld_map’ [-Werror=missing-prototypes]
  142 | mpc5121_ads_cpld_map(void)
      | ^~~~~~~~~~~~~~~~~~~~
  arch/powerpc/platforms/512x/mpc5121_ads_cpld.c:157:1: error: no previous prototype for ‘mpc5121_ads_cpld_pic_init’ [-Werror=missing-prototypes]
  157 | mpc5121_ads_cpld_pic_init(void)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~

There are prototypes for these functions but the header they are in is
not included by mpc5121_ads_cpld.c. Include it to fix the build error.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/platforms/512x/mpc5121_ads_cpld.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
index 6f08d07aee3b..e995eb30bf09 100644
--- a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
+++ b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
@@ -17,6 +17,8 @@
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 
+#include "mpc5121_ads.h"
+
 static struct device_node *cpld_pic_node;
 static struct irq_domain *cpld_pic_host;
 
-- 
2.41.0


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

* [PATCH 4/5] powerpc/44x: Make ppc44x_idle_init() static
  2023-11-29 13:19 [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback() Michael Ellerman
  2023-11-29 13:19 ` [PATCH 2/5] powerpc/512x: Make pdm360ng_init() static Michael Ellerman
  2023-11-29 13:19 ` [PATCH 3/5] powerpc/512x: Fix missing prototype warnings Michael Ellerman
@ 2023-11-29 13:19 ` Michael Ellerman
  2023-11-29 13:19 ` [PATCH 5/5] powerpc/64s: Fix CONFIG_NUMA=n build Michael Ellerman
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Michael Ellerman @ 2023-11-29 13:19 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: arnd

The 44x/fsp2_defconfig build fails with:

  arch/powerpc/platforms/44x/idle.c:30:12: error: no previous prototype for ‘ppc44x_idle_init’ [-Werror=missing-prototypes]
  30 | int __init ppc44x_idle_init(void)
     |            ^~~~~~~~~~~~~~~~

Fix it by making ppc44x_idle_init() static.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/platforms/44x/idle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/44x/idle.c b/arch/powerpc/platforms/44x/idle.c
index f533b495e7db..e2eeef8dff78 100644
--- a/arch/powerpc/platforms/44x/idle.c
+++ b/arch/powerpc/platforms/44x/idle.c
@@ -27,7 +27,7 @@ static void ppc44x_idle(void)
 	isync();
 }
 
-int __init ppc44x_idle_init(void)
+static int __init ppc44x_idle_init(void)
 {
 	if (!mode_spin) {
 		/* If we are not setting spin mode 
-- 
2.41.0


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

* [PATCH 5/5] powerpc/64s: Fix CONFIG_NUMA=n build
  2023-11-29 13:19 [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback() Michael Ellerman
                   ` (2 preceding siblings ...)
  2023-11-29 13:19 ` [PATCH 4/5] powerpc/44x: Make ppc44x_idle_init() static Michael Ellerman
@ 2023-11-29 13:19 ` Michael Ellerman
  2023-11-29 13:25   ` Arnd Bergmann
  2023-11-29 13:40 ` [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback() Arnd Bergmann
  2023-12-07 12:38 ` Michael Ellerman
  5 siblings, 1 reply; 10+ messages in thread
From: Michael Ellerman @ 2023-11-29 13:19 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: arnd

With CONFIG_NUMA=n the build fails with:

  arch/powerpc/mm/book3s64/pgtable.c:275:15: error: no previous prototype for ‘create_section_mapping’ [-Werror=missing-prototypes]
  275 | int __meminit create_section_mapping(unsigned long start, unsigned long end,
      |               ^~~~~~~~~~~~~~~~~~~~~~

That happens because the prototype for create_section_mapping() is in
asm/mmzone.h, but asm/mmzone.h is only included by linux/mmzone.h
when CONFIG_NUMA=y.

In fact the prototype is only needed by arch/powerpc/mm code, so move
the prototype into arch/powerpc/mm/mmu_decl.h, which also fixes the
build error.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/include/asm/mmzone.h | 5 -----
 arch/powerpc/mm/mmu_decl.h        | 5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/include/asm/mmzone.h b/arch/powerpc/include/asm/mmzone.h
index 4c6c6dbd182f..4740ca230d36 100644
--- a/arch/powerpc/include/asm/mmzone.h
+++ b/arch/powerpc/include/asm/mmzone.h
@@ -46,10 +46,5 @@ u64 memory_hotplug_max(void);
 #define __HAVE_ARCH_RESERVED_KERNEL_PAGES
 #endif
 
-#ifdef CONFIG_MEMORY_HOTPLUG
-extern int create_section_mapping(unsigned long start, unsigned long end,
-				  int nid, pgprot_t prot);
-#endif
-
 #endif /* __KERNEL__ */
 #endif /* _ASM_MMZONE_H_ */
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
index 7f9ff0640124..72341b9fb552 100644
--- a/arch/powerpc/mm/mmu_decl.h
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -181,3 +181,8 @@ static inline bool debug_pagealloc_enabled_or_kfence(void)
 {
 	return IS_ENABLED(CONFIG_KFENCE) || debug_pagealloc_enabled();
 }
+
+#ifdef CONFIG_MEMORY_HOTPLUG
+int create_section_mapping(unsigned long start, unsigned long end,
+			   int nid, pgprot_t prot);
+#endif
-- 
2.41.0


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

* Re: [PATCH 5/5] powerpc/64s: Fix CONFIG_NUMA=n build
  2023-11-29 13:19 ` [PATCH 5/5] powerpc/64s: Fix CONFIG_NUMA=n build Michael Ellerman
@ 2023-11-29 13:25   ` Arnd Bergmann
  2023-11-30  6:43     ` Michael Ellerman
  0 siblings, 1 reply; 10+ messages in thread
From: Arnd Bergmann @ 2023-11-29 13:25 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev

On Wed, Nov 29, 2023, at 14:19, Michael Ellerman wrote:
> diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
> index 7f9ff0640124..72341b9fb552 100644
> --- a/arch/powerpc/mm/mmu_decl.h
> +++ b/arch/powerpc/mm/mmu_decl.h
> +
> +#ifdef CONFIG_MEMORY_HOTPLUG
> +int create_section_mapping(unsigned long start, unsigned long end,
> +			   int nid, pgprot_t prot);
> +#endif

This one should probably go next to the remove_section_mapping()
declaration in arch/powerpc/include/asm/sparsemem.h for consistency.

I would personally remove the #ifdef as well, but there is
already one in that file.

     Arnd

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

* Re: [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback()
  2023-11-29 13:19 [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback() Michael Ellerman
                   ` (3 preceding siblings ...)
  2023-11-29 13:19 ` [PATCH 5/5] powerpc/64s: Fix CONFIG_NUMA=n build Michael Ellerman
@ 2023-11-29 13:40 ` Arnd Bergmann
  2023-12-07 12:38 ` Michael Ellerman
  5 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2023-11-29 13:40 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev

On Wed, Nov 29, 2023, at 14:19, Michael Ellerman wrote:
> With HIBERNATION=y the build breaks with:
>
>   arch/powerpc/kernel/swsusp_64.c:14:6: error: no previous prototype 
> for ‘do_after_copyback’ [-Werror=missing-prototypes]
>   14 | void do_after_copyback(void)
>      |      ^~~~~~~~~~~~~~~~~
>
> do_after_copyback() is only called from asm, so there is no prototype,
> nor any header where it makes sense to place one. Just add a prototype
> in the C file to fix the build error.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Thanks for helping out with the rest. For the series (aside from the
very minor comment):

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH 5/5] powerpc/64s: Fix CONFIG_NUMA=n build
  2023-11-29 13:25   ` Arnd Bergmann
@ 2023-11-30  6:43     ` Michael Ellerman
  2023-11-30  8:07       ` Arnd Bergmann
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Ellerman @ 2023-11-30  6:43 UTC (permalink / raw)
  To: Arnd Bergmann, linuxppc-dev

"Arnd Bergmann" <arnd@arndb.de> writes:
> On Wed, Nov 29, 2023, at 14:19, Michael Ellerman wrote:
>> diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
>> index 7f9ff0640124..72341b9fb552 100644
>> --- a/arch/powerpc/mm/mmu_decl.h
>> +++ b/arch/powerpc/mm/mmu_decl.h
>> +
>> +#ifdef CONFIG_MEMORY_HOTPLUG
>> +int create_section_mapping(unsigned long start, unsigned long end,
>> +			   int nid, pgprot_t prot);
>> +#endif
>
> This one should probably go next to the remove_section_mapping()
> declaration in arch/powerpc/include/asm/sparsemem.h for consistency.
 
That doesn't work due to:

In file included from ../include/linux/numa.h:26,
                 from ../include/linux/async.h:13,
                 from ../init/initramfs.c:3:
../arch/powerpc/include/asm/sparsemem.h:19:44: error: unknown type name ‘pgprot_t’
   19 |                                   int nid, pgprot_t prot);
      |                                            ^~~~~~~~

Which might be fixable, but I'd rather just move
remove_section_mapping() into mmu_decl.h as well.

cheers

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

* Re: [PATCH 5/5] powerpc/64s: Fix CONFIG_NUMA=n build
  2023-11-30  6:43     ` Michael Ellerman
@ 2023-11-30  8:07       ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2023-11-30  8:07 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev

On Thu, Nov 30, 2023, at 07:43, Michael Ellerman wrote:
> "Arnd Bergmann" <arnd@arndb.de> writes:
>> On Wed, Nov 29, 2023, at 14:19, Michael Ellerman wrote:
>>> diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
>>> index 7f9ff0640124..72341b9fb552 100644
>>> --- a/arch/powerpc/mm/mmu_decl.h
>>> +++ b/arch/powerpc/mm/mmu_decl.h
>>> +
>>> +#ifdef CONFIG_MEMORY_HOTPLUG
>>> +int create_section_mapping(unsigned long start, unsigned long end,
>>> +			   int nid, pgprot_t prot);
>>> +#endif
>>
>> This one should probably go next to the remove_section_mapping()
>> declaration in arch/powerpc/include/asm/sparsemem.h for consistency.
> 
> That doesn't work due to:
>
> In file included from ../include/linux/numa.h:26,
>                  from ../include/linux/async.h:13,
>                  from ../init/initramfs.c:3:
> ../arch/powerpc/include/asm/sparsemem.h:19:44: error: unknown type name 
> ‘pgprot_t’
>    19 |                                   int nid, pgprot_t prot);
>       |                                            ^~~~~~~~
>
> Which might be fixable, but I'd rather just move
> remove_section_mapping() into mmu_decl.h as well.

Ok, makes sense.

     Arnd

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

* Re: [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback()
  2023-11-29 13:19 [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback() Michael Ellerman
                   ` (4 preceding siblings ...)
  2023-11-29 13:40 ` [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback() Arnd Bergmann
@ 2023-12-07 12:38 ` Michael Ellerman
  5 siblings, 0 replies; 10+ messages in thread
From: Michael Ellerman @ 2023-12-07 12:38 UTC (permalink / raw)
  To: linuxppc-dev, Michael Ellerman; +Cc: arnd

On Thu, 30 Nov 2023 00:19:15 +1100, Michael Ellerman wrote:
> With HIBERNATION=y the build breaks with:
> 
>   arch/powerpc/kernel/swsusp_64.c:14:6: error: no previous prototype for ‘do_after_copyback’ [-Werror=missing-prototypes]
>   14 | void do_after_copyback(void)
>      |      ^~~~~~~~~~~~~~~~~
> 
> do_after_copyback() is only called from asm, so there is no prototype,
> nor any header where it makes sense to place one. Just add a prototype
> in the C file to fix the build error.
> 
> [...]

Applied to powerpc/next.

[1/5] powerpc/suspend: Add prototype for do_after_copyback()
      https://git.kernel.org/powerpc/c/360f051d82ee0cc580edfffe9e8c0b93011ab86d
[2/5] powerpc/512x: Make pdm360ng_init() static
      https://git.kernel.org/powerpc/c/24afc61990de29dd47be7642c196a173f6cc21fc
[3/5] powerpc/512x: Fix missing prototype warnings
      https://git.kernel.org/powerpc/c/10feb8f9612239b665815807e950bcd999a75dd2
[4/5] powerpc/44x: Make ppc44x_idle_init() static
      https://git.kernel.org/powerpc/c/b90ad501715f2feb1b0bf97aa700adb39c78deb3
[5/5] powerpc/64s: Fix CONFIG_NUMA=n build
      https://git.kernel.org/powerpc/c/ede66cd22441820cbd399936bf84fdc4294bc7fa

cheers

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

end of thread, other threads:[~2023-12-07 12:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-29 13:19 [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback() Michael Ellerman
2023-11-29 13:19 ` [PATCH 2/5] powerpc/512x: Make pdm360ng_init() static Michael Ellerman
2023-11-29 13:19 ` [PATCH 3/5] powerpc/512x: Fix missing prototype warnings Michael Ellerman
2023-11-29 13:19 ` [PATCH 4/5] powerpc/44x: Make ppc44x_idle_init() static Michael Ellerman
2023-11-29 13:19 ` [PATCH 5/5] powerpc/64s: Fix CONFIG_NUMA=n build Michael Ellerman
2023-11-29 13:25   ` Arnd Bergmann
2023-11-30  6:43     ` Michael Ellerman
2023-11-30  8:07       ` Arnd Bergmann
2023-11-29 13:40 ` [PATCH 1/5] powerpc/suspend: Add prototype for do_after_copyback() Arnd Bergmann
2023-12-07 12:38 ` Michael Ellerman

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