All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch
@ 2026-07-16  8:51 Hongfu Li
  2026-07-16  8:57 ` Baoquan He
  2026-07-16  9:47 ` Kairui Song
  0 siblings, 2 replies; 3+ messages in thread
From: Hongfu Li @ 2026-07-16  8:51 UTC (permalink / raw)
  To: akpm, chrisl, kasong, shikemeng, nphamcs, baoquan.he, baohua,
	youngjun.park
  Cc: linux-mm, linux-kernel, hongfu.li, Hongfu Li

From: Hongfu Li <lihongfu@kylinos.cn>

The !CONFIG_SWAP stub for swap_cluster_lock() has mismatched prototype:
it has an extra unused irq argument and uses pgoff_t instead of unsigned
long for offset. All callers are under CONFIG_SWAP so the extra parameter
is dead.

Sync the stub signature with the real function.

Fixes: 8578e0c00dcf ("mm, swap: use the swap table for the swap cache and switch API")
Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
---
 mm/swap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/swap.h b/mm/swap.h
index 77d2d14eda42..2c4667662601 100644
--- a/mm/swap.h
+++ b/mm/swap.h
@@ -337,7 +337,7 @@ static inline unsigned int folio_swap_flags(struct folio *folio)
 #else /* CONFIG_SWAP */
 struct swap_iocb;
 static inline struct swap_cluster_info *swap_cluster_lock(
-	struct swap_info_struct *si, pgoff_t offset, bool irq)
+		struct swap_info_struct *si, unsigned long offset)
 {
 	return NULL;
 }
-- 
2.54.0


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

* Re: [PATCH] mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch
  2026-07-16  8:51 [PATCH] mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch Hongfu Li
@ 2026-07-16  8:57 ` Baoquan He
  2026-07-16  9:47 ` Kairui Song
  1 sibling, 0 replies; 3+ messages in thread
From: Baoquan He @ 2026-07-16  8:57 UTC (permalink / raw)
  To: Hongfu Li
  Cc: akpm, chrisl, kasong, shikemeng, nphamcs, baohua, youngjun.park,
	linux-mm, linux-kernel, Hongfu Li

On 07/16/26 at 04:51pm, Hongfu Li wrote:
> From: Hongfu Li <lihongfu@kylinos.cn>
> 
> The !CONFIG_SWAP stub for swap_cluster_lock() has mismatched prototype:
> it has an extra unused irq argument and uses pgoff_t instead of unsigned
> long for offset. All callers are under CONFIG_SWAP so the extra parameter
> is dead.
> 
> Sync the stub signature with the real function.
> 
> Fixes: 8578e0c00dcf ("mm, swap: use the swap table for the swap cache and switch API")
> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
> ---
>  mm/swap.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/swap.h b/mm/swap.h
> index 77d2d14eda42..2c4667662601 100644
> --- a/mm/swap.h
> +++ b/mm/swap.h
> @@ -337,7 +337,7 @@ static inline unsigned int folio_swap_flags(struct folio *folio)
>  #else /* CONFIG_SWAP */
>  struct swap_iocb;
>  static inline struct swap_cluster_info *swap_cluster_lock(
> -	struct swap_info_struct *si, pgoff_t offset, bool irq)
> +		struct swap_info_struct *si, unsigned long offset)

Good catch.

Reviewed-by: Baoquan He <baoquan.he@linux.dev>

>  {
>  	return NULL;
>  }
> -- 
> 2.54.0
> 

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

* Re: [PATCH] mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch
  2026-07-16  8:51 [PATCH] mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch Hongfu Li
  2026-07-16  8:57 ` Baoquan He
@ 2026-07-16  9:47 ` Kairui Song
  1 sibling, 0 replies; 3+ messages in thread
From: Kairui Song @ 2026-07-16  9:47 UTC (permalink / raw)
  To: Hongfu Li
  Cc: akpm, chrisl, shikemeng, nphamcs, baoquan.he, baohua,
	youngjun.park, linux-mm, linux-kernel, Hongfu Li

On Thu, Jul 16, 2026 at 4:56 PM Hongfu Li <hongfu.li@linux.dev> wrote:
>
> From: Hongfu Li <lihongfu@kylinos.cn>
>
> The !CONFIG_SWAP stub for swap_cluster_lock() has mismatched prototype:
> it has an extra unused irq argument and uses pgoff_t instead of unsigned
> long for offset. All callers are under CONFIG_SWAP so the extra parameter
> is dead.
>
> Sync the stub signature with the real function.
>
> Fixes: 8578e0c00dcf ("mm, swap: use the swap table for the swap cache and switch API")
> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
> ---
>  mm/swap.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/swap.h b/mm/swap.h
> index 77d2d14eda42..2c4667662601 100644
> --- a/mm/swap.h
> +++ b/mm/swap.h
> @@ -337,7 +337,7 @@ static inline unsigned int folio_swap_flags(struct folio *folio)
>  #else /* CONFIG_SWAP */
>  struct swap_iocb;
>  static inline struct swap_cluster_info *swap_cluster_lock(
> -       struct swap_info_struct *si, pgoff_t offset, bool irq)
> +               struct swap_info_struct *si, unsigned long offset)

Thanks, nice catch. I didn't see any build failure report, it seems
swap_cluster_lock is never used with !CONFIG_SWAP? In that case we can
just delete this redundant declaration.

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

end of thread, other threads:[~2026-07-16  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16  8:51 [PATCH] mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch Hongfu Li
2026-07-16  8:57 ` Baoquan He
2026-07-16  9:47 ` Kairui Song

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.