diff mbox series

[v2,7/7] sparc32: Fix section mismatch in leon_pci_grpci

Message ID 20240224-sam-fix-sparc32-all-builds-v2-7-1f186603c5c4@ravnborg.org
State New
Headers show
Series sparc32: build fixes for all{yes,mod}config builds | expand

Commit Message

Sam Ravnborg via B4 Relay Feb. 24, 2024, 5:42 p.m. UTC
From: Sam Ravnborg <sam@ravnborg.org>

Passing a datastructre marked _initconst to platform_driver_register()
is wrong. Drop the __initconst notation.

This fixes the following warnings:

WARNING: modpost: vmlinux: section mismatch in reference: grpci1_of_driver+0x30 (section: .data) -> grpci1_of_match (section: .init.rodata)
WARNING: modpost: vmlinux: section mismatch in reference: grpci2_of_driver+0x30 (section: .data) -> grpci2_of_match (section: .init.rodata)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andreas Larsson <andreas@gaisler.com>
---
 arch/sparc/kernel/leon_pci_grpci1.c | 2 +-
 arch/sparc/kernel/leon_pci_grpci2.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Randy Dunlap March 2, 2024, 11:54 p.m. UTC | #1
On 2/24/24 09:42, Sam Ravnborg via B4 Relay wrote:
> From: Sam Ravnborg <sam@ravnborg.org>
> 
> Passing a datastructre marked _initconst to platform_driver_register()
> is wrong. Drop the __initconst notation.
> 
> This fixes the following warnings:
> 
> WARNING: modpost: vmlinux: section mismatch in reference: grpci1_of_driver+0x30 (section: .data) -> grpci1_of_match (section: .init.rodata)
> WARNING: modpost: vmlinux: section mismatch in reference: grpci2_of_driver+0x30 (section: .data) -> grpci2_of_match (section: .init.rodata)
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Andreas Larsson <andreas@gaisler.com>

Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

Thanks.

