Re: [PATCH] PM: Move to_device() out of CONFIG_PM_SLEEP protection
From: kernel test robot
Date: Wed Mar 04 2026 - 18:12:37 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-20260304]
[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: sh-se7751_defconfig (https://download.01.org/0day-ci/archive/20260305/202603050624.gml2vPY4-lkp@xxxxxxxxx/config)
compiler: sh4-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260305/202603050624.gml2vPY4-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/202603050624.gml2vPY4-lkp@xxxxxxxxx/
All errors (new ones prefixed by >>):
In file included from include/linux/bits.h:30,
from include/linux/ioport.h:14,
from include/linux/acpi.h:13,
from drivers/base/core.c:11:
drivers/base/power/power.h: In function 'to_device':
>> drivers/base/power/power.h:163:56: error: 'struct dev_pm_info' has no member named 'entry'
163 | return container_of(entry, struct device, power.entry);
| ^
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:21:9: note: in expansion of macro 'static_assert'
21 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:21:23: note: in expansion of macro '__same_type'
21 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~
drivers/base/power/power.h:163:16: note: in expansion of macro 'container_of'
163 | return container_of(entry, struct device, power.entry);
| ^~~~~~~~~~~~
include/linux/compiler_types.h:617:27: error: expression in static assertion is not an integer
617 | #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
| ^~~~
include/linux/container_of.h:21:9: note: in expansion of macro 'static_assert'
21 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~~~
include/linux/container_of.h:21:23: note: in expansion of macro '__same_type'
21 | static_assert(__same_type(*(ptr), ((type *)0)->member) || \
| ^~~~~~~~~~~
drivers/base/power/power.h:163:16: note: in expansion of macro 'container_of'
163 | return container_of(entry, struct device, power.entry);
| ^~~~~~~~~~~~
In file included from include/uapi/linux/posix_types.h:5,
from include/uapi/linux/types.h:14,
from include/linux/types.h:5,
from include/linux/kasan-checks.h:5,
from include/asm-generic/rwonce.h:26,
from ./arch/sh/include/generated/asm/rwonce.h:1,
from include/linux/compiler.h:372,
from include/linux/cleanup.h:5,
from include/linux/acpi.h:11:
>> include/linux/stddef.h:16:33: error: 'struct dev_pm_info' has no member named 'entry'
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^~~~~~~~~~~~~~~~~~
include/linux/container_of.h:24:28: note: in expansion of macro 'offsetof'
24 | ((type *)(__mptr - offsetof(type, member))); })
| ^~~~~~~~
drivers/base/power/power.h:163:16: note: in expansion of macro 'container_of'
163 | return container_of(entry, struct device, power.entry);
| ^~~~~~~~~~~~
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