提交 fed4c726 编写于 作者: A Amitoj Kaur Chawla 提交者: Richard Weinberger

um: Eliminate null test after alloc_bootmem

alloc_bootmem function never returns NULL. Thus a NULL test after a
call to this function is unnecessary.

The Coccinelle semantic patch used to make this change is follows:
@@
expression E;
statement S;
@@

E =
alloc_bootmem(...)
... when != E
- if (E == NULL) S
Signed-off-by: NAmitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: NRichard Weinberger <richard@nod.at>
上级 523d939e
...@@ -37,8 +37,6 @@ static int __init read_initrd(void) ...@@ -37,8 +37,6 @@ static int __init read_initrd(void)
} }
area = alloc_bootmem(size); area = alloc_bootmem(size);
if (area == NULL)
return 0;
if (load_initrd(initrd, area, size) == -1) if (load_initrd(initrd, area, size) == -1)
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册