Re: [PATCH 0/3] mm: rename confusing function names

From: Andrew Morton
Date: Tue Feb 05 2013 - 20:54:24 EST


On Wed, 06 Feb 2013 09:34:16 +0800 Zhang Yanfei <zhangyanfei@xxxxxxxxxxxxxx> wrote:

> >
> >
> > hm,
> >
> > static unsigned int nr_free_zone_pages(int offset)
> > {
> > ...
> > unsigned int sum = 0;
> > ...
> > return sum;
> > }
> >
> > How long will it be until these things start exploding from
> > sums-of-zones which exceed 16TB?
> >
>
> You mean overflow? Hmm.. it might happens. Change the sum to
> unsigned long is ok?

The sum, the return value. And in the case of nr_free_buffer_pages(),
the signedness of the return value (sheesh). Then review and if
necessary fix up all the callsites. That's all a separate exercise.

--
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/