Re: [-mm patch] mm/memcontrol.c: clenups

Adrian Bunk
2007-09-10T21:59:30Z

On Mon, Sep 10, 2007 at 01:53:19PM +0530, Balbir Singh wrote:
> Adrian Bunk wrote:
> > On Fri, Aug 31, 2007 at 09:58:22PM -0700, Andrew Morton wrote:
> >> ...
> >> Changes since 2.6.23-rc3-mm1:
> >> ...
> >> +memory-controller-add-switch-to-control-what-type-of-pages-to-limit-v7.patch
> >> ...
> >> memory containment
> >> ...
> >
> > This patch makes the following needlessly global functions static:
> > - lock_page_container()
> > - unlock_page_container()
> > - __mem_container_move_lists()
> >
> > Additionally, there was no reason for the "mem_control_type" object.
> >
> > Signed-off-by: Adrian Bunk <bunk@kernel.org>
> >
> > ---
> >
> > mm/memcontrol.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > b582cc510b6b0a182dc56025828e7a3c566b9724
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index 8162d98..49bf04f 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -91,7 +91,7 @@ enum {
> > MEM_CONTAINER_TYPE_CACHED,
> > MEM_CONTAINER_TYPE_ALL,
> > MEM_CONTAINER_TYPE_MAX,
> > -} mem_control_type;
> > +};
> >
>
> Not sure about this, is this the preferred style?
>...

It's not about style - your "mem_control_type" was not an identifier,
it was an (unused) variable.

It seems the intended code was:

enum mem_control_type {
MEM_CONTAINER_TYPE_UNSPEC = 0,
MEM_CONTAINER_TYPE_MAPPED,
MEM_CONTAINER_TYPE_CACHED,
MEM_CONTAINER_TYPE_ALL,
MEM_CONTAINER_TYPE_MAX,
};

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed