Re: [PATCH 0/5] mm improvements

Nick Piggin
2004-02-05T15:33:59Z

Nikita Danilov wrote:

>Nick Piggin writes:
> >
> >
> > Nick Piggin wrote:
> >
> > >
> > > + pte_dirty = page_pte_is_dirty(page, pte_paddr);
> > > + if (pte_dirty != 0)
> > > + ret = pte_dirty;
> > >
> > >
> > > Won't this leave ret in a random state? Should it be ret++?
> > >
> >
> > ... must be past my bedtime.
> >
>
>Well, @ret handling is kind of obscure in this function, right.
>
>

Yeah... I think it actually could be:

pte_dirty = page_pte_is_dirty(page, pte_paddr);
if (pte_dirty < 0) {
ret = pte_dirty;
goto out;
}
ret += pte_dirty; /* if (pte_dirty) ret++; */

...

out:
return ret;

Right?