* [PATCH v2] mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch
@ 2026-07-17 7:11 Hongfu Li
2026-07-17 7:17 ` Kairui Song
0 siblings, 1 reply; 2+ messages in thread
From: Hongfu Li @ 2026-07-17 7:11 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.
Delete the unused stub function entirely.
Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Reviewed-by: Baoquan He <baoquan.he@linux.dev>
---
v2:
- Drop the stub entirely instead of fixing its signature. All callers are under
CONFIG_SWAP, so the stub is dead code. (Suggested by Kairui Song)
- Add Reviewed-by tag
- Update commit message
---
mm/swap.h | 6 ------
1 file changed, 6 deletions(-)
diff --git a/mm/swap.h b/mm/swap.h
index 77d2d14eda42..d7834888e0d2 100644
--- a/mm/swap.h
+++ b/mm/swap.h
@@ -336,12 +336,6 @@ 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)
-{
- return NULL;
-}
-
static inline struct swap_cluster_info *swap_cluster_get_and_lock(
struct folio *folio)
{
--
2.54.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch
2026-07-17 7:11 [PATCH v2] mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch Hongfu Li
@ 2026-07-17 7:17 ` Kairui Song
0 siblings, 0 replies; 2+ messages in thread
From: Kairui Song @ 2026-07-17 7:17 UTC (permalink / raw)
To: Hongfu Li
Cc: akpm, chrisl, shikemeng, nphamcs, baoquan.he, baohua,
youngjun.park, linux-mm, linux-kernel, Hongfu Li
On Fri, Jul 17, 2026 at 3:13 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.
>
> Delete the unused stub function entirely.
>
> Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
> Reviewed-by: Baoquan He <baoquan.he@linux.dev>
> ---
> v2:
> - Drop the stub entirely instead of fixing its signature. All callers are under
> CONFIG_SWAP, so the stub is dead code. (Suggested by Kairui Song)
> - Add Reviewed-by tag
> - Update commit message
> ---
> mm/swap.h | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/mm/swap.h b/mm/swap.h
> index 77d2d14eda42..d7834888e0d2 100644
> --- a/mm/swap.h
> +++ b/mm/swap.h
> @@ -336,12 +336,6 @@ 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)
> -{
> - return NULL;
> -}
> -
> static inline struct swap_cluster_info *swap_cluster_get_and_lock(
> struct folio *folio)
> {
> --
> 2.54.0
>
Acked-by: Kairui Song <kasong@tencent.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-17 7:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17 7:11 [PATCH v2] mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch Hongfu Li
2026-07-17 7:17 ` 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.