* [PATCH v2 1/1] PM: Revert "Add EXPORT macros for exporting PM functions"
@ 2025-01-16 15:43 Andy Shevchenko
2025-01-16 16:09 ` Rafael J. Wysocki
0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2025-01-16 15:43 UTC (permalink / raw)
To: Greg Kroah-Hartman, Rafael J. Wysocki, linux-pm, linux-kernel
Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Richard Fitzgerald,
Andy Shevchenko, Adrian Hunter
The introduced macros are not doing what they intend for, namely
they won't eliminate the code when CONFIG_PM=n. Also there were
no users of them for all this time.
Drop them for good and to avoid possible misleading.
This reverts commit 41a337b40e983db4f0e1602308109f2b93687a06.
Reported-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: elaborated commit message (Greg), Cc'ed to the original author
include/linux/pm.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 08c37b83fea8..5dae93817141 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -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
--
2.43.0.rc1.1336.g36b5255a03ac
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/1] PM: Revert "Add EXPORT macros for exporting PM functions"
2025-01-16 15:43 [PATCH v2 1/1] PM: Revert "Add EXPORT macros for exporting PM functions" Andy Shevchenko
@ 2025-01-16 16:09 ` Rafael J. Wysocki
2025-01-16 16:13 ` Andy Shevchenko
2025-01-16 16:55 ` Richard Fitzgerald
0 siblings, 2 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2025-01-16 16:09 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, linux-pm, linux-kernel,
Rafael J. Wysocki, Len Brown, Pavel Machek, Richard Fitzgerald,
Adrian Hunter
On Thu, Jan 16, 2025 at 4:44 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> The introduced macros are not doing what they intend for, namely
> they won't eliminate the code when CONFIG_PM=n.
I don't think they have ever been expected to eliminate the code then.
They just don't export the symbols in that case.
> Also there were no users of them for all this time.
This actually is a good argument for dropping stuff.
> Drop them for good and to avoid possible misleading.
>
> This reverts commit 41a337b40e983db4f0e1602308109f2b93687a06.
>
> Reported-by: Adrian Hunter <adrian.hunter@intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> v2: elaborated commit message (Greg), Cc'ed to the original author
> include/linux/pm.h | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/include/linux/pm.h b/include/linux/pm.h
> index 08c37b83fea8..5dae93817141 100644
> --- a/include/linux/pm.h
> +++ b/include/linux/pm.h
> @@ -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
> --
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/1] PM: Revert "Add EXPORT macros for exporting PM functions"
2025-01-16 16:09 ` Rafael J. Wysocki
@ 2025-01-16 16:13 ` Andy Shevchenko
2025-01-16 16:27 ` Rafael J. Wysocki
2025-01-16 16:55 ` Richard Fitzgerald
1 sibling, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2025-01-16 16:13 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, linux-pm, linux-kernel,
Len Brown, Pavel Machek, Richard Fitzgerald, Adrian Hunter
On Thu, Jan 16, 2025 at 05:09:29PM +0100, Rafael J. Wysocki wrote:
> On Thu, Jan 16, 2025 at 4:44 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > The introduced macros are not doing what they intend for, namely
> > they won't eliminate the code when CONFIG_PM=n.
>
> I don't think they have ever been expected to eliminate the code then.
> They just don't export the symbols in that case.
Then I'm really puzzled with (potential) usefulness of them to begin with.
Having a dead code that is not exported is doubtful benefit.
> > Also there were no users of them for all this time.
>
> This actually is a good argument for dropping stuff.
>
> > Drop them for good and to avoid possible misleading.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/1] PM: Revert "Add EXPORT macros for exporting PM functions"
2025-01-16 16:13 ` Andy Shevchenko
@ 2025-01-16 16:27 ` Rafael J. Wysocki
2025-01-16 16:33 ` Andy Shevchenko
0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2025-01-16 16:27 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Rafael J. Wysocki, Greg Kroah-Hartman, Rafael J. Wysocki,
linux-pm, linux-kernel, Len Brown, Pavel Machek,
Richard Fitzgerald, Adrian Hunter
On Thu, Jan 16, 2025 at 5:13 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Thu, Jan 16, 2025 at 05:09:29PM +0100, Rafael J. Wysocki wrote:
> > On Thu, Jan 16, 2025 at 4:44 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > >
> > > The introduced macros are not doing what they intend for, namely
> > > they won't eliminate the code when CONFIG_PM=n.
> >
> > I don't think they have ever been expected to eliminate the code then.
> > They just don't export the symbols in that case.
>
> Then I'm really puzzled with (potential) usefulness of them to begin with.
> Having a dead code that is not exported is doubtful benefit.
Arguably, exported dead code is even worse.
Anyway, it is hard to say what they are good for if there are no users.
My point really is that you don't need to add anything beyond "this
stuff has no users" to get it removed and arguing about what the
unused stuff was intended for is not very useful so to speak.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/1] PM: Revert "Add EXPORT macros for exporting PM functions"
2025-01-16 16:27 ` Rafael J. Wysocki
@ 2025-01-16 16:33 ` Andy Shevchenko
2025-01-16 19:18 ` Rafael J. Wysocki
0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2025-01-16 16:33 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, linux-pm, linux-kernel,
Len Brown, Pavel Machek, Richard Fitzgerald, Adrian Hunter
On Thu, Jan 16, 2025 at 05:27:59PM +0100, Rafael J. Wysocki wrote:
> On Thu, Jan 16, 2025 at 5:13 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Thu, Jan 16, 2025 at 05:09:29PM +0100, Rafael J. Wysocki wrote:
> > > On Thu, Jan 16, 2025 at 4:44 PM Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
> > > >
> > > > The introduced macros are not doing what they intend for, namely
> > > > they won't eliminate the code when CONFIG_PM=n.
> > >
> > > I don't think they have ever been expected to eliminate the code then.
> > > They just don't export the symbols in that case.
> >
> > Then I'm really puzzled with (potential) usefulness of them to begin with.
> > Having a dead code that is not exported is doubtful benefit.
>
> Arguably, exported dead code is even worse.
>
> Anyway, it is hard to say what they are good for if there are no users.
>
> My point really is that you don't need to add anything beyond "this
> stuff has no users" to get it removed and arguing about what the
> unused stuff was intended for is not very useful so to speak.
I see. Shall I send a v3 with the reduced commit message?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/1] PM: Revert "Add EXPORT macros for exporting PM functions"
2025-01-16 16:09 ` Rafael J. Wysocki
2025-01-16 16:13 ` Andy Shevchenko
@ 2025-01-16 16:55 ` Richard Fitzgerald
2025-01-17 13:40 ` Andy Shevchenko
1 sibling, 1 reply; 10+ messages in thread
From: Richard Fitzgerald @ 2025-01-16 16:55 UTC (permalink / raw)
To: Rafael J. Wysocki, Andy Shevchenko
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, linux-pm, linux-kernel,
Len Brown, Pavel Machek, Adrian Hunter
On 16/01/2025 4:09 pm, Rafael J. Wysocki wrote:
> On Thu, Jan 16, 2025 at 4:44 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
>>
>> The introduced macros are not doing what they intend for, namely
>> they won't eliminate the code when CONFIG_PM=n.
>
> I don't think they have ever been expected to eliminate the code then.
> They just don't export the symbols in that case.
>
>> Also there were no users of them for all this time.
>
I had code changes to use them but they got lost at the bottom of a long
backlog of other commits and have never been upstreamed. Removing these
macros is fine with me.
(apologies if you get this msg twice, there was a problem with email)
> This actually is a good argument for dropping stuff.
>
>> Drop them for good and to avoid possible misleading.
>>
>> This reverts commit 41a337b40e983db4f0e1602308109f2b93687a06.
>>
>> Reported-by: Adrian Hunter <adrian.hunter@intel.com>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> ---
>> v2: elaborated commit message (Greg), Cc'ed to the original author
>> include/linux/pm.h | 4 ----
>> 1 file changed, 4 deletions(-)
>>
>> diff --git a/include/linux/pm.h b/include/linux/pm.h
>> index 08c37b83fea8..5dae93817141 100644
>> --- a/include/linux/pm.h
>> +++ b/include/linux/pm.h
>> @@ -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
>> --
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/1] PM: Revert "Add EXPORT macros for exporting PM functions"
2025-01-16 16:33 ` Andy Shevchenko
@ 2025-01-16 19:18 ` Rafael J. Wysocki
2025-01-17 13:39 ` Andy Shevchenko
0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2025-01-16 19:18 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Rafael J. Wysocki, Greg Kroah-Hartman, Rafael J. Wysocki,
linux-pm, linux-kernel, Len Brown, Pavel Machek,
Richard Fitzgerald, Adrian Hunter
On Thu, Jan 16, 2025 at 5:33 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Thu, Jan 16, 2025 at 05:27:59PM +0100, Rafael J. Wysocki wrote:
> > On Thu, Jan 16, 2025 at 5:13 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > > On Thu, Jan 16, 2025 at 05:09:29PM +0100, Rafael J. Wysocki wrote:
> > > > On Thu, Jan 16, 2025 at 4:44 PM Andy Shevchenko
> > > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > >
> > > > > The introduced macros are not doing what they intend for, namely
> > > > > they won't eliminate the code when CONFIG_PM=n.
> > > >
> > > > I don't think they have ever been expected to eliminate the code then.
> > > > They just don't export the symbols in that case.
> > >
> > > Then I'm really puzzled with (potential) usefulness of them to begin with.
> > > Having a dead code that is not exported is doubtful benefit.
> >
> > Arguably, exported dead code is even worse.
> >
> > Anyway, it is hard to say what they are good for if there are no users.
> >
> > My point really is that you don't need to add anything beyond "this
> > stuff has no users" to get it removed and arguing about what the
> > unused stuff was intended for is not very useful so to speak.
>
> I see. Shall I send a v3 with the reduced commit message?
It's there in my queue and I can take care of the changelog, so no need.
Thanks!
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/1] PM: Revert "Add EXPORT macros for exporting PM functions"
2025-01-16 19:18 ` Rafael J. Wysocki
@ 2025-01-17 13:39 ` Andy Shevchenko
2025-01-23 20:23 ` Rafael J. Wysocki
0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2025-01-17 13:39 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Greg Kroah-Hartman, Rafael J. Wysocki, linux-pm, linux-kernel,
Len Brown, Pavel Machek, Richard Fitzgerald, Adrian Hunter
On Thu, Jan 16, 2025 at 08:18:19PM +0100, Rafael J. Wysocki wrote:
> On Thu, Jan 16, 2025 at 5:33 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> > On Thu, Jan 16, 2025 at 05:27:59PM +0100, Rafael J. Wysocki wrote:
> > > On Thu, Jan 16, 2025 at 5:13 PM Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > On Thu, Jan 16, 2025 at 05:09:29PM +0100, Rafael J. Wysocki wrote:
> > > > > On Thu, Jan 16, 2025 at 4:44 PM Andy Shevchenko
> > > > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > > >
> > > > > > The introduced macros are not doing what they intend for, namely
> > > > > > they won't eliminate the code when CONFIG_PM=n.
> > > > >
> > > > > I don't think they have ever been expected to eliminate the code then.
> > > > > They just don't export the symbols in that case.
> > > >
> > > > Then I'm really puzzled with (potential) usefulness of them to begin with.
> > > > Having a dead code that is not exported is doubtful benefit.
> > >
> > > Arguably, exported dead code is even worse.
> > >
> > > Anyway, it is hard to say what they are good for if there are no users.
> > >
> > > My point really is that you don't need to add anything beyond "this
> > > stuff has no users" to get it removed and arguing about what the
> > > unused stuff was intended for is not very useful so to speak.
> >
> > I see. Shall I send a v3 with the reduced commit message?
>
> It's there in my queue and I can take care of the changelog, so no need.
Ah, thanks!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/1] PM: Revert "Add EXPORT macros for exporting PM functions"
2025-01-16 16:55 ` Richard Fitzgerald
@ 2025-01-17 13:40 ` Andy Shevchenko
0 siblings, 0 replies; 10+ messages in thread
From: Andy Shevchenko @ 2025-01-17 13:40 UTC (permalink / raw)
To: Richard Fitzgerald
Cc: Rafael J. Wysocki, Greg Kroah-Hartman, Rafael J. Wysocki,
linux-pm, linux-kernel, Len Brown, Pavel Machek, Adrian Hunter
On Thu, Jan 16, 2025 at 04:55:05PM +0000, Richard Fitzgerald wrote:
> On 16/01/2025 4:09 pm, Rafael J. Wysocki wrote:
> > On Thu, Jan 16, 2025 at 4:44 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > >
> > > The introduced macros are not doing what they intend for, namely
> > > they won't eliminate the code when CONFIG_PM=n.
> >
> > I don't think they have ever been expected to eliminate the code then.
> > They just don't export the symbols in that case.
> >
> > > Also there were no users of them for all this time.
>
> I had code changes to use them but they got lost at the bottom of a long
> backlog of other commits and have never been upstreamed. Removing these
> macros is fine with me.
I see, thanks for chiming in in both email threads!
> (apologies if you get this msg twice, there was a problem with email)
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2 1/1] PM: Revert "Add EXPORT macros for exporting PM functions"
2025-01-17 13:39 ` Andy Shevchenko
@ 2025-01-23 20:23 ` Rafael J. Wysocki
0 siblings, 0 replies; 10+ messages in thread
From: Rafael J. Wysocki @ 2025-01-23 20:23 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Rafael J. Wysocki, Greg Kroah-Hartman, Rafael J. Wysocki,
linux-pm, linux-kernel, Len Brown, Pavel Machek,
Richard Fitzgerald, Adrian Hunter
On Fri, Jan 17, 2025 at 2:39 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Thu, Jan 16, 2025 at 08:18:19PM +0100, Rafael J. Wysocki wrote:
> > On Thu, Jan 16, 2025 at 5:33 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > > On Thu, Jan 16, 2025 at 05:27:59PM +0100, Rafael J. Wysocki wrote:
> > > > On Thu, Jan 16, 2025 at 5:13 PM Andy Shevchenko
> > > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > > On Thu, Jan 16, 2025 at 05:09:29PM +0100, Rafael J. Wysocki wrote:
> > > > > > On Thu, Jan 16, 2025 at 4:44 PM Andy Shevchenko
> > > > > > <andriy.shevchenko@linux.intel.com> wrote:
> > > > > > >
> > > > > > > The introduced macros are not doing what they intend for, namely
> > > > > > > they won't eliminate the code when CONFIG_PM=n.
> > > > > >
> > > > > > I don't think they have ever been expected to eliminate the code then.
> > > > > > They just don't export the symbols in that case.
> > > > >
> > > > > Then I'm really puzzled with (potential) usefulness of them to begin with.
> > > > > Having a dead code that is not exported is doubtful benefit.
> > > >
> > > > Arguably, exported dead code is even worse.
> > > >
> > > > Anyway, it is hard to say what they are good for if there are no users.
> > > >
> > > > My point really is that you don't need to add anything beyond "this
> > > > stuff has no users" to get it removed and arguing about what the
> > > > unused stuff was intended for is not very useful so to speak.
> > >
> > > I see. Shall I send a v3 with the reduced commit message?
> >
> > It's there in my queue and I can take care of the changelog, so no need.
>
> Ah, thanks!
Applied now, thanks!
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-01-23 20:23 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 15:43 [PATCH v2 1/1] PM: Revert "Add EXPORT macros for exporting PM functions" Andy Shevchenko
2025-01-16 16:09 ` Rafael J. Wysocki
2025-01-16 16:13 ` Andy Shevchenko
2025-01-16 16:27 ` Rafael J. Wysocki
2025-01-16 16:33 ` Andy Shevchenko
2025-01-16 19:18 ` Rafael J. Wysocki
2025-01-17 13:39 ` Andy Shevchenko
2025-01-23 20:23 ` Rafael J. Wysocki
2025-01-16 16:55 ` Richard Fitzgerald
2025-01-17 13:40 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox