mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] w90p910_ether: remove incorrect __init annotation
@ 2018-12-10 20:45 Arnd Bergmann
  2018-12-14 21:23 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2018-12-10 20:45 UTC (permalink / raw)
  To: Wan ZongShun, David S. Miller
  Cc: Arnd Bergmann, linux-arm-kernel, netdev, linux-kernel

The get_mac_address() function is normally inline, but when it is
not, we get a warning that this configuration is broken:

WARNING: vmlinux.o(.text+0x4aff00): Section mismatch in reference from the function w90p910_ether_setup() to the function .init.text:get_mac_address()
The function w90p910_ether_setup() references
the function __init get_mac_address().
This is often because w90p910_ether_setup lacks a __init

Remove the __init to make it always do the right thing.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/nuvoton/w90p910_ether.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/nuvoton/w90p910_ether.c b/drivers/net/ethernet/nuvoton/w90p910_ether.c
index 052b3d2c07a1..c662c6f5bee3 100644
--- a/drivers/net/ethernet/nuvoton/w90p910_ether.c
+++ b/drivers/net/ethernet/nuvoton/w90p910_ether.c
@@ -912,7 +912,7 @@ static const struct net_device_ops w90p910_ether_netdev_ops = {
 	.ndo_validate_addr	= eth_validate_addr,
 };
 
-static void __init get_mac_address(struct net_device *dev)
+static void get_mac_address(struct net_device *dev)
 {
 	struct w90p910_ether *ether = netdev_priv(dev);
 	struct platform_device *pdev;
-- 
2.20.0


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

* Re: [PATCH] w90p910_ether: remove incorrect __init annotation
  2018-12-10 20:45 [PATCH] w90p910_ether: remove incorrect __init annotation Arnd Bergmann
@ 2018-12-14 21:23 ` David Miller
  2018-12-14 22:22   ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2018-12-14 21:23 UTC (permalink / raw)
  To: arnd; +Cc: mcuos.com, linux-arm-kernel, netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 10 Dec 2018 21:45:07 +0100

> The get_mac_address() function is normally inline, but when it is
> not, we get a warning that this configuration is broken:
> 
> WARNING: vmlinux.o(.text+0x4aff00): Section mismatch in reference from the function w90p910_ether_setup() to the function .init.text:get_mac_address()
> The function w90p910_ether_setup() references
> the function __init get_mac_address().
> This is often because w90p910_ether_setup lacks a __init
> 
> Remove the __init to make it always do the right thing.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Actually I think we can validly mark w90p910_ether_setup() and
w90p910_probe() with appropriate init tagging.  None of these
functions are invoked outside of the probing paths.


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

* Re: [PATCH] w90p910_ether: remove incorrect __init annotation
  2018-12-14 21:23 ` David Miller
@ 2018-12-14 22:22   ` Arnd Bergmann
  2018-12-14 22:43     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2018-12-14 22:22 UTC (permalink / raw)
  To: David Miller
  Cc: Wan ZongShun, Linux ARM, Networking, Linux Kernel Mailing List

On Fri, Dec 14, 2018 at 10:23 PM David Miller <davem@davemloft.net> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
> Date: Mon, 10 Dec 2018 21:45:07 +0100
>
> > The get_mac_address() function is normally inline, but when it is
> > not, we get a warning that this configuration is broken:
> >
> > WARNING: vmlinux.o(.text+0x4aff00): Section mismatch in reference from the function w90p910_ether_setup() to the function .init.text:get_mac_address()
> > The function w90p910_ether_setup() references
> > the function __init get_mac_address().
> > This is often because w90p910_ether_setup lacks a __init
> >
> > Remove the __init to make it always do the right thing.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Actually I think we can validly mark w90p910_ether_setup() and
> w90p910_probe() with appropriate init tagging.  None of these
> functions are invoked outside of the probing paths.

But then we have to change the driver to use
module_platform_driver_probe(), to ensure we cannot
unbind/rebind the device. I usually don't like doing that,
unless the device can never be stopped after it has
been initialized.

       Arnd

       Arnd

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

* Re: [PATCH] w90p910_ether: remove incorrect __init annotation
  2018-12-14 22:22   ` Arnd Bergmann
@ 2018-12-14 22:43     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-12-14 22:43 UTC (permalink / raw)
  To: arnd; +Cc: mcuos.com, linux-arm-kernel, netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 14 Dec 2018 23:22:10 +0100

> On Fri, Dec 14, 2018 at 10:23 PM David Miller <davem@davemloft.net> wrote:
>>
>> From: Arnd Bergmann <arnd@arndb.de>
>> Date: Mon, 10 Dec 2018 21:45:07 +0100
>>
>> > The get_mac_address() function is normally inline, but when it is
>> > not, we get a warning that this configuration is broken:
>> >
>> > WARNING: vmlinux.o(.text+0x4aff00): Section mismatch in reference from the function w90p910_ether_setup() to the function .init.text:get_mac_address()
>> > The function w90p910_ether_setup() references
>> > the function __init get_mac_address().
>> > This is often because w90p910_ether_setup lacks a __init
>> >
>> > Remove the __init to make it always do the right thing.
>> >
>> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>>
>> Actually I think we can validly mark w90p910_ether_setup() and
>> w90p910_probe() with appropriate init tagging.  None of these
>> functions are invoked outside of the probing paths.
> 
> But then we have to change the driver to use
> module_platform_driver_probe(), to ensure we cannot
> unbind/rebind the device. I usually don't like doing that,
> unless the device can never be stopped after it has
> been initialized.

Fair enough, let's go with your simpler fix for now.

Applied.

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

end of thread, other threads:[~2018-12-14 22:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 20:45 [PATCH] w90p910_ether: remove incorrect __init annotation Arnd Bergmann
2018-12-14 21:23 ` David Miller
2018-12-14 22:22   ` Arnd Bergmann
2018-12-14 22:43     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®