Skip to contentSkip to conversation

remove compile warnings when CONFIG_SWAP=n

PATCH New David Brownell 1 participant 1 message May 17, 2006 MM swap

lore
Share & tools
lore
#0 lore raw

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.

include/linux/swap.h +3 -3
Index: at91-pre2/include/linux/swap.h
===================================================================
@@ -290,9 +290,9 @@ static inline void disable_swap_token(vo
 	release_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