Skip to content

Commit 756a64c

Browse files
pcercueirafaeljw
authored andcommitted
PM: Make *_DEV_PM_OPS macros use __maybe_unused
This way, when the dev_pm_ops instance is not referenced anywhere, it will simply be dropped by the compiler without a warning. Signed-off-by: Paul Cercueil <[email protected]> Reviewed-by: Ulf Hansson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 7a82e97 commit 756a64c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/pm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ struct dev_pm_ops {
351351
* to RAM and hibernation.
352352
*/
353353
#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
354-
const struct dev_pm_ops name = { \
354+
const struct dev_pm_ops __maybe_unused name = { \
355355
SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
356356
}
357357

@@ -369,7 +369,7 @@ const struct dev_pm_ops name = { \
369369
* .runtime_resume(), respectively (and analogously for hibernation).
370370
*/
371371
#define UNIVERSAL_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
372-
const struct dev_pm_ops name = { \
372+
const struct dev_pm_ops __maybe_unused name = { \
373373
SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
374374
SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
375375
}

0 commit comments

Comments
 (0)