From: Mel Gorman Date: Wed, 2 Jun 2021 03:53:05 +0000 (+1000) Subject: mm/swap: make swap_address_space an inline function X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2531ed3a29c0b1113f3b8d9a1012eb5d115f52d3;p=users%2Fjedix%2Flinux-maple.git mm/swap: make swap_address_space an inline function make W=1 generates the following warning in page_mapping() for allnoconfig mm/util.c:700:15: warning: variable `entry' set but not used [-Wunused-but-set-variable] swp_entry_t entry; ^~~~~ swap_address is a #define on !CONFIG_SWAP configurations. Make the helper an inline function to suppress the warning, add type checking and to apply any side-effects in the parameter list. Link: https://lkml.kernel.org/r/20210520084809.8576-12-mgorman@techsingularity.net Signed-off-by: Mel Gorman Reviewed-by: Yang Shi Acked-by: Vlastimil Babka Cc: Dan Streetman Cc: David Hildenbrand Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Stephen Rothwell --- diff --git a/include/linux/swap.h b/include/linux/swap.h index cda64cd202d02..bb4889369a228 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -542,7 +542,11 @@ static inline void put_swap_device(struct swap_info_struct *si) { } -#define swap_address_space(entry) (NULL) +static inline struct address_space *swap_address_space(swp_entry_t entry) +{ + return NULL; +} + #define get_nr_swap_pages() 0L #define total_swap_pages 0L #define total_swapcache_pages() 0UL