From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [PATCH 03/11] memcg: change defines to an enum Date: Tue, 26 Jun 2012 12:28:34 +0400 Message-ID: <4FE972B2.1020509@parallels.com> References: <1340633728-12785-1-git-send-email-glommer@parallels.com> <1340633728-12785-4-git-send-email-glommer@parallels.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: David Rientjes Cc: cgroups@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , linux-kernel@vger.kernel.org, Frederic Weisbecker , Pekka Enberg , Michal Hocko , Johannes Weiner , Christoph Lameter , devel@openvz.org, kamezawa.hiroyu@jp.fujitsu.com, Tejun Heo On 06/26/2012 08:11 AM, David Rientjes wrote: > On Mon, 25 Jun 2012, Glauber Costa wrote: > >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c >> index 8e601e8..9352d40 100644 >> --- a/mm/memcontrol.c >> +++ b/mm/memcontrol.c >> @@ -387,9 +387,12 @@ enum charge_type { >> }; >> >> /* for encoding cft->private value on file */ >> -#define _MEM (0) >> -#define _MEMSWAP (1) >> -#define _OOM_TYPE (2) >> +enum res_type { >> + _MEM, >> + _MEMSWAP, >> + _OOM_TYPE, >> +}; >> + >> #define MEMFILE_PRIVATE(x, val) ((x) << 16 | (val)) >> #define MEMFILE_TYPE(val) ((val) >> 16 & 0xffff) >> #define MEMFILE_ATTR(val) ((val) & 0xffff) > > Shouldn't everything that does MEMFILE_TYPE() now be using type > enum res_type rather than int? > If you mean the following three fields, no, since they are masks and operations. If you mean something else, what do you mean ? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org