All of lore.kernel.org
 help / color / mirror / Atom feed
* [gourryinverse:gourry_vmscan_cpuset 4/5] include/linux/swap.h:629:1: warning: control reaches end of non-void function
@ 2025-04-19  5:56 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-04-19  5:56 UTC (permalink / raw)
  To: Gregory Price; +Cc: oe-kbuild-all, Gregory Price

tree:   https://github.com/gourryinverse/linux gourry_vmscan_cpuset
head:   ab08f1fb55da40874056e9837889a33a370c7320
commit: ab06ad7784db1176c78376949565862b951ad1c7 [4/5] memcontrol: remove cgroup indirection from cpuset_node_allowed
config: arc-randconfig-001-20250419 (https://download.01.org/0day-ci/archive/20250419/202504191314.VaTsnEfb-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250419/202504191314.VaTsnEfb-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/202504191314.VaTsnEfb-lkp@intel.com/

All warnings (new ones prefixed by >>):

         |                               ^~
   include/linux/compiler_types.h:522:23: note: in definition of macro '__compiletime_assert'
     522 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
     542 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |         ^~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                            ^~~~~~~~~~~~~
   include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      49 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/swap.h:628:16: note: in expansion of macro 'READ_ONCE'
     628 |         return READ_ONCE(memcg->swappiness);
         |                ^~~~~~~~~
   include/linux/swap.h:628:31: error: invalid use of undefined type 'struct mem_cgroup'
     628 |         return READ_ONCE(memcg->swappiness);
         |                               ^~
   include/linux/compiler_types.h:522:23: note: in definition of macro '__compiletime_assert'
     522 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
     542 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |         ^~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |                            ^~~~~~~~~~~~~
   include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      49 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/swap.h:628:16: note: in expansion of macro 'READ_ONCE'
     628 |         return READ_ONCE(memcg->swappiness);
         |                ^~~~~~~~~
   include/linux/swap.h:628:31: error: invalid use of undefined type 'struct mem_cgroup'
     628 |         return READ_ONCE(memcg->swappiness);
         |                               ^~
   include/linux/compiler_types.h:522:23: note: in definition of macro '__compiletime_assert'
     522 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   include/linux/compiler_types.h:542:9: note: in expansion of macro '_compiletime_assert'
     542 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |         ^~~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
      36 |         compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long),  \
         |         ^~~~~~~~~~~~~~~~~~
   include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
      49 |         compiletime_assert_rwonce_type(x);                              \
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/swap.h:628:16: note: in expansion of macro 'READ_ONCE'
     628 |         return READ_ONCE(memcg->swappiness);
         |                ^~~~~~~~~
   include/linux/swap.h:628:31: error: invalid use of undefined type 'struct mem_cgroup'
     628 |         return READ_ONCE(memcg->swappiness);
         |                               ^~
   include/linux/compiler_types.h:498:27: note: in definition of macro '__unqual_scalar_typeof'
     498 |                 _Generic((x),                                           \
         |                           ^
   include/asm-generic/rwonce.h:50:9: note: in expansion of macro '__READ_ONCE'
      50 |         __READ_ONCE(x);                                                 \
         |         ^~~~~~~~~~~
   include/linux/swap.h:628:16: note: in expansion of macro 'READ_ONCE'
     628 |         return READ_ONCE(memcg->swappiness);
         |                ^~~~~~~~~
   In file included from ./arch/arc/include/generated/asm/rwonce.h:1,
                    from include/linux/compiler.h:364,
                    from include/linux/build_bug.h:5,
                    from include/linux/container_of.h:5,
                    from include/linux/list.h:5,
                    from include/linux/cgroup-defs.h:12,
                    from mm/memcontrol.c:28:
   include/linux/swap.h:628:31: error: invalid use of undefined type 'struct mem_cgroup'
     628 |         return READ_ONCE(memcg->swappiness);
         |                               ^~
   include/asm-generic/rwonce.h:44:73: note: in definition of macro '__READ_ONCE'
      44 | #define __READ_ONCE(x)  (*(const volatile __unqual_scalar_typeof(x) *)&(x))
         |                                                                         ^
   include/linux/swap.h:628:16: note: in expansion of macro 'READ_ONCE'
     628 |         return READ_ONCE(memcg->swappiness);
         |                ^~~~~~~~~
   include/linux/memcontrol.h: At top level:
   include/linux/memcontrol.h:527:20: error: conflicting types for 'mem_cgroup_is_root'; have 'bool(struct mem_cgroup *)' {aka '_Bool(struct mem_cgroup *)'}
     527 | static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg)
         |                    ^~~~~~~~~~~~~~~~~~
   include/linux/swap.h:625:38: note: previous implicit declaration of 'mem_cgroup_is_root' with type 'int()'
     625 |         if (mem_cgroup_disabled() || mem_cgroup_is_root(memcg))
         |                                      ^~~~~~~~~~~~~~~~~~
   include/linux/memcontrol.h:532:20: error: conflicting types for 'mem_cgroup_disabled'; have 'bool(void)' {aka '_Bool(void)'}
     532 | static inline bool mem_cgroup_disabled(void)
         |                    ^~~~~~~~~~~~~~~~~~~
   include/linux/swap.h:625:13: note: previous implicit declaration of 'mem_cgroup_disabled' with type 'int()'
     625 |         if (mem_cgroup_disabled() || mem_cgroup_is_root(memcg))
         |             ^~~~~~~~~~~~~~~~~~~
   include/linux/swap.h: In function 'mem_cgroup_swappiness':
