lkml.org 
[lkml]   [2022]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] firmware_loader: simplfy builtin or module check
From


On 1/11/22 18:34, Luis Chamberlain wrote:
> The existing check is outdated and confuses developers. Use the
> already existing IS_ENABLED() defined on kconfig.h which makes
> the intention much clearer.
>
> Reported-by: Borislav Petkov <bp@alien8.de>
> Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

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

The "defined(MODULE)" part wasn't needed here. :)

> +#if IS_ENABLED(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,

--
~Randy

\
 
 \ /
  Last update: 2022-01-12 07:39    [W:0.055 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site