public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* convert BAD_RANGE() to an inline function
@ 2002-06-02 22:15 William Lee Irwin III
  0 siblings, 0 replies; only message in thread
From: William Lee Irwin III @ 2002-06-02 22:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: trivial

BAD_RANGE() is too complex to merit being a macro definition. The
following patch converts it to an inline function.

Against 2.5.19.


Cheers,
Bill


===== mm/page_alloc.c 1.67 vs edited =====
--- 1.67/mm/page_alloc.c	Sun Jun  2 15:10:36 2002
+++ edited/mm/page_alloc.c	Sun Jun  2 15:13:24 2002
@@ -46,12 +46,16 @@
 /*
  * Temporary debugging check.
  */
-#define BAD_RANGE(zone, page)						\
-(									\
-	(((page) - mem_map) >= ((zone)->zone_start_mapnr+(zone)->size))	\
-	|| (((page) - mem_map) < (zone)->zone_start_mapnr)		\
-	|| ((zone) != page_zone(page))					\
-)
+static inline int BAD_RANGE(zone_t *zone, struct page *page)
+{
+	if (page - mem_map >= zone->zone_start_mapnr + zone->size)
+		return 1;
+	if (page - mem_map < zone->zone_start_mapnr)
+		return 1;
+	if (zone != page_zone(page))
+		return 1;
+	return 0;
+}
 
 /*
  * Freeing function for a buddy system allocator.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-06-02 22:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-02 22:15 convert BAD_RANGE() to an inline function William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox