Skip to content

Commit

Permalink
backport: fix MODULE_IMPORT_NS() with Linux 6.13
Browse files Browse the repository at this point in the history
The macro MODULE_IMPORT_NS() no longer stringifies its argument
since commit cdd30ebb1b9f ("module: Convert symbol namespace to
string literal"), which must now be done by the caller.

Fixes: 7613542 ("backport: Add definitions for module namespace")
Signed-off-by: Peter Colberg <[email protected]>
  • Loading branch information
pcolberg committed Dec 16, 2024
1 parent b334687 commit b169652
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/fpga/intel-m10-bmc-sec-update.c
Original file line number Diff line number Diff line change
Expand Up @@ -1725,4 +1725,4 @@ module_platform_driver(intel_m10bmc_sec_driver);
MODULE_AUTHOR("Intel Corporation");
MODULE_DESCRIPTION("Intel MAX10 BMC Secure Update");
MODULE_LICENSE("GPL");
MODULE_IMPORT_NS(INTEL_M10_BMC_CORE);
MODULE_IMPORT_NS("INTEL_M10_BMC_CORE");
2 changes: 1 addition & 1 deletion drivers/hwmon/intel-m10-bmc-hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,4 +1200,4 @@ MODULE_DEVICE_TABLE(platform, intel_m10bmc_hwmon_ids);
MODULE_AUTHOR("Intel Corporation");
MODULE_DESCRIPTION("Intel MAX 10 BMC hardware monitor");
MODULE_LICENSE("GPL");
MODULE_IMPORT_NS(INTEL_M10_BMC_CORE);
MODULE_IMPORT_NS("INTEL_M10_BMC_CORE");
2 changes: 1 addition & 1 deletion drivers/mfd/intel-m10-bmc-pmci.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,4 +429,4 @@ MODULE_DESCRIPTION("MAX10 BMC PMCI-based interface");
MODULE_ALIAS("dfl:t0000f0012");
MODULE_AUTHOR("Intel Corporation");
MODULE_LICENSE("GPL");
MODULE_IMPORT_NS(INTEL_M10_BMC_CORE);
MODULE_IMPORT_NS("INTEL_M10_BMC_CORE");
2 changes: 1 addition & 1 deletion drivers/mfd/intel-m10-bmc-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,4 @@ MODULE_DESCRIPTION("Intel MAX 10 BMC SPI bus interface");
MODULE_AUTHOR("Intel Corporation");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("spi:intel-m10-bmc");
MODULE_IMPORT_NS(INTEL_M10_BMC_CORE);
MODULE_IMPORT_NS("INTEL_M10_BMC_CORE");
2 changes: 1 addition & 1 deletion drivers/net/ethernet/silicom/n5010-phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,4 @@ MODULE_DEVICE_TABLE(platform, n5010_phy_ids);
MODULE_AUTHOR("Intel Corporation");
MODULE_DESCRIPTION("Intel MAX10 BMC phy driver for n5010");
MODULE_LICENSE("GPL v2");
MODULE_IMPORT_NS(INTEL_M10_BMC_CORE);
MODULE_IMPORT_NS("INTEL_M10_BMC_CORE");
15 changes: 14 additions & 1 deletion include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,21 @@
#include <linux/version.h>
#include_next <linux/module.h>

#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) && RHEL_RELEASE_CODE < 0x900
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
/* Symbol namespaces were introduced in Linux 5.4 with commit
* 8651ec01daed ("module: add support for symbol namespaces.").
* Nevertheless, discard symbol namespace before Linux 5.5; see
* backported EXPORT_SYMBOL_NS_GPL() in export.h for the reason.
*/
#undef MODULE_IMPORT_NS
#define MODULE_IMPORT_NS(ns)
#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 13, 0)
/* The macro MODULE_IMPORT_NS() no longer stringifies its argument
* since commit cdd30ebb1b9f ("module: Convert symbol namespace to
* string literal"), which must now be done by the caller.
*/
#undef MODULE_IMPORT_NS
#define MODULE_IMPORT_NS(ns) MODULE_INFO(import_ns, ns)
#endif

#endif

0 comments on commit b169652

Please sign in to comment.