mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] proc/sysctl: make firmware loader table conditional
@ 2019-06-17 12:59 Arnd Bergmann
  2019-06-17 14:41 ` Matteo Croce
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2019-06-17 12:59 UTC (permalink / raw)
  To: Luis Chamberlain, Greg Kroah-Hartman
  Cc: Arnd Bergmann, Matteo Croce, Kees Cook, Aaron Tomlin,
	Matthew Wilcox, Andrew Morton, Stephen Rothwell,
	Rafael J. Wysocki, linux-kernel

We get a link error in the firmware loader fallback table,
which now refers to the global sysctl_vals variable:

drivers/base/firmware_loader/fallback_table.o:(.data+0x2c): undefined reference to `sysctl_vals'
drivers/base/firmware_loader/fallback_table.o:(.data+0x30): undefined reference to `sysctl_vals'
drivers/base/firmware_loader/fallback_table.o:(.data+0x50): undefined reference to `sysctl_vals'
drivers/base/firmware_loader/fallback_table.o:(.data+0x54): undefined reference to `sysctl_vals'

Add an #ifdef that only builds that table when it is being
used.

Fixes: c81c506545f4 ("proc/sysctl: add shared variables for range check")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/base/firmware_loader/fallback_table.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/firmware_loader/fallback_table.c b/drivers/base/firmware_loader/fallback_table.c
index 58d4a1263480..ba9d30b28edc 100644
--- a/drivers/base/firmware_loader/fallback_table.c
+++ b/drivers/base/firmware_loader/fallback_table.c
@@ -23,6 +23,7 @@ struct firmware_fallback_config fw_fallback_config = {
 };
 EXPORT_SYMBOL_GPL(fw_fallback_config);
 
+#ifdef CONFIG_SYSCTL
 struct ctl_table firmware_config_table[] = {
 	{
 		.procname	= "force_sysfs_fallback",
@@ -45,3 +46,4 @@ struct ctl_table firmware_config_table[] = {
 	{ }
 };
 EXPORT_SYMBOL_GPL(firmware_config_table);
+#endif
-- 
2.20.0


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

* Re: [PATCH] proc/sysctl: make firmware loader table conditional
  2019-06-17 12:59 [PATCH] proc/sysctl: make firmware loader table conditional Arnd Bergmann
@ 2019-06-17 14:41 ` Matteo Croce
  2019-06-17 15:00   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Matteo Croce @ 2019-06-17 14:41 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Luis Chamberlain, Greg Kroah-Hartman, Kees Cook, Aaron Tomlin,
	Matthew Wilcox, Andrew Morton, Stephen Rothwell,
	Rafael J. Wysocki, LKML

On Mon, Jun 17, 2019 at 3:00 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> We get a link error in the firmware loader fallback table,
> which now refers to the global sysctl_vals variable:
>
> drivers/base/firmware_loader/fallback_table.o:(.data+0x2c): undefined reference to `sysctl_vals'
> drivers/base/firmware_loader/fallback_table.o:(.data+0x30): undefined reference to `sysctl_vals'
> drivers/base/firmware_loader/fallback_table.o:(.data+0x50): undefined reference to `sysctl_vals'
> drivers/base/firmware_loader/fallback_table.o:(.data+0x54): undefined reference to `sysctl_vals'
>
> Add an #ifdef that only builds that table when it is being
> used.
>
> Fixes: c81c506545f4 ("proc/sysctl: add shared variables for range check")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/base/firmware_loader/fallback_table.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/base/firmware_loader/fallback_table.c b/drivers/base/firmware_loader/fallback_table.c
> index 58d4a1263480..ba9d30b28edc 100644
> --- a/drivers/base/firmware_loader/fallback_table.c
> +++ b/drivers/base/firmware_loader/fallback_table.c
> @@ -23,6 +23,7 @@ struct firmware_fallback_config fw_fallback_config = {
>  };
>  EXPORT_SYMBOL_GPL(fw_fallback_config);
>
> +#ifdef CONFIG_SYSCTL
>  struct ctl_table firmware_config_table[] = {
>         {
>                 .procname       = "force_sysfs_fallback",
> @@ -45,3 +46,4 @@ struct ctl_table firmware_config_table[] = {
>         { }
>  };
>  EXPORT_SYMBOL_GPL(firmware_config_table);
> +#endif
> --
> 2.20.0
>

Hi Arnd,

I think I've posted a similar patch before, I don't know if it's
already in linux-next:

https://lore.kernel.org/linux-next/20190531012649.31797-1-mcroce@redhat.com/

Regards,
-- 
Matteo Croce
per aspera ad upstream

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

* Re: [PATCH] proc/sysctl: make firmware loader table conditional
  2019-06-17 14:41 ` Matteo Croce
@ 2019-06-17 15:00   ` Arnd Bergmann
  0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2019-06-17 15:00 UTC (permalink / raw)
  To: Matteo Croce
  Cc: Luis Chamberlain, Greg Kroah-Hartman, Kees Cook, Aaron Tomlin,
	Matthew Wilcox, Andrew Morton, Stephen Rothwell,
	Rafael J. Wysocki, LKML

On Mon, Jun 17, 2019 at 4:42 PM Matteo Croce <mcroce@redhat.com> wrote:
> >  drivers/base/firmware_loader/fallback_table.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/base/firmware_loader/fallback_table.c b/drivers/base/firmware_loader/fallback_table.c
> > index 58d4a1263480..ba9d30b28edc 100644
> > --- a/drivers/base/firmware_loader/fallback_table.c
> > +++ b/drivers/base/firmware_loader/fallback_table.c
> > @@ -23,6 +23,7 @@ struct firmware_fallback_config fw_fallback_config = {
> >  };
> >  EXPORT_SYMBOL_GPL(fw_fallback_config);
> >
> > +#ifdef CONFIG_SYSCTL
> >  struct ctl_table firmware_config_table[] = {
> >         {
> >                 .procname       = "force_sysfs_fallback",
> > @@ -45,3 +46,4 @@ struct ctl_table firmware_config_table[] = {
> >         { }
> >  };
> >  EXPORT_SYMBOL_GPL(firmware_config_table);
> > +#endif
> > --
> > 2.20.0
> >
>
> Hi Arnd,
>
> I think I've posted a similar patch before, I don't know if it's
> already in linux-next:
>
> https://lore.kernel.org/linux-next/20190531012649.31797-1-mcroce@redhat.com/
>

Indeed, that is almost the same patch. Not sure what happened.

As Stephen replied to your patch, he had picked it up originally.
Maybe it got lost in a rebase since then.

        Arnd

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

end of thread, other threads:[~2019-06-17 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17 12:59 [PATCH] proc/sysctl: make firmware loader table conditional Arnd Bergmann
2019-06-17 14:41 ` Matteo Croce
2019-06-17 15:00   ` Arnd Bergmann

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®