mm/swap: Fix swap_cluster_lock() !CONFIG_SWAP stub signature mismatch
Subsystems (2)
PATCH 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.
Sync the stub signature with the real function.
--- mm/swap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/swap.h +1 -1
@@ -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 ; }
Signature · 1 line
2.54.0
Quoted 20 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.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 <[email protected]>--- mm/swap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/swap.h +0
-0
mm/swap.h static inline unsigned int folio_swap_flags(struct folio *folio) · line 340
Quoted 5 lines
mm/swap.h +1
-1@@ -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.
Quoted 6 lines
mm/swap.h +0
-0{return NULL ; }Signature · 1 line
2.54.0
Quoted 21 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.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 <[email protected]>--- mm/swap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/swap.h +0
-0
mm/swap.h static inline unsigned int folio_swap_flags(struct folio *folio) · line 340
Quoted 5 lines
mm/swap.h +1
-1@@ -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.
Quoted 16 lines · Kairui Song
Quoted 15 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.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 <[email protected]>--- mm/swap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
mm/swap.h static inline unsigned int folio_swap_flags(struct folio *folio) · line 340
Quoted 10 lines
mm/swap.h +1
-1@@ -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_lockis never used with !CONFIG_SWAP? In that case we can just delete this redundant declaration.
Agreed. |swap_cluster_lock| is never referenced under |!CONFIG_SWAP|, so this declaration is redundant. I will drop it in v2.