]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] make memclass() an inline
authorWilliam Lee Irwin III <wli@holomorphy.com>
Mon, 3 Jun 2002 05:34:11 +0000 (22:34 -0700)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Mon, 3 Jun 2002 05:34:11 +0000 (22:34 -0700)
  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.

include/linux/mmzone.h

index d571870bef325dca28a2d045fa03e1b5f884efa5..7b3557e39d45d8168b372edee296f8af7c1059e9 100644 (file)
@@ -142,8 +142,14 @@ typedef struct pglist_data {
 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