firmware_loader: simplfy builtin or module check
Subsystems (2)
Luis Chamberlain
maintainerPATCH 1/1 firmware_loader: simplfy builtin or module check
The existing check is outdated and confuses developers. Use the already existing IS_ENABLED() defined on kconfig.h which makes the intention much clearer.
--- include/linux/firmware.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/firmware.h +1 -1
@@ -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 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,
Signature · 1 line
2.34.1
Quoted 7 lines · Luis Chamberlain
The existing check is outdated and confuses developers. Use the already existing
IS_ENABLED()defined onkconfig.hwhich makes the intention much clearer.Reported-by Borislav Petkov <[email protected]>Reported-by Greg Kroah-Hartman <[email protected]>Signed-off-by Luis Chamberlain <[email protected]>
Thanks.
include/linux/firmware.h static inline bool firmware_request_builtin(struct firmware *fw, · line 37
Quoted 13 lines
--- include/linux/firmware.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/firmware.h +0
-1@@ -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. :)
Quoted 4 lines
include/linux/firmware.h +1
-0+#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,
Signature · 1 line
~Randy
Quoted 28 lines · Randy Dunlap
Quoted 7 lines · Luis Chamberlain
The existing check is outdated and confuses developers. Use the already existing
IS_ENABLED()defined onkconfig.hwhich makes the intention much clearer.Reported-by Borislav Petkov <[email protected]>Reported-by Greg Kroah-Hartman <[email protected]>Signed-off-by Luis Chamberlain <[email protected]>Acked-by Randy Dunlap <[email protected]>Thanks.
Quoted 12 lines
--- include/linux/firmware.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/firmware.h +0
-0@@ -34,7 +34,7 @@ static inline bool firmware_request_builtin(struct firmware *fw, }#endif
Quoted 3 lines
include/linux/firmware.h static inline bool firmware_request_builtin(struct firmware *fw, · line 37
Quoted 1 line
include/linux/firmware.h +0
-1-#if defined(CONFIG_FW_LOADER ) || (defined(CONFIG_FW_LOADER_MODULE ) && defined(MODULE ))The "defined(MODULE)" part wasn't needed here. :)
It _is_ needed.
This seems to be equivalent to IS_REACHABLE(CONFIG_FW_LOADER), not IS_ENABLE(CONFIG_FW_LOADER).
Quoted 8 lines
include/linux/firmware.h static inline bool firmware_request_builtin(struct firmware *fw, · line 40
Quoted 5 lines
include/linux/firmware.h +1
-0+#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
Signature · 2 lines
Best Regards Masahiro Yamada
Quoted 35 lines · Masahiro Yamada
Quoted 28 lines · Randy Dunlap
Quoted 7 lines · Luis Chamberlain
The existing check is outdated and confuses developers. Use the already existing
IS_ENABLED()defined onkconfig.hwhich makes the intention much clearer.Reported-by Borislav Petkov <[email protected]>Reported-by Greg Kroah-Hartman <[email protected]>Signed-off-by Luis Chamberlain <[email protected]>Acked-by Randy Dunlap <[email protected]>Thanks.
Quoted 12 lines
--- include/linux/firmware.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/firmware.h +0
-0@@ -34,7 +34,7 @@ static inline bool firmware_request_builtin(struct firmware *fw, }#endif Quoted 3 lines
include/linux/firmware.h static inline bool firmware_request_builtin(struct firmware *fw, · line 37
Quoted 1 line
include/linux/firmware.h +0
-1-#if defined(CONFIG_FW_LOADER ) || (defined(CONFIG_FW_LOADER_MODULE ) && defined(MODULE ))The "defined(MODULE)" part wasn't needed here. :)
Quoted 5 lines
It _is_ needed.
This seems to be equivalent to
IS_REACHABLE(CONFIG_FW_LOADER), notIS_ENABLE(CONFIG_FW_LOADER).
Hm, /me confused.
How can CONFIG_FW_LOADER_MODULE be =y when MODULE is not defined?
Quoted 13 lines
Quoted 10 lines
include/linux/firmware.h static inline bool firmware_request_builtin(struct firmware *fw, · line 40
Quoted 7 lines
include/linux/firmware.h +1
-0+#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
Signature · 1 line
~Randy
Quoted 38 lines · Randy Dunlap
Quoted 35 lines · Masahiro Yamada
Quoted 31 lines · Randy Dunlap
Quoted 7 lines · Luis Chamberlain
The existing check is outdated and confuses developers. Use the already existing
IS_ENABLED()defined onkconfig.hwhich makes the intention much clearer.Reported-by Borislav Petkov <[email protected]>Reported-by Greg Kroah-Hartman <[email protected]>Signed-off-by Luis Chamberlain <[email protected]>Acked-by Randy Dunlap <[email protected]>Thanks.
include/linux/firmware.h static inline bool firmware_request_builtin(struct firmware *fw, · line 37
Quoted 13 lines
--- include/linux/firmware.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/firmware.h +0
-1@@ -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. :)
Quoted 9 lines
Quoted 4 lines
It _is_ needed.
This seems to be equivalent to
IS_REACHABLE(CONFIG_FW_LOADER), notIS_ENABLE(CONFIG_FW_LOADER).>>Hm, /me confused.
How can
CONFIG_FW_LOADER_MODULEbe =y when MODULE is not defined?
OK, I get it now. Thanks for correcting me.
Quoted 14 lines
Quoted 13 lines
Quoted 10 lines
include/linux/firmware.h static inline bool firmware_request_builtin(struct firmware *fw, · line 40
Quoted 7 lines
include/linux/firmware.h +1
-0+#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
Signature · 1 line
~Randy