Re: [PATCH] Fix order_base_2(0)

From: Milton Miller
Date: Sun Dec 18 2011 - 02:32:12 EST



David Howells wrote:
> Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> > Does anybody actually *want* order_base_2(0)?
>
> There aren't actually that many users:
..

> | arch/powerpc/platforms/pseries/iommu.c: len = order_base_2(max_addr);
>
> Not sure. Doesn't look likely, but can memory_hotplug_max() be 0 if hotplug
> is not supported?

arch/powerpc/include/asm/mmzone.h has the declaration or #define, and
arch/powerpc/mm/numa.c has the definiton when not defined. All have
memblock_end_of_DRAM() as the minimum value, so it will never be 0.

(The usage is to get the number of bits needed to cover all possible
memory that could be allocated to the OS to size the iommu table).

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