lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <43ca4cc6d11f2cff96f2596783442d5ca4b9358e@linux.dev>
Date: Wed, 10 Jul 2024 03:16:06 +0000
From: xiongwei.song@...ux.dev
To: "Matthew Wilcox" <willy@...radead.org>
Cc: vbabka@...e.cz, surenb@...gle.com, cl@...ux.co, penberg@...nel.org,
 rientjes@...gle.com, iamjoonsoo.kim@....com, akpm@...ux-foundation.org,
 roman.gushchin@...ux.dev, 42.hyeyoo@...il.com, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, "kernel test robot" <lkp@...el.com>,
 "Nathan Chancellor" <nathan@...nel.org>, llvm@...ts.linux.dev, "Nick
 Desaulniers" <ndesaulniers@...gle.com>, sxwjean@...com
Subject: Re: [PATCH] mm/slub: quiet the clang warning with -Wunused-function
 enabled

July 10, 2024 at 11:03 AM, "Matthew Wilcox" <willy@...radead.org> wrote:



> 
> On Wed, Jul 10, 2024 at 10:54:18AM +0800, sxwjean@...com wrote:
> 
> > 
> > From: Xiongwei Song <xiongwei.song@...ux.dev>
> > 
> >  
> > 
> >  The only user of prepare_slab_obj_exts_hook() is
> > 
> >  alloc_tagging_slab_alloc_hook(), which can build with
> > 
> >  CONFIG_MEM_ALLOC_PROFILING enabled. So, the warning was triggerred
> > 
> >  when disabling CONFIG_MEM_ALLOC_PROFILING. Let's add "__maybe_unused"
> > 
> >  for prepare_slab_obj_exts_hook().
> > 
> 
> Perhaps instead clang can be fixed to match gcc's behaviour?

Maybe, I'm not sure. 

Thanks,
Xiongwei

> 
> > 
> > Reported-by: kernel test robot <lkp@...el.com>
> > 
> >  Closes: https://lore.kernel.org/oe-kbuild-all/202407050845.zNONqauD-lkp@intel.com/
> > 
> >  Signed-off-by: Xiongwei Song <xiongwei.song@...ux.dev>
> > 
> >  ---
> > 
> >  mm/slub.c | 4 ++--
> > 
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> >  
> > 
> >  diff --git a/mm/slub.c b/mm/slub.c
> > 
> >  index ce39544acf7c..2e26f20759c0 100644
> > 
> >  --- a/mm/slub.c
> > 
> >  +++ b/mm/slub.c
> > 
> >  @@ -2027,7 +2027,7 @@ static inline bool need_slab_obj_ext(void)
> > 
> >  return false;
> > 
> >  }
> > 
> >  
> > 
> >  -static inline struct slabobj_ext *
> > 
> >  +static inline struct slabobj_ext * __maybe_unused
> > 
> >  prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)
> > 
> >  {
> > 
> >  struct slab *slab;
> > 
> >  @@ -2068,7 +2068,7 @@ static inline bool need_slab_obj_ext(void)
> > 
> >  return false;
> > 
> >  }
> > 
> >  
> > 
> >  -static inline struct slabobj_ext *
> > 
> >  +static inline struct slabobj_ext * __maybe_unused
> > 
> >  prepare_slab_obj_exts_hook(struct kmem_cache *s, gfp_t flags, void *p)
> > 
> >  {
> > 
> >  return NULL;
> > 
> >  -- 
> > 
> >  2.34.1
> >
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