mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch
Subsystems (2)
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
@@ -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
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 usespgoff_tinstead of unsigned long for offset. All callers are underCONFIG_SWAPso the extra parameter is dead.Delete the unused stub function entirely.
Signed-off-by Hongfu Li <[email protected]>Reviewed-by Baoquan He <[email protected]>---
v2:
- Drop the stub entirely instead of fixing its signature. All callers are underCONFIG_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@@ -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