linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] firmware: remove old CONFIG_FW_LOADER_MODULE test
@ 2021-12-30  9:39 Greg Kroah-Hartman
  2022-01-06 14:44 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-12-30  9:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Borislav Petkov, Luis Chamberlain

The CONFIG_FW_LOADER_MODULE check in firmware.h is very obsolete given
that this symbol went away decades ago, so it should be removed.

Reported-by: Borislav Petkov <bp@alien8.de>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/firmware.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 3b057dfc8284..0b1c4d9c5465 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -34,7 +34,7 @@ static inline bool firmware_request_builtin(struct firmware *fw,
 }
 #endif
 
-#if defined(CONFIG_FW_LOADER) || (defined(CONFIG_FW_LOADER_MODULE) && defined(MODULE))
+#if defined(CONFIG_FW_LOADER)
 int request_firmware(const struct firmware **fw, const char *name,
 		     struct device *device);
 int firmware_request_nowarn(const struct firmware **fw, const char *name,
-- 
2.34.1


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

* Re: [PATCH] firmware: remove old CONFIG_FW_LOADER_MODULE test
  2021-12-30  9:39 [PATCH] firmware: remove old CONFIG_FW_LOADER_MODULE test Greg Kroah-Hartman
@ 2022-01-06 14:44 ` Greg Kroah-Hartman
  2022-01-11 19:00   ` Luis Chamberlain
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2022-01-06 14:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: Borislav Petkov, Luis Chamberlain

On Thu, Dec 30, 2021 at 10:39:32AM +0100, Greg Kroah-Hartman wrote:
> The CONFIG_FW_LOADER_MODULE check in firmware.h is very obsolete given
> that this symbol went away decades ago, so it should be removed.
> 
> Reported-by: Borislav Petkov <bp@alien8.de>
> Cc: Luis Chamberlain <mcgrof@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  include/linux/firmware.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/firmware.h b/include/linux/firmware.h
> index 3b057dfc8284..0b1c4d9c5465 100644
> --- a/include/linux/firmware.h
> +++ b/include/linux/firmware.h
> @@ -34,7 +34,7 @@ static inline bool firmware_request_builtin(struct firmware *fw,
>  }
>  #endif
>  
> -#if defined(CONFIG_FW_LOADER) || (defined(CONFIG_FW_LOADER_MODULE) && defined(MODULE))
> +#if defined(CONFIG_FW_LOADER)
>  int request_firmware(const struct firmware **fw, const char *name,
>  		     struct device *device);
>  int firmware_request_nowarn(const struct firmware **fw, const char *name,
> -- 
> 2.34.1
> 

Odd, 0-day reports a bunch of warnings with this change:

drivers/base/firmware_loader/main.c:1054:1: error: redefinition of 'request_firmware_nowait'
drivers/base/firmware_loader/main.c:811:1: error: redefinition of 'request_firmware'
drivers/base/firmware_loader/main.c:838:5: error: redefinition of 'firmware_request_nowarn'
drivers/base/firmware_loader/main.c:863:5: error: redefinition of 'request_firmware_direct'
drivers/base/firmware_loader/main.c:887:5: error: redefinition of 'firmware_request_platform'
drivers/base/firmware_loader/main.c:941:1: error: redefinition of 'request_firmware_into_buf'
drivers/base/firmware_loader/main.c:970:1: error: redefinition of 'request_partial_firmware_into_buf'
drivers/base/firmware_loader/main.c:992:6: error: redefinition of 'release_firmware'


Luis, any ideas?

thanks,

greg k-h


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

* Re: [PATCH] firmware: remove old CONFIG_FW_LOADER_MODULE test
  2022-01-06 14:44 ` Greg Kroah-Hartman
@ 2022-01-11 19:00   ` Luis Chamberlain
  2022-01-11 19:22     ` Borislav Petkov
  0 siblings, 1 reply; 5+ messages in thread
From: Luis Chamberlain @ 2022-01-11 19:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Borislav Petkov

On Thu, Jan 06, 2022 at 03:44:08PM +0100, Greg Kroah-Hartman wrote:
> On Thu, Dec 30, 2021 at 10:39:32AM +0100, Greg Kroah-Hartman wrote:
> > The CONFIG_FW_LOADER_MODULE check in firmware.h is very obsolete given
> > that this symbol went away decades ago, so it should be removed.
> > 
> > Reported-by: Borislav Petkov <bp@alien8.de>
> > Cc: Luis Chamberlain <mcgrof@kernel.org>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> >  include/linux/firmware.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/linux/firmware.h b/include/linux/firmware.h
> > index 3b057dfc8284..0b1c4d9c5465 100644
> > --- a/include/linux/firmware.h
> > +++ b/include/linux/firmware.h
> > @@ -34,7 +34,7 @@ static inline bool firmware_request_builtin(struct firmware *fw,
> >  }
> >  #endif
> >  
> > -#if defined(CONFIG_FW_LOADER) || (defined(CONFIG_FW_LOADER_MODULE) && defined(MODULE))
> > +#if defined(CONFIG_FW_LOADER)
> >  int request_firmware(const struct firmware **fw, const char *name,
> >  		     struct device *device);
> >  int firmware_request_nowarn(const struct firmware **fw, const char *name,
> > -- 
> > 2.34.1
> > 
> 
> Odd, 0-day reports a bunch of warnings with this change:
> 
> drivers/base/firmware_loader/main.c:1054:1: error: redefinition of 'request_firmware_nowait'
> drivers/base/firmware_loader/main.c:811:1: error: redefinition of 'request_firmware'
> drivers/base/firmware_loader/main.c:838:5: error: redefinition of 'firmware_request_nowarn'
> drivers/base/firmware_loader/main.c:863:5: error: redefinition of 'request_firmware_direct'
> drivers/base/firmware_loader/main.c:887:5: error: redefinition of 'firmware_request_platform'
> drivers/base/firmware_loader/main.c:941:1: error: redefinition of 'request_firmware_into_buf'
> drivers/base/firmware_loader/main.c:970:1: error: redefinition of 'request_partial_firmware_into_buf'
> drivers/base/firmware_loader/main.c:992:6: error: redefinition of 'release_firmware'
> 
> 
> Luis, any ideas?

Yeah I think this comes from the fact that modules get a respective
_MODULE define in the generated file
include/generated/autoconf.h 

For example:

vagrant@kdevops-dev /data/linux-next (git::20211203-umh-fix-exitcodes)$
grep CONFIG_CRC8 .config
CONFIG_CRC8=m
vagrant@kdevops-dev /data/linux-next (git::20211203-umh-fix-exitcodes)$
grep CONFIG_CRC8 include/generated/autoconf.h
#define CONFIG_CRC8_MODULE 1 

So I think the above was put in place to ask if its built-in or a
module.

  Luis

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

* Re: [PATCH] firmware: remove old CONFIG_FW_LOADER_MODULE test
  2022-01-11 19:00   ` Luis Chamberlain
@ 2022-01-11 19:22     ` Borislav Petkov
  2022-01-12  2:31       ` Luis Chamberlain
  0 siblings, 1 reply; 5+ messages in thread
From: Borislav Petkov @ 2022-01-11 19:22 UTC (permalink / raw)
  To: Luis Chamberlain; +Cc: Greg Kroah-Hartman, linux-kernel

On Tue, Jan 11, 2022 at 11:00:19AM -0800, Luis Chamberlain wrote:
> Yeah I think this comes from the fact that modules get a respective
> _MODULE define in the generated file
> include/generated/autoconf.h 
> 
> For example:
> 
> vagrant@kdevops-dev /data/linux-next (git::20211203-umh-fix-exitcodes)$
> grep CONFIG_CRC8 .config
> CONFIG_CRC8=m
> vagrant@kdevops-dev /data/linux-next (git::20211203-umh-fix-exitcodes)$
> grep CONFIG_CRC8 include/generated/autoconf.h
> #define CONFIG_CRC8_MODULE 1 
> 
> So I think the above was put in place to ask if its built-in or a
> module.

Talk about magic:

$ grep FW_LOADER .config
CONFIG_FW_LOADER=m
$ grep FW_LOADER include/generated/autoconf.h 
#define CONFIG_FW_LOADER_MODULE 1

It is probably even documented somewhere that the build generates
CONFIG_%s_MODULE defines for testing in code...

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

* Re: [PATCH] firmware: remove old CONFIG_FW_LOADER_MODULE test
  2022-01-11 19:22     ` Borislav Petkov
@ 2022-01-12  2:31       ` Luis Chamberlain
  0 siblings, 0 replies; 5+ messages in thread
From: Luis Chamberlain @ 2022-01-12  2:31 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Greg Kroah-Hartman, linux-kernel

On Tue, Jan 11, 2022 at 08:22:52PM +0100, Borislav Petkov wrote:
> On Tue, Jan 11, 2022 at 11:00:19AM -0800, Luis Chamberlain wrote:
> > Yeah I think this comes from the fact that modules get a respective
> > _MODULE define in the generated file
> > include/generated/autoconf.h 
> > 
> > For example:
> > 
> > vagrant@kdevops-dev /data/linux-next (git::20211203-umh-fix-exitcodes)$
> > grep CONFIG_CRC8 .config
> > CONFIG_CRC8=m
> > vagrant@kdevops-dev /data/linux-next (git::20211203-umh-fix-exitcodes)$
> > grep CONFIG_CRC8 include/generated/autoconf.h
> > #define CONFIG_CRC8_MODULE 1 
> > 
> > So I think the above was put in place to ask if its built-in or a
> > module.
> 
> Talk about magic:
> 
> $ grep FW_LOADER .config
> CONFIG_FW_LOADER=m
> $ grep FW_LOADER include/generated/autoconf.h 
> #define CONFIG_FW_LOADER_MODULE 1
> 
> It is probably even documented somewhere that the build generates
> CONFIG_%s_MODULE defines for testing in code...

Yeah, this is an opaque way to express this, I'll send a patch
replacement which I think which make this clearer.

  Luis

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

end of thread, other threads:[~2022-01-12  2:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-30  9:39 [PATCH] firmware: remove old CONFIG_FW_LOADER_MODULE test Greg Kroah-Hartman
2022-01-06 14:44 ` Greg Kroah-Hartman
2022-01-11 19:00   ` Luis Chamberlain
2022-01-11 19:22     ` Borislav Petkov
2022-01-12  2:31       ` Luis Chamberlain

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