Skip to contentSkip to conversation

convert s390 page handling macros to functions.

PATCH New Heiko Carstens 1 participant 1 message Sep 8, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 convert s390 page handling macros to functions.

From: Heiko Carstens <[email protected]>

[patch 2/2] convert s390 page handling macros to functions.

Convert s390 page handling macros to functions. In particular this fixes a problem with s390's SetPageUptodate macro which uses its input parameter twice which again can cause subtle bugs.

Cc Martin Schwidefsky <[email protected]>

---

 include/asm-s390/pgtable.h |   85 +++++++++++++++++++++------------------------
 include/linux/page-flags.h |   11 ++---
 2 files changed, 46 insertions(+), 50 deletions(-)
include/linux/page-flags.h +5 -6
Index: linux-2.6/include/linux/page-flags.h
===================================================================
@@ -123,12 +123,11 @@
 
 #define PageUptodate(page)	test_bit(PG_uptodate, &(page)->flags)
 #ifdef CONFIG_S390
-#define SetPageUptodate(_page) \
-	do {								      \
-		struct page *__page = (_page);				      \
-		if (!test_and_set_bit(PG_uptodate, &__page->flags))	      \
-			page_test_and_clear_dirty(_page);		      \
-	} while (0)
+static inline void SetPageUptodate(struct page *page)
+{
+	if (!test_and_set_bit(PG_uptodate, &page->flags))
+		page_test_and_clear_dirty(page);
+}
 #else
 #define SetPageUptodate(page)	set_bit(PG_uptodate, &(page)->flags)
 #endif
include/asm-s390/pgtable.h +41 -44

110 lines not on this page · raw message