> ---
>  arch/sparc/kernel/leon_pci_grpci1.c | 2 +-
>  arch/sparc/kernel/leon_pci_grpci2.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/sparc/kernel/leon_pci_grpci1.c b/arch/sparc/kernel/leon_pci_grpci1.c
> index 8700a0e3b0df..b2b639bee068 100644
> --- a/arch/sparc/kernel/leon_pci_grpci1.c
> +++ b/arch/sparc/kernel/leon_pci_grpci1.c
> @@ -697,7 +697,7 @@ static int grpci1_of_probe(struct platform_device *ofdev)
>  	return err;
>  }
>  
> -static const struct of_device_id grpci1_of_match[] __initconst = {
> +static const struct of_device_id grpci1_of_match[] = {
>  	{
>  	 .name = "GAISLER_PCIFBRG",
>  	 },
> diff --git a/arch/sparc/kernel/leon_pci_grpci2.c b/arch/sparc/kernel/leon_pci_grpci2.c
> index 282b49d496ea..9f662340b5b2 100644
> --- a/arch/sparc/kernel/leon_pci_grpci2.c
> +++ b/arch/sparc/kernel/leon_pci_grpci2.c
> @@ -889,7 +889,7 @@ static int grpci2_of_probe(struct platform_device *ofdev)
>  	return err;
>  }
>  
> -static const struct of_device_id grpci2_of_match[] __initconst = {
> +static const struct of_device_id grpci2_of_match[] = {
>  	{
>  	 .name = "GAISLER_GRPCI2",
>  	 },
>
Andreas Larsson March 5, 2024, 3:06 p.m. UTC | #2
On 2024-02-24 18:42, Sam Ravnborg via B4 Relay wrote:
> From: Sam Ravnborg <sam@ravnborg.org>
> 
> Passing a datastructre marked _initconst to platform_driver_register()
> is wrong. Drop the __initconst notation.
> 
> This fixes the following warnings:
> 
> WARNING: modpost: vmlinux: section mismatch in reference: grpci1_of_driver+0x30 (section: .data) -> grpci1_of_match (section: .init.rodata)
> WARNING: modpost: vmlinux: section mismatch in reference: grpci2_of_driver+0x30 (section: .data) -> grpci2_of_match (section: .init.rodata)
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Andreas Larsson <andreas@gaisler.com>

Could you also add

Fixes: 4154bb821f0b ("sparc: leon: grpci1: constify of_device_id")
Fixes: 03949b1cb9f1 ("sparc: leon: grpci2: constify of_device_id")

for these fixes in your v3 of the series as well as CCing stable?

> ---
>  arch/sparc/kernel/leon_pci_grpci1.c | 2 +-
>  arch/sparc/kernel/leon_pci_grpci2.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/sparc/kernel/leon_pci_grpci1.c b/arch/sparc/kernel/leon_pci_grpci1.c
> index 8700a0e3b0df..b2b639bee068 100644
> --- a/arch/sparc/kernel/leon_pci_grpci1.c
> +++ b/arch/sparc/kernel/leon_pci_grpci1.c
> @@ -697,7 +697,7 @@ static int grpci1_of_probe(struct platform_device *ofdev)
>  	return err;
>  }
>  
> -static const struct of_device_id grpci1_of_match[] __initconst = {
> +static const struct of_device_id grpci1_of_match[] = {
>  	{
>  	 .name = "GAISLER_PCIFBRG",
>  	 },
> diff --git a/arch/sparc/kernel/leon_pci_grpci2.c b/arch/sparc/kernel/leon_pci_grpci2.c
> index 282b49d496ea..9f662340b5b2 100644
> --- a/arch/sparc/kernel/leon_pci_grpci2.c
> +++ b/arch/sparc/kernel/leon_pci_grpci2.c
> @@ -889,7 +889,7 @@ static int grpci2_of_probe(struct platform_device *ofdev)
>  	return err;
>  }
>  
> -static const struct of_device_id grpci2_of_match[] __initconst = {
> +static const struct of_device_id grpci2_of_match[] = {
>  	{
>  	 .name = "GAISLER_GRPCI2",
>  	 },
> 

Thanks,
Andreas
Andreas Larsson March 7, 2024, 6:20 p.m. UTC | #3
On 2024-03-05 16:06, Andreas Larsson wrote:
> On 2024-02-24 18:42, Sam Ravnborg via B4 Relay wrote:
>> From: Sam Ravnborg <sam@ravnborg.org>
>>
>> Passing a datastructre marked _initconst to platform_driver_register()
>> is wrong. Drop the __initconst notation.
>>
>> This fixes the following warnings:
>>
>> WARNING: modpost: vmlinux: section mismatch in reference: grpci1_of_driver+0x30 (section: .data) -> grpci1_of_match (section: .init.rodata)
>> WARNING: modpost: vmlinux: section mismatch in reference: grpci2_of_driver+0x30 (section: .data) -> grpci2_of_match (section: .init.rodata)
>>
>> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: Andreas Larsson <andreas@gaisler.com>
> 
> Could you also add
> 
> Fixes: 4154bb821f0b ("sparc: leon: grpci1: constify of_device_id")
> Fixes: 03949b1cb9f1 ("sparc: leon: grpci2: constify of_device_id")
> 
> for these fixes in your v3 of the series as well as CCing stable?

I'll pick up the whole series apart for the ZONE_DMA removal, so there
is no other need for a v3. I can add the Fixes lines to this one, if it
is ok with you Sam, or take it as is.

Thanks,
Andreas
Maciej W. Rozycki March 7, 2024, 8:16 p.m. UTC | #4
On Thu, 7 Mar 2024, Andreas Larsson wrote:

> I'll pick up the whole series apart for the ZONE_DMA removal, so there
> is no other need for a v3. I can add the Fixes lines to this one, if it
> is ok with you Sam, or take it as is.

 Can I have the spelling of my name fixed though (which was supposed to be 
included with v3)?

  Maciej
Andreas Larsson March 8, 2024, 7:06 a.m. UTC | #5
On 2024-03-07 21:16, Maciej W. Rozycki wrote:
> On Thu, 7 Mar 2024, Andreas Larsson wrote:
> 
>> I'll pick up the whole series apart for the ZONE_DMA removal, so there
>> is no other need for a v3. I can add the Fixes lines to this one, if it
>> is ok with you Sam, or take it as is.
> 
>  Can I have the spelling of my name fixed though (which was supposed to be 
> included with v3)?
> 
>   Maciej

Based on the outcome of the testing and discussions that followed I will
not pick up the "sparc32: Do not select ZONE_DMA" patch from

https://lore.kernel.org/sparclinux/20240224-sam-fix-sparc32-all-builds-v2-4-1f186603c5c4@ravnborg.org/

which was the one that got your name misspelled, unless I missed some
other occurrence.

Cheers,
Andreas
Maciej W. Rozycki March 8, 2024, 12:09 p.m. UTC | #6
On Fri, 8 Mar 2024, Andreas Larsson wrote:

> Based on the outcome of the testing and discussions that followed I will
> not pick up the "sparc32: Do not select ZONE_DMA" patch from
> 
> https://lore.kernel.org/sparclinux/20240224-sam-fix-sparc32-all-builds-v2-4-1f186603c5c4@ravnborg.org/
> 
> which was the one that got your name misspelled, unless I missed some
> other occurrence.

 Ah, OK then, thank you for double-checking.

  Maciej
Andreas Larsson March 8, 2024, 8:07 p.m. UTC | #7
On 2024-02-24 18:42, Sam Ravnborg via B4 Relay wrote:
> From: Sam Ravnborg <sam@ravnborg.org>
> 
> Passing a datastructre marked _initconst to platform_driver_register()
> is wrong. Drop the __initconst notation.
> 
> This fixes the following warnings:
> 
> WARNING: modpost: vmlinux: section mismatch in reference: grpci1_of_driver+0x30 (section: .data) -> grpci1_of_match (section: .init.rodata)
> WARNING: modpost: vmlinux: section mismatch in reference: grpci2_of_driver+0x30 (section: .data) -> grpci2_of_match (section: .init.rodata)
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Andreas Larsson <andreas@gaisler.com>
> ---
>  arch/sparc/kernel/leon_pci_grpci1.c | 2 +-
>  arch/sparc/kernel/leon_pci_grpci2.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Tested-by: Andreas Larsson <andreas@gaisler.com>

Picking this up to my for-next.

Thanks,
Andreas
Sam Ravnborg March 8, 2024, 10:08 p.m. UTC | #8
Hi Andreas,

On Thu, Mar 07, 2024 at 07:20:11PM +0100, Andreas Larsson wrote:
> On 2024-03-05 16:06, Andreas Larsson wrote:
> > On 2024-02-24 18:42, Sam Ravnborg via B4 Relay wrote:
> >> From: Sam Ravnborg <sam@ravnborg.org>
> >>
> >> Passing a datastructre marked _initconst to platform_driver_register()
> >> is wrong. Drop the __initconst notation.
> >>
> >> This fixes the following warnings:
> >>
> >> WARNING: modpost: vmlinux: section mismatch in reference: grpci1_of_driver+0x30 (section: .data) -> grpci1_of_match (section: .init.rodata)
> >> WARNING: modpost: vmlinux: section mismatch in reference: grpci2_of_driver+0x30 (section: .data) -> grpci2_of_match (section: .init.rodata)
> >>
> >> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> >> Cc: "David S. Miller" <davem@davemloft.net>
> >> Cc: Andreas Larsson <andreas@gaisler.com>
> > 
> > Could you also add
> > 
> > Fixes: 4154bb821f0b ("sparc: leon: grpci1: constify of_device_id")
> > Fixes: 03949b1cb9f1 ("sparc: leon: grpci2: constify of_device_id")
> > 
> > for these fixes in your v3 of the series as well as CCing stable?
> 
> I'll pick up the whole series apart for the ZONE_DMA removal, so there
> is no other need for a v3. I can add the Fixes lines to this one, if it
> is ok with you Sam, or take it as is.

I did not verify the two fixes lines - but seems legit.
So would be super if you add them before applying.

Thanks for picking up the other patches, we are now much closer to
an all{yes,mod}config that can build (but not link).

	Sam
diff mbox series

Patch

diff --git a/arch/sparc/kernel/leon_pci_grpci1.c b/arch/sparc/kernel/leon_pci_grpci1.c
index 8700a0e3b0df..b2b639bee068 100644
--- a/arch/sparc/kernel/leon_pci_grpci1.c
+++ b/arch/sparc/kernel/leon_pci_grpci1.c
@@ -697,7 +697,7 @@  static int grpci1_of_probe(struct platform_device *ofdev)
 	return err;
 }
 
-static const struct of_device_id grpci1_of_match[] __initconst = {
+static const struct of_device_id grpci1_of_match[] = {
 	{
 	 .name = "GAISLER_PCIFBRG",
 	 },
diff --git a/arch/sparc/kernel/leon_pci_grpci2.c b/arch/sparc/kernel/leon_pci_grpci2.c
index 282b49d496ea..9f662340b5b2 100644
--- a/arch/sparc/kernel/leon_pci_grpci2.c
+++ b/arch/sparc/kernel/leon_pci_grpci2.c
@@ -889,7 +889,7 @@  static int grpci2_of_probe(struct platform_device *ofdev)
 	return err;
 }
 
-static const struct of_device_id grpci2_of_match[] __initconst = {
+static const struct of_device_id grpci2_of_match[] = {
 	{
 	 .name = "GAISLER_GRPCI2",
 	 },