[lkml]   [2010]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 23/35] x86: make 32bit support NO_BOOTMEM
On Tue, 09 Feb 2010 11:32:34 -0800
Yinghai Lu <> wrote:

> --- a/arch/x86/kernel/early_res.c
> +++ b/arch/x86/kernel/early_res.c
> @@ -354,6 +354,9 @@ int __init get_free_all_memory_range(struct range **rangep, int nodeid)
> /* need to go over early_node_map to find out good range for node */
> nr_range = add_from_early_node_map(range, count, nr_range, nodeid);
> +#ifdef CONFIG_X86_32
> + subtract_range(range, count, max_low_pfn, -1UL);
> +#endif
> subtract_early_res(range, count);
> nr_range = clean_sort_range(range, count);

I'm too lazy to hunt through all the patches to see the surrounding code...

The "-1UL" is worrisome. If that contant is to be assigned to a u64
then on x86_32 we end up with 0x00000000ffffffff, which is surely

Generally I think it's safer and more maintainable (but odd-looking) to
use plain old "-1" when specifying the all-ones contant pattern.
Because "-1" always works, whatever the size of the target scalar.
This particularly matters when you're dealing with types which have
different sizes on different architectures, or whose type changes with
config options.

 \ /
  Last update: 2010-02-09 21:07    [W:0.207 / U:13.428 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site