linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [akpm-mm:mm-new 61/87] drivers/cxl/core/region.c:2437:22: error: invalid use of undefined type 'struct node_notify'
@ 2025-06-06 16:19 kernel test robot
  2025-06-06 19:23 ` Joshua Hahn
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2025-06-06 16:19 UTC (permalink / raw)
  To: Oscar Salvador
  Cc: oe-kbuild-all, Andrew Morton, Linux Memory Management List,
	Jonathan Cameron, Harry Yoo, Vlastimil Babka

Hi Oscar,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-new
head:   b9f05ab60cb240a64e898221de50a037553840c7
commit: 7bd79eaa2076cde601d828532a09ea50e20a976f [61/87] drivers,cxl: use node-notifier instead of memory-notifier
config: loongarch-randconfig-001-20250606 (https://download.01.org/0day-ci/archive/20250607/202506070030.otNokpsc-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250607/202506070030.otNokpsc-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506070030.otNokpsc-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/cxl/core/region.c: In function 'cxl_region_perf_attrs_callback':
>> drivers/cxl/core/region.c:2437:22: error: invalid use of undefined type 'struct node_notify'
    2437 |         int nid = mnb->nid;
         |                      ^~
   drivers/cxl/core/region.c:2440:46: error: 'NODE_ADDED_FIRST_MEMORY' undeclared (first use in this function)
    2440 |         if (nid == NUMA_NO_NODE || action != NODE_ADDED_FIRST_MEMORY)
         |                                              ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/cxl/core/region.c:2440:46: note: each undeclared identifier is reported only once for each function it appears in
   drivers/cxl/core/region.c: In function 'shutdown_notifiers':
   drivers/cxl/core/region.c:3487:9: error: implicit declaration of function 'unregister_node_notifier'; did you mean 'unregister_module_notifier'? [-Wimplicit-function-declaration]
    3487 |         unregister_node_notifier(&cxlr->node_notifier);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
         |         unregister_module_notifier
   drivers/cxl/core/region.c: In function 'cxl_region_probe':
   drivers/cxl/core/region.c:3528:9: error: implicit declaration of function 'register_node_notifier'; did you mean 'register_module_notifier'? [-Wimplicit-function-declaration]
    3528 |         register_node_notifier(&cxlr->node_notifier);
         |         ^~~~~~~~~~~~~~~~~~~~~~
         |         register_module_notifier


vim +2437 drivers/cxl/core/region.c

  2430	
  2431	static int cxl_region_perf_attrs_callback(struct notifier_block *nb,
  2432						  unsigned long action, void *arg)
  2433	{
  2434		struct cxl_region *cxlr = container_of(nb, struct cxl_region,
  2435						       node_notifier);
  2436		struct node_notify *mnb = arg;
> 2437		int nid = mnb->nid;
  2438		int region_nid;
  2439	
  2440		if (nid == NUMA_NO_NODE || action != NODE_ADDED_FIRST_MEMORY)
  2441			return NOTIFY_DONE;
  2442	
  2443		/*
  2444		 * No need to hold cxl_region_rwsem; region parameters are stable
  2445		 * within the cxl_region driver.
  2446		 */
  2447		region_nid = phys_to_target_node(cxlr->params.res->start);
  2448		if (nid != region_nid)
  2449			return NOTIFY_DONE;
  2450	
  2451		if (!cxl_region_update_coordinates(cxlr, nid))
  2452			return NOTIFY_DONE;
  2453	
  2454		return NOTIFY_OK;
  2455	}
  2456	

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [akpm-mm:mm-new 61/87] drivers/cxl/core/region.c:2437:22: error: invalid use of undefined type 'struct node_notify'
  2025-06-06 16:19 [akpm-mm:mm-new 61/87] drivers/cxl/core/region.c:2437:22: error: invalid use of undefined type 'struct node_notify' kernel test robot
@ 2025-06-06 19:23 ` Joshua Hahn
  2025-06-07 22:30   ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Hahn @ 2025-06-06 19:23 UTC (permalink / raw)
  To: kernel test robot
  Cc: Oscar Salvador, oe-kbuild-all, Andrew Morton,
	Linux Memory Management List, Jonathan Cameron, Harry Yoo,
	Vlastimil Babka

On Sat, 7 Jun 2025 00:19:17 +0800 kernel test robot <lkp@intel.com> wrote:

