From: Manik Raina <manik@cisco.com>
To: linux-kernel@vger.kernel.org
Cc: torvalds@transmeta.com
Subject: Re: enums
Date: Fri, 28 Jun 2002 10:01:20 +0530 [thread overview]
Message-ID: <3D1BE698.44B04F6B@cisco.com> (raw)
In-Reply-To: 3D1B0B95.51E13621@cisco.com
If no one has any objections, Can this be applied as a patch ?
Manik Raina wrote:
>
> is there a particular reason we dislike constructs as attached in the
> diffs below ?
> with enums, we dont have to increment MAX_NR_ZONES everytime a new one
> is added .
>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> diff -u -r -U 6 cmp/include/linux/mmzone.h linux-2.5.24/include/linux/mmzone.h
> --- cmp/include/linux/mmzone.h Fri Jun 21 04:23:42 2002
> +++ linux-2.5.24/include/linux/mmzone.h Thu Jun 27 18:00:25 2002
> @@ -88,16 +88,21 @@
> * rarely used fields:
> */
> char *name;
> unsigned long size;
> } zone_t;
>
> -#define ZONE_DMA 0
> -#define ZONE_NORMAL 1
> -#define ZONE_HIGHMEM 2
> -#define MAX_NR_ZONES 3
> +enum zone_type {
> +
> + ZONE_DMA,
> + ZONE_NORMAL,
> + ZONE_HIGHMEM,
> + MAX_NR_ZONES,
> +
> +};
> +
>
> /*
> * One allocation request operates on a zonelist. A zonelist
> * is a list of zones, the first one is the 'goal' of the
> * allocation, the other zones are fallback zones, in decreasing
> * priority.
prev parent reply other threads:[~2002-06-28 4:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-27 12:56 enums Manik Raina
2002-06-27 13:03 ` enums Manik Raina
2002-06-28 4:31 ` Manik Raina [this message]
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=3D1BE698.44B04F6B@cisco.com \
--to=manik@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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