linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* lib/maple_tree.c:330:20: error: unused function 'mte_set_full'
@ 2024-08-30 23:42 kernel test robot
  2024-08-31  0:50 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2024-08-30 23:42 UTC (permalink / raw)
  To: Liam R. Howlett
  Cc: llvm, oe-kbuild-all, linux-kernel, Andrew Morton,
	Linux Memory Management List, Matthew Wilcox (Oracle)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fb24560f31f9dff2c97707cfed6029bfebebaf1c
commit: 54a611b605901c7d5d05b6b8f5d04a6ceb0962aa Maple Tree: add new data structure
date:   1 year, 11 months ago
config: x86_64-sof-customedconfig-amd-defconfig (https://download.01.org/0day-ci/archive/20240831/202408310728.S7EE59BN-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240831/202408310728.S7EE59BN-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/202408310728.S7EE59BN-lkp@intel.com/

All errors (new ones prefixed by >>):

>> lib/maple_tree.c:330:20: error: unused function 'mte_set_full' [-Werror,-Wunused-function]
     330 | static inline void mte_set_full(const struct maple_enode *node)
         |                    ^~~~~~~~~~~~
>> lib/maple_tree.c:335:20: error: unused function 'mte_clear_full' [-Werror,-Wunused-function]
     335 | static inline void mte_clear_full(const struct maple_enode *node)
         |                    ^~~~~~~~~~~~~~
   2 errors generated.


vim +/mte_set_full +330 lib/maple_tree.c

   329	
 > 330	static inline void mte_set_full(const struct maple_enode *node)
   331	{
   332		node = (void *)((unsigned long)node & ~MAPLE_ENODE_NULL);
   333	}
   334	
 > 335	static inline void mte_clear_full(const struct maple_enode *node)
   336	{
   337		node = (void *)((unsigned long)node | MAPLE_ENODE_NULL);
   338	}
   339	

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


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

* Re: lib/maple_tree.c:330:20: error: unused function 'mte_set_full'
  2024-08-30 23:42 lib/maple_tree.c:330:20: error: unused function 'mte_set_full' kernel test robot
@ 2024-08-31  0:50 ` Andrew Morton
  2024-08-31  1:28   ` Nathan Chancellor
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2024-08-31  0:50 UTC (permalink / raw)
  To: kernel test robot
  Cc: Liam R. Howlett, llvm, oe-kbuild-all, linux-kernel,
	Linux Memory Management List, Matthew Wilcox (Oracle)

On Sat, 31 Aug 2024 07:42:38 +0800 kernel test robot <lkp@intel.com> wrote:

> All errors (new ones prefixed by >>):
> 
> >> lib/maple_tree.c:330:20: error: unused function 'mte_set_full' [-Werror,-Wunused-function]
>      330 | static inline void mte_set_full(const struct maple_enode *node)
>          |                    ^~~~~~~~~~~~
> >> lib/maple_tree.c:335:20: error: unused function 'mte_clear_full' [-Werror,-Wunused-function]
>      335 | static inline void mte_clear_full(const struct maple_enode *node)
>          |                    ^~~~~~~~~~~~~~
>    2 errors generated.

afaict these have never been used.  It's odd that this was just detected.

Should we just zap them or is there some reason to retain?

--- a/lib/maple_tree.c~a
+++ a/lib/maple_tree.c
@@ -348,21 +348,6 @@ static inline void *mte_safe_root(const
 	return (void *)((unsigned long)node & ~MAPLE_ROOT_NODE);
 }
 
-static inline void *mte_set_full(const struct maple_enode *node)
-{
-	return (void *)((unsigned long)node & ~MAPLE_ENODE_NULL);
-}
-
-static inline void *mte_clear_full(const struct maple_enode *node)
-{
-	return (void *)((unsigned long)node | MAPLE_ENODE_NULL);
-}
-
-static inline bool mte_has_null(const struct maple_enode *node)
-{
-	return (unsigned long)node & MAPLE_ENODE_NULL;
-}
-
 static __always_inline bool ma_is_root(struct maple_node *node)
 {
 	return ((unsigned long)node->parent & MA_ROOT_PARENT);
_




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

* Re: lib/maple_tree.c:330:20: error: unused function 'mte_set_full'
  2024-08-31  0:50 ` Andrew Morton
@ 2024-08-31  1:28   ` Nathan Chancellor
  2024-09-03 16:16     ` Liam R. Howlett
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2024-08-31  1:28 UTC (permalink / raw)
  To: Andrew Morton
  Cc: kernel test robot, Liam R. Howlett, llvm, oe-kbuild-all,
	linux-kernel, Linux Memory Management List,
	Matthew Wilcox (Oracle)

On Fri, Aug 30, 2024 at 05:50:15PM -0700, Andrew Morton wrote:
> On Sat, 31 Aug 2024 07:42:38 +0800 kernel test robot <lkp@intel.com> wrote:
> 
> > All errors (new ones prefixed by >>):
> > 
> > >> lib/maple_tree.c:330:20: error: unused function 'mte_set_full' [-Werror,-Wunused-function]
> >      330 | static inline void mte_set_full(const struct maple_enode *node)
> >          |                    ^~~~~~~~~~~~
> > >> lib/maple_tree.c:335:20: error: unused function 'mte_clear_full' [-Werror,-Wunused-function]
> >      335 | static inline void mte_clear_full(const struct maple_enode *node)
> >          |                    ^~~~~~~~~~~~~~
> >    2 errors generated.
> 
> afaict these have never been used.  It's odd that this was just detected.

I don't think it has just now been detected, as these functions have
been flagged before:

https://lore.kernel.org/20240503160821.GB3960118@thelio-3990X/

> Should we just zap them or is there some reason to retain?

From the above thread, Liam and Matthew seem to want to retain them.
Perhaps just wrapping them in '#if 0' and a comment that says these will
eventually see use would be a happy compromise between outright removal
and doing nothing about this warning?

> --- a/lib/maple_tree.c~a
> +++ a/lib/maple_tree.c
> @@ -348,21 +348,6 @@ static inline void *mte_safe_root(const
>  	return (void *)((unsigned long)node & ~MAPLE_ROOT_NODE);
>  }
>  
> -static inline void *mte_set_full(const struct maple_enode *node)
> -{
> -	return (void *)((unsigned long)node & ~MAPLE_ENODE_NULL);
> -}
> -
> -static inline void *mte_clear_full(const struct maple_enode *node)
> -{
> -	return (void *)((unsigned long)node | MAPLE_ENODE_NULL);
> -}
> -
> -static inline bool mte_has_null(const struct maple_enode *node)
> -{
> -	return (unsigned long)node & MAPLE_ENODE_NULL;
> -}
> -
>  static __always_inline bool ma_is_root(struct maple_node *node)
>  {
>  	return ((unsigned long)node->parent & MA_ROOT_PARENT);
> _
> 
> 
> 


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

* Re: lib/maple_tree.c:330:20: error: unused function 'mte_set_full'
  2024-08-31  1:28   ` Nathan Chancellor
@ 2024-09-03 16:16     ` Liam R. Howlett
  0 siblings, 0 replies; 4+ messages in thread
From: Liam R. Howlett @ 2024-09-03 16:16 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Andrew Morton, kernel test robot, llvm, oe-kbuild-all,
	linux-kernel, Linux Memory Management List,
	Matthew Wilcox (Oracle)

* Nathan Chancellor <nathan@kernel.org> [240830 21:28]:
> On Fri, Aug 30, 2024 at 05:50:15PM -0700, Andrew Morton wrote:
> > On Sat, 31 Aug 2024 07:42:38 +0800 kernel test robot <lkp@intel.com> wrote:
> > 
> > > All errors (new ones prefixed by >>):
> > > 
> > > >> lib/maple_tree.c:330:20: error: unused function 'mte_set_full' [-Werror,-Wunused-function]
> > >      330 | static inline void mte_set_full(const struct maple_enode *node)
> > >          |                    ^~~~~~~~~~~~
> > > >> lib/maple_tree.c:335:20: error: unused function 'mte_clear_full' [-Werror,-Wunused-function]
> > >      335 | static inline void mte_clear_full(const struct maple_enode *node)
> > >          |                    ^~~~~~~~~~~~~~
> > >    2 errors generated.
> > 
> > afaict these have never been used.  It's odd that this was just detected.
> 
> I don't think it has just now been detected, as these functions have
> been flagged before:
> 
> https://lore.kernel.org/20240503160821.GB3960118@thelio-3990X/
> 
> > Should we just zap them or is there some reason to retain?
> 
> From the above thread, Liam and Matthew seem to want to retain them.
> Perhaps just wrapping them in '#if 0' and a comment that says these will
> eventually see use would be a happy compromise between outright removal
> and doing nothing about this warning?

Besides these functions being static and inline (And thus compiled out),
they are stopping people from trying to use the bit in the address -
which we have had happen.

I am still working on the code to use these on my side, although I have
been held up with other work upstream.

> 
> > --- a/lib/maple_tree.c~a
> > +++ a/lib/maple_tree.c
> > @@ -348,21 +348,6 @@ static inline void *mte_safe_root(const
> >  	return (void *)((unsigned long)node & ~MAPLE_ROOT_NODE);
> >  }
> >  
> > -static inline void *mte_set_full(const struct maple_enode *node)
> > -{
> > -	return (void *)((unsigned long)node & ~MAPLE_ENODE_NULL);
> > -}
> > -
> > -static inline void *mte_clear_full(const struct maple_enode *node)
> > -{
> > -	return (void *)((unsigned long)node | MAPLE_ENODE_NULL);
> > -}
> > -
> > -static inline bool mte_has_null(const struct maple_enode *node)
> > -{
> > -	return (unsigned long)node & MAPLE_ENODE_NULL;
> > -}
> > -
> >  static __always_inline bool ma_is_root(struct maple_node *node)
> >  {
> >  	return ((unsigned long)node->parent & MA_ROOT_PARENT);
> > _
> > 
> > 
> > 


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

end of thread, other threads:[~2024-09-03 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-30 23:42 lib/maple_tree.c:330:20: error: unused function 'mte_set_full' kernel test robot
2024-08-31  0:50 ` Andrew Morton
2024-08-31  1:28   ` Nathan Chancellor
2024-09-03 16:16     ` Liam R. Howlett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox