linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [akpm-mm:mm-new 359/411] mm/swap.h:455:24: error: implicit declaration of function 'swp_offset'; did you mean 'bh_offset'?
@ 2025-09-10  1:28 kernel test robot
  2025-09-10  5:36 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2025-09-10  1:28 UTC (permalink / raw)
  To: Kairui Song
  Cc: oe-kbuild-all, Andrew Morton, Linux Memory Management List, Chris Li

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-new
head:   f4e8f46973fe0c0f579944a37e96ba9efbe00cca
commit: aabe1e0289084317ef7603c14132758fad3a975e [359/411] mm, swap: use the swap table for the swap cache and switch API
config: m68k-allnoconfig (https://download.01.org/0day-ci/archive/20250910/202509100956.7q0VPOo2-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250910/202509100956.7q0VPOo2-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/202509100956.7q0VPOo2-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from mm/filemap.c:65:
   mm/swap.h: In function 'folio_index':
>> mm/swap.h:455:24: error: implicit declaration of function 'swp_offset'; did you mean 'bh_offset'? [-Wimplicit-function-declaration]
     455 |                 return swp_offset(folio->swap);
         |                        ^~~~~~~~~~
         |                        bh_offset


vim +455 mm/swap.h

   440	
   441	/**
   442	 * folio_index - File index of a folio.
   443	 * @folio: The folio.
   444	 *
   445	 * For a folio which is either in the page cache or the swap cache,
   446	 * return its index within the address_space it belongs to.  If you know
   447	 * the folio is definitely in the page cache, you can look at the folio's
   448	 * index directly.
   449	 *
   450	 * Return: The index (offset in units of pages) of a folio in its file.
   451	 */
   452	static inline pgoff_t folio_index(struct folio *folio)
   453	{
   454		if (unlikely(folio_test_swapcache(folio)))
 > 455			return swp_offset(folio->swap);
   456		return folio->index;
   457	}
   458	

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


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

* Re: [akpm-mm:mm-new 359/411] mm/swap.h:455:24: error: implicit declaration of function 'swp_offset'; did you mean 'bh_offset'?
  2025-09-10  1:28 [akpm-mm:mm-new 359/411] mm/swap.h:455:24: error: implicit declaration of function 'swp_offset'; did you mean 'bh_offset'? kernel test robot
@ 2025-09-10  5:36 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2025-09-10  5:36 UTC (permalink / raw)
  To: kernel test robot
  Cc: Kairui Song, oe-kbuild-all, Linux Memory Management List, Chris Li

On Wed, 10 Sep 2025 09:28:50 +0800 kernel test robot <lkp@intel.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-new
> head:   f4e8f46973fe0c0f579944a37e96ba9efbe00cca
> commit: aabe1e0289084317ef7603c14132758fad3a975e [359/411] mm, swap: use the swap table for the swap cache and switch API
> config: m68k-allnoconfig (https://download.01.org/0day-ci/archive/20250910/202509100956.7q0VPOo2-lkp@intel.com/config)
> compiler: m68k-linux-gcc (GCC) 15.1.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250910/202509100956.7q0VPOo2-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/202509100956.7q0VPOo2-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from mm/filemap.c:65:
>    mm/swap.h: In function 'folio_index':
> >> mm/swap.h:455:24: error: implicit declaration of function 'swp_offset'; did you mean 'bh_offset'? [-Wimplicit-function-declaration]
>      455 |                 return swp_offset(folio->swap);
>          |                        ^~~~~~~~~~
>          |                        bh_offset

Thanks.  I'll do this:

--- a/mm/swap.h~mm-swap-use-the-swap-table-for-the-swap-cache-and-switch-api-fix
+++ a/mm/swap.h
@@ -451,8 +451,10 @@ static inline int non_swapcache_batch(sw
  */
 static inline pgoff_t folio_index(struct folio *folio)
 {
+#ifdef CONFIG_MMU
 	if (unlikely(folio_test_swapcache(folio)))
 		return swp_offset(folio->swap);
+#endif
 	return folio->index;
 }
 
_



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

end of thread, other threads:[~2025-09-10  5:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-10  1:28 [akpm-mm:mm-new 359/411] mm/swap.h:455:24: error: implicit declaration of function 'swp_offset'; did you mean 'bh_offset'? kernel test robot
2025-09-10  5:36 ` Andrew Morton

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