Re: [PATCH] x86, numa: exit early on numa_reset_distance()

From: Tejun Heo
Date: Wed Feb 16 2011 - 18:16:13 EST


On Wed, Feb 16, 2011 at 03:08:57PM -0800, Yinghai Lu wrote:
> > But please move the existing numa_distance = NULL before the
> > conditional and do if (!numa_distance_cnt) return;
>
> confused. Do you mean this one ?

Heh, I was confused.

> @@ -371,11 +371,13 @@ static void __init numa_reset_distance(v
> {
> size_t size;
>
> - size = numa_distance_cnt * sizeof(numa_distance[0]);
> - memblock_x86_free_range(__pa(numa_distance),
> - __pa(numa_distance) + size);
> + if (numa_distance_cnt) {
> + size = numa_distance_cnt * sizeof(numa_distance[0]);
> + memblock_x86_free_range(__pa(numa_distance),
> + __pa(numa_distance) + size);
> + numa_distance_cnt = 0;
> + }
> numa_distance = NULL;
> - numa_distance_cnt = 0;

But I like this one better.

Acked-by: Tejun Heo <tj@xxxxxxxxxx>

Thanks.

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