From: Hongfu Li <hongfu.li@linux.dev>
To: akpm@linux-foundation.org, chrisl@kernel.org, kasong@tencent.com,
shikemeng@huaweicloud.com, nphamcs@gmail.com,
baoquan.he@linux.dev, baohua@kernel.org, youngjun.park@lge.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
hongfu.li@linux.dev, Hongfu Li <lihongfu@kylinos.cn>
Subject: [PATCH v2] mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch
Date: Fri, 17 Jul 2026 15:11:04 +0800 [thread overview]
Message-ID: <20260717071104.73467-1-hongfu.li@linux.dev> (raw)
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
next reply other threads:[~2026-07-17 7:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 7:11 Hongfu Li [this message]
2026-07-17 7:17 ` Kairui Song
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260717071104.73467-1-hongfu.li@linux.dev \
--to=hongfu.li@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baoquan.he@linux.dev \
--cc=chrisl@kernel.org \
--cc=kasong@tencent.com \
--cc=lihongfu@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=shikemeng@huaweicloud.com \
--cc=youngjun.park@lge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome