Skip to contentSkip to conversation

vmevent: Fix build for SWAP=n case

PATCH Applied Anton Vorontsov 2 participants 2 messages Mar 3, 2012 – Mar 4, 2012 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 vmevent: Fix build for SWAP=n case

Caught this build failure:

CC mm/vmevent.o
mm/vmevent.c:17:6: error: expected identifier or '(' before numeric constant mm/vmevent.c:18:1: warning: no semicolon at end of struct or union [enabled by default] mm/vmevent.c: In function 'vmevent_sample':
mm/vmevent.c:84:36: error: expected identifier before numeric constant make[1]: *** [mm/vmevent.o] Error 1
make: *** [mm/] Error 2

This is because linux/swap.h defines nr_swap_pages to 0L, and so things break.

Fix this by undefinding it back, as we don't use it anyway.

---

The patch is for git://github.com/penberg/linux.git vmevent/core.

 mm/vmevent.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
mm/vmevent.c +1 -0
index 37d2c5f..2342752 100644
@@ -6,6 +6,7 @@
 #include <linux/poll.h>
 #include <linux/slab.h>
 #include <linux/swap.h>
+#undef nr_swap_pages /* This is defined to a constant for SWAP=n case */
 
 #define VMEVENT_MAX_FREE_THRESHOD	100
 
Signature · 8 lines
1.7.7.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Applied
#1 lore raw
Quoted 10 lines · Anton Vorontsov

Caught this build failure:

CC mm/vmevent.o
mm/vmevent.c:17:6: error: expected identifier or '(' before numeric constant mm/vmevent.c:18:1: warning: no semicolon at end of struct or union [enabled by default] mm/vmevent.c: In function 'vmevent_sample':
mm/vmevent.c:84:36: error: expected identifier before numeric constant make[1]: *** [mm/vmevent.o] Error 1
make: *** [mm/] Error 2

Quoted 6 lines

This is because linux/swap.h defines nr_swap_pages to 0L, and so things break.

Fix this by undefinding it back, as we don't use it anyway.

Applied, thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>