lkml.org 
[lkml]   [2008]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: split e820 reserved entries record to late v3


On Thu, 28 Aug 2008, Yinghai Lu wrote:
> /*
> * Mark e820 reserved areas as busy for the resource manager.
> */
> +struct resource __initdata *e820_res;

Btw, make this one "static" - I don't think anybody outside of this file
should ever use it anyway.

And this:

> + if (e820.map[i].type != E820_RESERVED || res->start < (1ULL<<20))
> + insert_resource(&iomem_resource, res);

is probably worthy of a comment.

And finally:

> +void __init e820_reserve_resources_late(void)
> +{
> + int i;
> + struct resource *res;
> +
> + res = e820_res;
> + for (i = 0; i < e820.nr_map; i++) {
> + if (e820.map[i].type == E820_RESERVED && res->start >= (1ULL<<20))
> + insert_resource(&iomem_resource, res);

instead of duplicating the conditional and always having to worry about it
matching, how about just making it

if (!res->parent)
insert_resource(&iomem_resource, res);

which basically says that "if it's not already inserted, try to re-insert
it now".

Linus


\
 
 \ /
  Last update: 2008-08-29 02:57    [W:0.027 / U:3.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site