alloc_bootmem and related functions never return NULL. Thus a NULL
test after calls to these functions is unnecessary.

The following Coccinelle semantic patch was used for making the change:

@@
expression E;
statement S;
@@

E = 
\(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...)
... when != E
- if (E == NULL) S

Signed-off-by: Himangi Saraogi <himangi...@gmail.com>
Acked-by: Julia Lawall <julia.law...@lip6.fr>
---
 arch/um/kernel/physmem.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 30fdd5d..fb041cf 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -43,8 +43,6 @@ int __init init_maps(unsigned long physmem, unsigned long 
iomem,
        total_len = phys_len + iomem_len + highmem_len;
 
        map = alloc_bootmem_low_pages(total_len);
-       if (map == NULL)
-               return -ENOMEM;
 
        for (i = 0; i < total_pages; i++) {
                p = &map[i];
-- 
1.9.1


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

Reply via email to