>> include/linux/swap.h:629:1: warning: control reaches end of non-void function [-Wreturn-type]
     629 | }
         | ^
--
   In file included from include/linux/mmu_context.h:5,
                    from include/linux/cpuset.h:18,
                    from include/linux/memcontrol.h:14,
                    from include/linux/swap.h:9,
                    from include/asm-generic/tlb.h:15,
                    from arch/arc/include/asm/tlb.h:10,
                    from mm/maccess.c:8:
   arch/arc/include/asm/mmu_context.h: In function 'get_new_mmu_context':
   arch/arc/include/asm/mmu_context.h:82:17: error: implicit declaration of function 'local_flush_tlb_all' [-Wimplicit-function-declaration]
      82 |                 local_flush_tlb_all();
         |                 ^~~~~~~~~~~~~~~~~~~
   In file included from include/asm-generic/tlb.h:17:
   arch/arc/include/asm/tlbflush.h: At top level:
>> arch/arc/include/asm/tlbflush.h:11:6: warning: conflicting types for 'local_flush_tlb_all'; have 'void(void)'
      11 | void local_flush_tlb_all(void);
         |      ^~~~~~~~~~~~~~~~~~~
   arch/arc/include/asm/mmu_context.h:82:17: note: previous implicit declaration of 'local_flush_tlb_all' with type 'void(void)'
      82 |                 local_flush_tlb_all();
         |                 ^~~~~~~~~~~~~~~~~~~


vim +629 include/linux/swap.h

54f7a49c20ebb5 Barry Song       2024-05-29  616  
6f2cb2f17700a3 Vladimir Davydov 2016-01-20  617  #ifdef CONFIG_MEMCG
6f2cb2f17700a3 Vladimir Davydov 2016-01-20  618  static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg)
6f2cb2f17700a3 Vladimir Davydov 2016-01-20  619  {
4550c4e157ca3d Johannes Weiner  2016-05-05  620  	/* Cgroup2 doesn't have per-cgroup swappiness */
4550c4e157ca3d Johannes Weiner  2016-05-05  621  	if (cgroup_subsys_on_dfl(memory_cgrp_subsys))
82b3aa2681ca92 Yue Zhao         2023-03-06  622  		return READ_ONCE(vm_swappiness);
4550c4e157ca3d Johannes Weiner  2016-05-05  623  
6f2cb2f17700a3 Vladimir Davydov 2016-01-20  624  	/* root ? */
59118c42a60b99 Yang Shi         2019-03-05  625  	if (mem_cgroup_disabled() || mem_cgroup_is_root(memcg))
82b3aa2681ca92 Yue Zhao         2023-03-06  626  		return READ_ONCE(vm_swappiness);
6f2cb2f17700a3 Vladimir Davydov 2016-01-20  627  
82b3aa2681ca92 Yue Zhao         2023-03-06  628  	return READ_ONCE(memcg->swappiness);
6f2cb2f17700a3 Vladimir Davydov 2016-01-20 @629  }
6f2cb2f17700a3 Vladimir Davydov 2016-01-20  630  #else
6f2cb2f17700a3 Vladimir Davydov 2016-01-20  631  static inline int mem_cgroup_swappiness(struct mem_cgroup *mem)
6f2cb2f17700a3 Vladimir Davydov 2016-01-20  632  {
82b3aa2681ca92 Yue Zhao         2023-03-06  633  	return READ_ONCE(vm_swappiness);
6f2cb2f17700a3 Vladimir Davydov 2016-01-20  634  }
6f2cb2f17700a3 Vladimir Davydov 2016-01-20  635  #endif
6f2cb2f17700a3 Vladimir Davydov 2016-01-20  636  

:::::: The code at line 629 was first introduced by commit
:::::: 6f2cb2f17700a39567cf3e9a2e95041def5f3688 swap.h: move memcg related stuff to the end of the file

:::::: TO: Vladimir Davydov <vdavydov@virtuozzo.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-19  5:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-19  5:56 [gourryinverse:gourry_vmscan_cpuset 4/5] include/linux/swap.h:629:1: warning: control reaches end of non-void function kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.