> Hi Oscar,
> 
> FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-new
> head:   b9f05ab60cb240a64e898221de50a037553840c7
> commit: 7bd79eaa2076cde601d828532a09ea50e20a976f [61/87] drivers,cxl: use node-notifier instead of memory-notifier
> config: loongarch-randconfig-001-20250606 (https://download.01.org/0day-ci/archive/20250607/202506070030.otNokpsc-lkp@intel.com/config)
> compiler: loongarch64-linux-gcc (GCC) 15.1.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250607/202506070030.otNokpsc-lkp@intel.com/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@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202506070030.otNokpsc-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>    drivers/cxl/core/region.c: In function 'cxl_region_perf_attrs_callback':
> >> drivers/cxl/core/region.c:2437:22: error: invalid use of undefined type 'struct node_notify'
>     2437 |         int nid = mnb->nid;
>          |                      ^~
>    drivers/cxl/core/region.c:2440:46: error: 'NODE_ADDED_FIRST_MEMORY' undeclared (first use in this function)
>     2440 |         if (nid == NUMA_NO_NODE || action != NODE_ADDED_FIRST_MEMORY)
>          |                                              ^~~~~~~~~~~~~~~~~~~~~~~
>    drivers/cxl/core/region.c:2440:46: note: each undeclared identifier is reported only once for each function it appears in
>    drivers/cxl/core/region.c: In function 'shutdown_notifiers':
>    drivers/cxl/core/region.c:3487:9: error: implicit declaration of function 'unregister_node_notifier'; did you mean 'unregister_module_notifier'? [-Wimplicit-function-declaration]
>     3487 |         unregister_node_notifier(&cxlr->node_notifier);
>          |         ^~~~~~~~~~~~~~~~~~~~~~~~
>          |         unregister_module_notifier
>    drivers/cxl/core/region.c: In function 'cxl_region_probe':
>    drivers/cxl/core/region.c:3528:9: error: implicit declaration of function 'register_node_notifier'; did you mean 'register_module_notifier'? [-Wimplicit-function-declaration]
>     3528 |         register_node_notifier(&cxlr->node_notifier);
>          |         ^~~~~~~~~~~~~~~~~~~~~~
>          |         register_module_notifier

From what I can see, it seems like struct node_notify is conditionally
defined under #ifdef CONFIG_MEMORY_HOTPLUG, but the callsite unconditionally
declares struct node_notify *mnb = arg.

Sent using hkml (https://github.com/sjp38/hackermail)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [akpm-mm:mm-new 61/87] drivers/cxl/core/region.c:2437:22: error: invalid use of undefined type 'struct node_notify'
  2025-06-06 19:23 ` Joshua Hahn
@ 2025-06-07 22:30   ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2025-06-07 22:30 UTC (permalink / raw)
  To: Joshua Hahn
  Cc: kernel test robot, Oscar Salvador, oe-kbuild-all,
	Linux Memory Management List, Jonathan Cameron, Harry Yoo,
	Vlastimil Babka

On Fri,  6 Jun 2025 12:23:45 -0700 Joshua Hahn <joshua.hahnjy@gmail.com> wrote:

> On Sat, 7 Jun 2025 00:19:17 +0800 kernel test robot <lkp@intel.com> wrote:
> 
> > Hi Oscar,
> > 
> > FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
> > 
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-new
> > head:   b9f05ab60cb240a64e898221de50a037553840c7
> > commit: 7bd79eaa2076cde601d828532a09ea50e20a976f [61/87] drivers,cxl: use node-notifier instead of memory-notifier
> > config: loongarch-randconfig-001-20250606 (https://download.01.org/0day-ci/archive/20250607/202506070030.otNokpsc-lkp@intel.com/config)
> > compiler: loongarch64-linux-gcc (GCC) 15.1.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250607/202506070030.otNokpsc-lkp@intel.com/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@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202506070030.otNokpsc-lkp@intel.com/
> > 
> > All errors (new ones prefixed by >>):
> > 
> >    drivers/cxl/core/region.c: In function 'cxl_region_perf_attrs_callback':
> > >> drivers/cxl/core/region.c:2437:22: error: invalid use of undefined type 'struct node_notify'
> >     2437 |         int nid = mnb->nid;
> >          |                      ^~
> >    drivers/cxl/core/region.c:2440:46: error: 'NODE_ADDED_FIRST_MEMORY' undeclared (first use in this function)
> >     2440 |         if (nid == NUMA_NO_NODE || action != NODE_ADDED_FIRST_MEMORY)
> >          |                                              ^~~~~~~~~~~~~~~~~~~~~~~
> >    drivers/cxl/core/region.c:2440:46: note: each undeclared identifier is reported only once for each function it appears in
> >    drivers/cxl/core/region.c: In function 'shutdown_notifiers':
> >    drivers/cxl/core/region.c:3487:9: error: implicit declaration of function 'unregister_node_notifier'; did you mean 'unregister_module_notifier'? [-Wimplicit-function-declaration]
> >     3487 |         unregister_node_notifier(&cxlr->node_notifier);
> >          |         ^~~~~~~~~~~~~~~~~~~~~~~~
> >          |         unregister_module_notifier
> >    drivers/cxl/core/region.c: In function 'cxl_region_probe':
> >    drivers/cxl/core/region.c:3528:9: error: implicit declaration of function 'register_node_notifier'; did you mean 'register_module_notifier'? [-Wimplicit-function-declaration]
> >     3528 |         register_node_notifier(&cxlr->node_notifier);
> >          |         ^~~~~~~~~~~~~~~~~~~~~~
> >          |         register_module_notifier
> 
> >From what I can see, it seems like struct node_notify is conditionally
> defined under #ifdef CONFIG_MEMORY_HOTPLUG, but the callsite unconditionally
> declares struct node_notify *mnb = arg.

Yup.  Also,

-	struct memory_notify *mnb = arg;
+	struct node_notify *mnb = arg;

`mnb' is no longer an appropriate identifier!  Maybe nnb?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-07 22:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-06 16:19 [akpm-mm:mm-new 61/87] drivers/cxl/core/region.c:2437:22: error: invalid use of undefined type 'struct node_notify' kernel test robot
2025-06-06 19:23 ` Joshua Hahn
2025-06-07 22:30   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).