mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-kernel@vger.kernel.org, hugh@veritas.com,
	hch@infradead.org, kernel@kolivas.org, marcelo@kvack.org,
	arjan@infradead.org, nickpiggin@yahoo.com.au, clameter@sgi.com,
	ak@suse.de, kamezawa.hiroyu@jp.fujitsu.com
Subject: Re: [PATCH 07/11] Use enum to define zones, reformat and comment
Date: Fri, 7 Jul 2006 17:56:02 -0700	[thread overview]
Message-ID: <20060707175602.71f47ec6.akpm@osdl.org> (raw)
In-Reply-To: <20060707231846.3790.10365.sendpatchset@schroedinger.engr.sgi.com>

Christoph Lameter <clameter@sgi.com> wrote:
>
> +typedef enum {
> ...
> +} zones_t;

ooooh noooooo you don't, big guy.



diff -puN include/linux/mm.h~reduce-max_nr_zones-use-enum-to-define-zones-reformat-and-comment-cleanup include/linux/mm.h
--- a/include/linux/mm.h~reduce-max_nr_zones-use-enum-to-define-zones-reformat-and-comment-cleanup
+++ a/include/linux/mm.h
@@ -469,7 +469,7 @@ void split_page(struct page *page, unsig
 #define SECTIONS_MASK		((1UL << SECTIONS_WIDTH) - 1)
 #define ZONETABLE_MASK		((1UL << ZONETABLE_SHIFT) - 1)
 
-static inline zones_t page_zonenum(struct page *page)
+static inline enum zone_type page_zonenum(struct page *page)
 {
 	return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK;
 }
@@ -498,7 +498,7 @@ static inline unsigned long page_to_sect
 	return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
 }
 
-static inline void set_page_zone(struct page *page, zones_t zone)
+static inline void set_page_zone(struct page *page, enum zone_type zone)
 {
 	page->flags &= ~(ZONES_MASK << ZONES_PGSHIFT);
 	page->flags |= (zone & ZONES_MASK) << ZONES_PGSHIFT;
@@ -515,7 +515,7 @@ static inline void set_page_section(stru
 	page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT;
 }
 
-static inline void set_page_links(struct page *page, zones_t zone,
+static inline void set_page_links(struct page *page, enum zone_type zone,
 	unsigned long node, unsigned long pfn)
 {
 	set_page_zone(page, zone);
diff -puN include/linux/mmzone.h~reduce-max_nr_zones-use-enum-to-define-zones-reformat-and-comment-cleanup include/linux/mmzone.h
--- a/include/linux/mmzone.h~reduce-max_nr_zones-use-enum-to-define-zones-reformat-and-comment-cleanup
+++ a/include/linux/mmzone.h
@@ -87,7 +87,7 @@ struct per_cpu_pageset {
 #define zone_pcp(__z, __cpu) (&(__z)->pageset[(__cpu)])
 #endif
 
-typedef enum {
+enum zone_type {
 	/*
 	 * ZONE_DMA is used when there are devices that are not able
 	 * to do DMA to all of addressable memory (ZONE_NORMAL). Then we
@@ -131,7 +131,7 @@ typedef enum {
 	ZONE_HIGHMEM,
 
 	MAX_NR_ZONES
-} zones_t;
+};
 
 #define	ZONES_SHIFT		2	/* ceil(log2(MAX_NR_ZONES)) */
 
@@ -400,12 +400,12 @@ static inline int populated_zone(struct 
 	return (!!zone->present_pages);
 }
 
-static inline int is_highmem_idx(zones_t idx)
+static inline int is_highmem_idx(enum zone_type idx)
 {
 	return (idx == ZONE_HIGHMEM);
 }
 
-static inline int is_normal_idx(zones_t idx)
+static inline int is_normal_idx(enum zone_type idx)
 {
 	return (idx == ZONE_NORMAL);
 }
diff -puN mm/page_alloc.c~reduce-max_nr_zones-use-enum-to-define-zones-reformat-and-comment-cleanup mm/page_alloc.c
--- a/mm/page_alloc.c~reduce-max_nr_zones-use-enum-to-define-zones-reformat-and-comment-cleanup
+++ a/mm/page_alloc.c
@@ -1498,7 +1498,8 @@ static void __meminit build_zonelists(pg
 static void __meminit build_zonelists(pg_data_t *pgdat)
 {
 	int i, node, local_node;
-	zones_t k,j;
+	enum zone_type k;
+	enum zone_type j;
 
 	local_node = pgdat->node_id;
 	for (i = 0; i < GFP_ZONETYPES; i++) {
@@ -1686,7 +1687,7 @@ void zone_init_free_lists(struct pglist_
 }
 
 #define ZONETABLE_INDEX(x, zone_nr)	((x << ZONES_SHIFT) | zone_nr)
-void zonetable_add(struct zone *zone, int nid, zones_t zid,
+void zonetable_add(struct zone *zone, int nid, enum zone_type zid,
 		unsigned long pfn, unsigned long size)
 {
 	unsigned long snum = pfn_to_section_nr(pfn);
@@ -1969,7 +1970,7 @@ __meminit int init_currently_empty_zone(
 static void __meminit free_area_init_core(struct pglist_data *pgdat,
 		unsigned long *zones_size, unsigned long *zholes_size)
 {
-	zones_t j;
+	enum zone_type j;
 	int nid = pgdat->node_id;
 	unsigned long zone_start_pfn = pgdat->node_start_pfn;
 	int ret;
_


  reply	other threads:[~2006-07-08  0:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-07 23:18 [PATCH 00/11] Reduce MAX_NR_ZONES V1 Christoph Lameter
2006-07-07 23:18 ` [PATCH 01/11] swap_prefetch: Remove incorrect use of ZONE_HIGHMEM Christoph Lameter
2006-07-07 23:18 ` [PATCH 02/11] Remove two strange uses of MAX_NR_ZONES Christoph Lameter
2006-07-07 23:18 ` [PATCH 03/11] Fix MAX_NR_ZONES array initializations Christoph Lameter
2006-07-07 23:18 ` [PATCH 04/11] Make display of highmem counters conditional on CONFIG_HIGHMEM Christoph Lameter
2006-07-07 23:18 ` [PATCH 05/11] Move HIGHMEM counters into highmem.c/.h Christoph Lameter
2006-07-07 23:18 ` [PATCH 06/11] Page allocator ZONE_HIGHMEM cleanup Christoph Lameter
2006-07-07 23:18 ` [PATCH 07/11] Use enum to define zones, reformat and comment Christoph Lameter
2006-07-08  0:56   ` Andrew Morton [this message]
2006-07-07 23:18 ` [PATCH 08/11] Make ZONE_DMA32 optional Christoph Lameter
2006-07-07 23:18 ` [PATCH 09/11] Make ZONE_HIGHMEM optional Christoph Lameter
2006-07-07 23:19 ` [PATCH 10/11] Remove display of counters for unconfigured zones Christoph Lameter
2006-07-07 23:19 ` [PATCH 11/11] Fix i386 SRAT check for MAX_NR_ZONES Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060707175602.71f47ec6.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=ak@suse.de \
    --cc=arjan@infradead.org \
    --cc=clameter@sgi.com \
    --cc=hch@infradead.org \
    --cc=hugh@veritas.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@kvack.org \
    --cc=nickpiggin@yahoo.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome