Skip to contentSkip to conversation

PM: Revert "Add EXPORT macros for exporting PM functions"

PATCH Superseded Andy Shevchenko 2 participants 4 messages Jan 16, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM: Revert "Add EXPORT macros for exporting PM functions"

The introduced macros are not doing what they intend for. Also there were no users of them for all this time. Drop them for good and to avoid possible misleading.

This reverts commit 41a337b40e983db4f0e1602308109f2b93687a06.

---
 include/linux/pm.h | 4 ----
 1 file changed, 4 deletions(-)
include/linux/pm.h +0 -4
index 08c37b83fea8..5dae93817141 100644
@@ -384,12 +384,8 @@ const struct dev_pm_ops name = { \
 
 #ifdef CONFIG_PM
 #define _EXPORT_DEV_PM_OPS(name, license, ns)		_EXPORT_PM_OPS(name, license, ns)
-#define EXPORT_PM_FN_GPL(name)				EXPORT_SYMBOL_GPL(name)
-#define EXPORT_PM_FN_NS_GPL(name, ns)			EXPORT_SYMBOL_NS_GPL(name, "ns")
 #else
 #define _EXPORT_DEV_PM_OPS(name, license, ns)		_DISCARD_PM_OPS(name, license, ns)
-#define EXPORT_PM_FN_GPL(name)
-#define EXPORT_PM_FN_NS_GPL(name, ns)
 #endif
 
 #ifdef CONFIG_PM_SLEEP
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
#1 lore raw
Quoted 17 lines · Andy Shevchenko

The introduced macros are not doing what they intend for. Also there were no users of them for all this time. Drop them for good and to avoid possible misleading.

This reverts commit 41a337b40e983db4f0e1602308109f2b93687a06.

---
 include/linux/pm.h | 4 ----
 1 file changed, 4 deletions(-)
include/linux/pm.h +0 -0
index 08c37b83fea8..5dae93817141 100644

include/linux/pm.h const struct dev_pm_ops name = { \ · line 392

Quoted 9 lines
include/linux/pm.h +0 -4
@@ -384,12 +384,8 @@ const struct dev_pm_ops name = { \
 
 #ifdef CONFIG_PM
 #define _EXPORT_DEV_PM_OPS(name, license, ns)		_EXPORT_PM_OPS(name, license, ns)
-#define EXPORT_PM_FN_GPL(name)				EXPORT_SYMBOL_GPL(name)
-#define EXPORT_PM_FN_NS_GPL(name, ns)			EXPORT_SYMBOL_NS_GPL(name, "ns")
 #else
 #define _EXPORT_DEV_PM_OPS(name, license, ns)		_DISCARD_PM_OPS(name, license, ns)
-#define EXPORT_PM_FN_GPL(name)
-#define EXPORT_PM_FN_NS_GPL(name, ns)

Why not start using them instead?

thanks,

greg k-h

#2 lore raw
Quoted 1 line · Greg Kroah-Hartman

On Thu, Jan 16, 2025 at 05:21:51PM +0200, Andy Shevchenko wrote:

...

Quoted 10 lines

include/linux/pm.h const struct dev_pm_ops name = { \ · line 392

Quoted 8 lines

#ifdef CONFIG_PM
#define _EXPORT_DEV_PM_OPS(name, license, ns) _EXPORT_PM_OPS(name, license, ns)

include/linux/pm.h +0 -4
-#define EXPORT_PM_FN_GPL(name)				EXPORT_SYMBOL_GPL(name)
-#define EXPORT_PM_FN_NS_GPL(name, ns)			EXPORT_SYMBOL_NS_GPL(name, "ns")
 #else
 #define _EXPORT_DEV_PM_OPS(name, license, ns)		_DISCARD_PM_OPS(name, license, ns)
-#define EXPORT_PM_FN_GPL(name)
-#define EXPORT_PM_FN_NS_GPL(name, ns)

Why not start using them instead?

I tried and they didn't produce what we want (code elimination for the CONFIG_PM=n).

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 16 lines · Andy Shevchenko
Quoted 1 line · Greg Kroah-Hartman

On Thu, Jan 16, 2025 at 05:21:51PM +0200, Andy Shevchenko wrote:

...

Quoted 10 lines

include/linux/pm.h const struct dev_pm_ops name = { \ · line 392

Quoted 8 lines

#ifdef CONFIG_PM
#define _EXPORT_DEV_PM_OPS(name, license, ns) _EXPORT_PM_OPS(name, license, ns)

include/linux/pm.h +0 -4
-#define EXPORT_PM_FN_GPL(name)				EXPORT_SYMBOL_GPL(name)
-#define EXPORT_PM_FN_NS_GPL(name, ns)			EXPORT_SYMBOL_NS_GPL(name, "ns")
 #else
 #define _EXPORT_DEV_PM_OPS(name, license, ns)		_DISCARD_PM_OPS(name, license, ns)
-#define EXPORT_PM_FN_GPL(name)
-#define EXPORT_PM_FN_NS_GPL(name, ns)

Why not start using them instead?

Quoted 2 lines

I tried and they didn't produce what we want (code elimination for the CONFIG_PM=n).

Ok, then please say that in the changelog text.

thanks,

greg k-h