firmware_loader: revert removal of the fw_fallback_config export
Subsystems (3)
Luis R. Rodriguez
maintainerPATCH v2 1/2 firmware_loader: revert removal of the fw_fallback_config export
From: Luis Chamberlain <[email protected]>
Christoph's patch removed two unsused exported symbols, however, one symbol is used by the firmware_loader itself. If CONFIG_FW_LOADER=m so the firmware_loader is modular but CONFIG_FW_LOADER_USER_HELPER=y we fail the build at mostpost.
ERROR: modpost: "fw_fallback_config" [drivers/base/firmware_loader/firmware_class.ko] undefined!
This happens because the variable fw_fallback_config is built into the kernel if CONFIG_FW_LOADER_USER_HELPER=y always, so we need to grant access to the firmware loader module by exporting it.
Revert only one hunk from his patch.
--- drivers/base/firmware_loader/fallback_table.c | 1 + 1 file changed, 1 insertion(+)
drivers/base/firmware_loader/fallback_table.c +1 -0
@@ -21,6 +21,7 @@ struct firmware_fallback_config fw_fallback_config = { .loading_timeout = 60, .old_timeout = 60, }; +EXPORT_SYMBOL_GPL (fw_fallback_config);#ifdef CONFIG_SYSCTL struct ctl_table firmware_config_table[] = {
Signature · 1 line
2.25.1
Luis R. Rodriguez
maintainerPATCH v2 2/2 firmware_loader: move fw_fallback_config to a private kernel symbol namespace
From: Luis Chamberlain <[email protected]>
Take advantage of the new kernel symbol namespacing functionality, and export the fw_fallback_config symbol only to a new private firmware loader namespace. This would prevent misuses from other drivers and makes it clear the goal is to keep this private to the firmware loader only.
It should also make it clearer for folks git grep'ing for users of the symbol that this exported symbol is private, and prevent future accidental removals of the exported symbol.
--- drivers/base/firmware_loader/fallback.c | 3 +++ drivers/base/firmware_loader/fallback_table.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/base/firmware_loader/fallback.c +3 -0
@@ -9,6 +9,7 @@#include <linux/umh.h> #include <linux/sysctl.h> #include <linux/vmalloc.h> +#include <linux/module.h> #include "fallback.h" #include "firmware.h"
@@ -17,6 +18,8 @@* firmware fallback mechanism */ +MODULE_IMPORT_NS (FIRMWARE_LOADER_PRIVATE ); +extern struct firmware_fallback_config fw_fallback_config;/* These getters are vetted to use int properly */
drivers/base/firmware_loader/fallback_table.c +1 -1
@@ -21,7 +21,7 @@ struct firmware_fallback_config fw_fallback_config = { .loading_timeout = 60, .old_timeout = 60, }; -EXPORT_SYMBOL_GPL (fw_fallback_config); +EXPORT_SYMBOL_NS_GPL (fw_fallback_config,FIRMWARE_LOADER_PRIVATE );#ifdef CONFIG_SYSCTL struct ctl_table firmware_config_table[] = {
Signature · 1 line
2.25.1
Greg KH
maintainerQuoted 9 lines · Luis R. Rodriguez
From: Luis Chamberlain <[email protected]>
Christoph's patch removed two unsused exported symbols, however, one symbol is used by the
firmware_loaderitself. IfCONFIG_FW_LOADER=mso thefirmware_loaderis modular butCONFIG_FW_LOADER_USER_HELPER=ywe fail the build at mostpost.ERROR: modpost: "
fw_fallback_config" [drivers/base/firmware_loader/firmware_class.ko] undefined!
Quoted 7 lines
This happens because the variable
fw_fallback_configis built into the kernel ifCONFIG_FW_LOADER_USER_HELPER=yalways, so we need to grant access to the firmware loader module by exporting it.Revert only one hunk from his patch.
Fixes 739604734bd8e4ad71 ("firmware_loader: remove unused exports")
No need to be over-eager with the number of digits...
I'll fix this up when I apply it, thanks.
greg k-h