Skip to content

Commit

Permalink
um: Eliminate null test after alloc_bootmem
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
musicakc authored and richardweinberger committed Aug 3, 2016
1 parent 523d939 commit fed4c72
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions arch/um/kernel/initrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fed4c72

Please sign in to comment.