Re: [PATCH 13/13] memblock, x86: Replace memblock_x86_reserve/free_range() with generic ones

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/12/2011 02:16 AM, Tejun Heo wrote:
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -449,6 +449,9 @@ long __init_memblock memblock_remove(phys_addr_t base, phys_addr_t size)
>  
>  long __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
>  {
> +	memblock_dbg("   memblock_free: [%#016llx-%#016llx] %pF\n",
> +		     base, base + size, (void *)_RET_IP_);
> +
>  	return __memblock_remove(&memblock.reserved, base, size);
>  }
>  
> @@ -456,6 +459,8 @@ long __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
>  {
>  	struct memblock_type *_rgn = &memblock.reserved;
>  
> +	memblock_dbg("memblock_reserve: [%#016llx-%#016llx] %pF\n",
> +		     base, base + size, (void *)_RET_IP_);
>  	BUG_ON(0 == size);
>  
>  	return memblock_add_region(_rgn, base, size);

This assumes phys_addr_t == unsigned long long, which is just plain
wrong.  I will fix it up, but please take more care with that in the
future.  This triggers a warning when building for i386 non-PAE, which
is a good thing because it is a real error.

Also, don't we usually display resources as an *inclusive* range,
meaning that the last one should be base + size - 1?

	-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux