remove compile warnings when CONFIG_SWAP=n
PATCH 1/1 remove compile warnings when CONFIG_SWAP=n
By making some macros reference their parameters.
Get rid of compile-time warnings:
mm/vmscan.c: In function `remove_mapping':
mm/vmscan.c:382: warning: unused variable `swap'
It's used, but not without CONFIG_SWAP.
Signed-off-by David Brownell <[email protected]>
include/linux/swap.h +3 -3
@@ -290,9 +290,9 @@ static inline void disable_swap_token(vorelease_pages ((pages), (nr),0 );#define show_swap_cache_info ()/*NOTHING*/ -#define free_swap_and_cache (swp)/*NOTHING*/ -#define swap_duplicate (swp)/*NOTHING*/ -#define swap_free (swp)/*NOTHING*/ +#define free_swap_and_cache(swp) ((void)(swp)/*NOP*/) +#define swap_duplicate(swp) ((void)(swp)/*NOP*/) +#define swap_free(swp) ((void)(swp)/*NOP*/)#define read_swap_cache_async (swp,vma,addr) NULL#define lookup_swap_cache (swp) NULL#define valid_swaphandles (swp, off) 0