All of lore.kernel.org
 help / color / mirror / Atom feed
* make memclass() an inline functino
@ 2002-06-02 23:33 William Lee Irwin III
  2002-06-03  1:09 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: William Lee Irwin III @ 2002-06-02 23:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: trivial

memclass is too large to be a #define; it overflows 80 columns and does
not make use of facilities available only to macros.

This patch convert memclass() to be an inline function.


Cheers,
Bill


===== include/linux/mmzone.h 1.10 vs edited =====
--- 1.10/include/linux/mmzone.h	Sat May 25 16:25:47 2002
+++ edited/include/linux/mmzone.h	Sun Jun  2 16:32:35 2002
@@ -142,8 +142,14 @@
 extern int numnodes;
 extern pg_data_t *pgdat_list;
 
-#define memclass(pgzone, classzone)	(((pgzone)->zone_pgdat == (classzone)->zone_pgdat) \
-			&& ((pgzone) <= (classzone)))
+static inline int memclass(zone_t *pgzone, zone_t *classzone)
+{
+	if (pgzone->zone_pgdat != classzone->zone_pgdat)
+		return 0;
+	if (pgzone > classzone)
+		return 0;
+	return 1;
+}
 
 /*
  * The following two are not meant for general usage. They are here as

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-06-03  5:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-02 23:33 make memclass() an inline functino William Lee Irwin III
2002-06-03  1:09 ` Alan Cox
2002-06-03  5:08   ` William Lee Irwin III

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.