Skip to content

Commit db82b8d

Browse files
committed
PM: runtime: Fix conditional guard definitions
Since pm_runtime_get_active() returns 0 on success, all of the DEFINE_GUARD_COND() macros in pm_runtime.h need the "_RET == 0" condition at the end of the argument list or they would not work correctly. Fixes: 9a0abc3 ("PM: runtime: Add auto-cleanup macros for "resume and get" operations") Reported-by: kernel test robot <lkp@intel.com> Link: https://lore.kernel.org/linux-pm/202510191529.BCyjKlLQ-lkp@intel.com/ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Tested-by: Farhan Ali <alifm@linux.ibm.com> Link: https://patch.msgid.link/5943878.DvuYhMxLoT@rafael.j.wysocki
1 parent 211ddde commit db82b8d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

include/linux/pm_runtime.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -629,13 +629,13 @@ DEFINE_GUARD(pm_runtime_active_auto, struct device *,
629629
* device.
630630
*/
631631
DEFINE_GUARD_COND(pm_runtime_active, _try,
632-
pm_runtime_get_active(_T, RPM_TRANSPARENT))
632+
pm_runtime_get_active(_T, RPM_TRANSPARENT), _RET == 0)
633633
DEFINE_GUARD_COND(pm_runtime_active, _try_enabled,
634-
pm_runtime_resume_and_get(_T))
634+
pm_runtime_resume_and_get(_T), _RET == 0)
635635
DEFINE_GUARD_COND(pm_runtime_active_auto, _try,
636-
pm_runtime_get_active(_T, RPM_TRANSPARENT))
636+
pm_runtime_get_active(_T, RPM_TRANSPARENT), _RET == 0)
637637
DEFINE_GUARD_COND(pm_runtime_active_auto, _try_enabled,
638-
pm_runtime_resume_and_get(_T))
638+
pm_runtime_resume_and_get(_T), _RET == 0)
639639

640640
/**
641641
* pm_runtime_put_sync - Drop device usage counter and run "idle check" if 0.

0 commit comments

Comments
 (0)