linux/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
..
cache-page.c
dma-alloc.c
elf-fdpic.c
extable.c
fault.c
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
Makefile frv: unbreak misalignment handling changes 2008-05-01 08:03:58 -07: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
tlb-miss.S FRV: arrange things such that BRA can reach from the trap table 2007-11-29 09:24:54 -08:00