Re: [PATCH 5.10.y-cip 14/23] PM: core: Add new *_PM_OPS macros, deprecate old ones

Pavel Machek
2023-05-19T22:13:14Z

[-- Attachment #1: Type: text/plain, Size: 1766 bytes --]

Hi!

I'll have comments on 19/, but this one is kind of important:

> From: Paul Cercueil <paul@crapouillou.net>
>
> commit 1a3c7bb088266fa2db017be299f91f1c1894c857 upstream.
>
> This commit introduces the following macros:
>
> SYSTEM_SLEEP_PM_OPS()
> LATE_SYSTEM_SLEEP_PM_OPS()
> NOIRQ_SYSTEM_SLEEP_PM_OPS()
> RUNTIME_PM_OPS()
>
> These new macros are very similar to their SET_*_PM_OPS() equivalent.
> They however differ in the fact that the callbacks they set will always
> be seen as referenced by the compiler. This means that the callback
> functions don't need to be wrapped with a #ifdef CONFIG_PM guard, or
> tagged with __maybe_unused, to prevent the compiler from complaining
> about unused static symbols. The compiler will then simply evaluate at
> compile time whether or not these symbols are dead code.
>
> The callbacks that are only useful with CONFIG_PM_SLEEP is enabled, are
> now also wrapped with a new pm_sleep_ptr() macro, which is inspired from
> pm_ptr(). This is needed for drivers that use different callbacks for
> sleep and runtime PM, to handle the case where CONFIG_PM is set and
> CONFIG_PM_SLEEP is not.
>
> This commit also deprecates the following macros:
>
> SIMPLE_DEV_PM_OPS()
> UNIVERSAL_DEV_PM_OPS()
>
> And introduces the following macros:
>
> DEFINE_SIMPLE_DEV_PM_OPS()
> DEFINE_UNIVERSAL_DEV_PM_OPS()

Changing interfaces / deprecating macros is not good thing to do in
-cip kernel. How sure are we this will not cause build failures or
build warnings in unrelated piece of code?

Thanks and best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]