From: David Miller <davem@davemloft.net>
To: arnd@arndb.de
Cc: srinivas.kandagatla@linaro.org, mike.looijmans@topic.nl,
f.fainelli@gmail.com, andrew@lunn.ch, netdev@vger.kernel.org,
gregkh@linuxfoundation.org, o.rempel@pengutronix.de,
martin.blumenstingl@googlemail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [net] nvmem: disallow modular CONFIG_NVMEM
Date: Wed, 04 Apr 2018 11:48:04 -0400 (EDT) [thread overview]
Message-ID: <20180404.114804.662817136963950531.davem@davemloft.net> (raw)
In-Reply-To: <20180404103900.4090118-1-arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Wed, 4 Apr 2018 12:38:40 +0200
> The new of_get_nvmem_mac_address() helper function causes a link error
> with CONFIG_NVMEM=m:
>
> drivers/of/of_net.o: In function `of_get_nvmem_mac_address':
> of_net.c:(.text+0x168): undefined reference to `of_nvmem_cell_get'
> of_net.c:(.text+0x19c): undefined reference to `nvmem_cell_read'
> of_net.c:(.text+0x1a8): undefined reference to `nvmem_cell_put'
>
> I could not come up with a good solution for this, as the code is always
> built-in. Using an #if IS_REACHABLE() check around it would solve the
> link time issue but then stop it from working in that configuration.
> Making of_nvmem_cell_get() an inline function could also solve that, but
> seems a bit ugly since it's somewhat larger than most inline functions,
> and it would just bring that problem into the callers. Splitting the
> function into a separate file might be an alternative.
>
> This uses the big hammer by making CONFIG_NVMEM itself a 'bool' symbol,
> which avoids the problem entirely but makes the vmlinux larger for anyone
> that might use NVMEM support but doesn't need it built-in otherwise.
>
> Fixes: 9217e566bdee ("of_net: Implement of_get_nvmem_mac_address helper")
> Cc: Mike Looijmans <mike.looijmans@topic.nl>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> The problem arrived through the networking tree, but it's now in
> mainline, so the fix could go through either tree
Ok, applied, thanks Arnd.
prev parent reply other threads:[~2018-04-04 15:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-04 10:38 [PATCH] [net] nvmem: disallow modular CONFIG_NVMEM Arnd Bergmann
2018-04-04 13:32 ` Mike Looijmans
2018-04-04 13:38 ` Arnd Bergmann
2018-04-04 15:48 ` David Miller [this message]
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=20180404.114804.662817136963950531.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=andrew@lunn.ch \
--cc=arnd@arndb.de \
--cc=f.fainelli@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=mike.looijmans@topic.nl \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=srinivas.kandagatla@linaro.org \
/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