um: Eliminate null test after alloc_bootmem
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Sat, 28 May 2016 13:09:03 +0000 (18:39 +0530)
committerRichard Weinberger <richard@nod.at>
Wed, 3 Aug 2016 22:00:06 +0000 (00:00 +0200)
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: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/kernel/initrd.c

index 55cead809b18baccf804dd89dafec13c37eb0af0..48bae81f8dcab2febedc7238f190b985e5da4a13 100644 (file)
@@ -37,8 +37,6 @@ static int __init read_initrd(void)
        }
 
        area = alloc_bootmem(size);
-       if (area == NULL)
-               return 0;
 
        if (load_initrd(initrd, area, size) == -1)
                return 0;
This page took 0.026687 seconds and 5 git commands to generate.