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

From: Tejun Heo
Date: Thu Jul 14 2011 - 16:20:47 EST


Hello,

On Thu, Jul 14, 2011 at 10:10 PM, H. Peter Anvin <hpa@xxxxxxxxx> wrote:
> On 07/12/2011 02:16 AM, Tejun Heo wrote:
>> +     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.

Oh, right, I got confused w/ u64.

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

Hmm... looking at the boot log, not really. [ ) ranges are more
common. memblock code is one of notable exceptions and I actually was
thinking about converting it. [ ) ranges are easier to recognize and
most of code we have can't deal with the full range (and it shouldn't
need to - chopping off one top and bottom is much saner approach
anyway).

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/