Skip to contentSkip to conversation

mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch

PATCH Applied Hongfu Li 2 participants 2 messages Jul 17

Subsystems (2)
lore
Share & tools
lore

Hongfu Li

author
#0 lore raw

PATCH v2 1/1 mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch

From: Hongfu Li <[email protected]>

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.

---
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(-)
mm/swap.h +0 -6
index 77d2d14eda42..d7834888e0d2 100644
@@ -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)
 {
Signature · 1 line
2.54.0
Acked-by on v2 1/1
#1 lore raw
Quoted 40 lines · Hongfu Li

From: Hongfu Li <[email protected]>

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.

---
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(-)
mm/swap.h +0 -7
index 77d2d14eda42..d7834888e0d2 100644
@@ -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)
 {
--
Quoted 2 lines

2.54.0