Re: [PATCH] PM: Move to_device() out of CONFIG_PM_SLEEP protection

From: kernel test robot

Date: Wed Mar 04 2026 - 17:57:20 EST


Hi Pengpeng,

kernel test robot noticed the following build errors:

[auto build test ERROR on rafael-pm/linux-next]
[also build test ERROR on rafael-pm/bleeding-edge amd-pstate/linux-next amd-pstate/bleeding-edge linus/master v7.0-rc2 next-20260303]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Pengpeng-Hou/PM-Move-to_device-out-of-CONFIG_PM_SLEEP-protection/20260302-190351
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link: https://lore.kernel.org/r/20260302105456.4134882-1-pengpeng.hou%40isrc.iscas.ac.cn
patch subject: [PATCH] PM: Move to_device() out of CONFIG_PM_SLEEP protection
config: x86_64-allnoconfig (https://download.01.org/0day-ci/archive/20260305/202603050651.Tp7mTeNL-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260305/202603050651.Tp7mTeNL-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603050651.Tp7mTeNL-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from drivers/base/core.c:38:
>> drivers/base/power/power.h:163:50: error: no member named 'entry' in 'struct dev_pm_info'
163 | return container_of(entry, struct device, power.entry);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
include/linux/container_of.h:21:49: note: expanded from macro 'container_of'
21 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
22 | __same_type(*(ptr), void), \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 | "pointer type mismatch in container_of()"); \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:617:74: note: expanded from macro '__same_type'
617 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^
include/linux/build_bug.h:77:50: note: expanded from macro 'static_assert'
77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: expanded from macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
In file included from drivers/base/core.c:38:
>> drivers/base/power/power.h:163:9: error: no member named 'entry' in 'dev_pm_info'
163 | return container_of(entry, struct device, power.entry);
| ^ ~~~~~~
include/linux/container_of.h:24:21: note: expanded from macro 'container_of'
24 | ((type *)(__mptr - offsetof(type, member))); })
| ^ ~~~~~~
include/linux/stddef.h:16:32: note: expanded from macro 'offsetof'
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^ ~~~~~~
2 errors generated.


vim +163 drivers/base/power/power.h

160
161 static inline struct device *to_device(struct list_head *entry)
162 {
> 163 return container_of(entry, struct device, power.entry);
164 }
165

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki