resources: tidy __request_region()

No functional change.  Just return NULL for kzalloc failure immediately,
rather than wrapping the whole function body in the body of an "if".

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Bjorn Helgaas 2008-10-15 22:05:14 -07:00 committed by Linus Torvalds
parent 923f7f6970
commit c26ec88ea8
1 changed files with 21 additions and 20 deletions

View File

@ -630,7 +630,9 @@ struct resource * __request_region(struct resource *parent,
{
struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
if (res) {
if (!res)
return NULL;
res->name = name;
res->start = start;
res->end = start + n - 1;
@ -656,7 +658,6 @@ struct resource * __request_region(struct resource *parent,
break;
}
write_unlock(&resource_lock);
}
return res;
}
EXPORT_SYMBOL(__request_region);