提交 c26ec88e 编写于 作者: B Bjorn Helgaas 提交者: Linus Torvalds

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: NBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 923f7f69
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册