Re: [2.6 patch] mm/hugetlb.c: fix duplicate variable

From: Adrian Bunk
Date: Mon May 05 2008 - 16:20:47 EST


On Tue, May 06, 2008 at 05:11:10AM +0900, KOSAKI Motohiro wrote:
> > It's confusing that set_max_huge_pages() contained two different
> > variables named "ret", and although the code works correctly this should
> > be fixed.
> >
> > The inner of the two variables can simply be removed.
> ^^^^
>
> two?
> I think removal inner variable is 1, no?

Two people for whom English is not the native language are trying to
understand each other... ;)

There were two variables.

And my patch removes the inner one inside the loop, not the outer one
that is valid within the whole function.

> but, your change is perfectly right, IMHO.
>
> Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>
>
>
> > while (count > persistent_huge_pages) {
> > - int ret;
> > /*
> > * If this allocation races such that we no longer need the
> > * page, free_huge_page will handle it by freeing the page
> > * and reducing the surplus.
> > */

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/