linux-sg2042/arch/frv/mm
Julia Lawall 70a3075d40 FRV: Eliminate NULL test and memset after alloc_bootmem
As noted by Akinobu Mita in patch b1fceac2b9,
alloc_bootmem and related functions never return NULL and always return a
zeroed region of memory.  Thus a NULL test or memset after calls to these
functions is unnecessary.

 arch/frv/mm/init.c |    2 --
 1 file changed, 2 deletions(-)

This was fixed using the following semantic patch.
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression E;
statement S;
@@

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

@@
expression E,E1;
@@

E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...)
... when != E
- memset(E,0,E1);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 15:06:54 -07:00
..
Makefile frv: unbreak misalignment handling changes 2008-05-01 08:03:58 -07:00
cache-page.c [PATCH] frv: implement and export various things required by modules 2006-01-08 20:13:36 -08:00
dma-alloc.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
elf-fdpic.c FRV: Miscellaneous fixes 2007-05-08 20:41:14 -07:00
extable.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
fault.c During VM oom condition, kill all threads in process group 2007-10-16 09:42:52 -07:00
highmem.c frv: unexport kmap_atomic_to_page 2008-04-21 16:03:13 -07:00
init.c FRV: Eliminate NULL test and memset after alloc_bootmem 2008-10-16 15:06:54 -07:00
kmap.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mmu-context.c frv: use find_task_by_vpid in cxn_pin_by_pid 2008-02-05 09:44:20 -08:00
pgalloc.c CONFIG_HIGHPTE vs. sub-page page tables. 2008-02-08 09:22:42 -08:00
tlb-flush.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
tlb-miss.S FRV: arrange things such that BRA can reach from the trap table 2007-11-29 09:24:54 -08:00