2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-17 17:53:56 +08:00
linux-next/arch/avr32/mm
Julia Lawall e24500193b arch/avr32: 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.

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\|alloc_bootmem_node\|alloc_bootmem_low_pages_node\|alloc_bootmem_pages_node\)(...)
... 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\|alloc_bootmem_node\|alloc_bootmem_low_pages_node\|alloc_bootmem_pages_node\)(...)
... when != E
- memset(E,0,E1);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2009-01-06 12:39:25 +01:00
..
cache.c avr32: Introducing asm/syscalls.h 2008-12-17 13:32:38 +01:00
clear_page.S [PATCH] avr32 architecture 2006-09-26 08:48:54 -07:00
copy_page.S [PATCH] avr32 architecture 2006-09-26 08:48:54 -07:00
dma-coherent.c [AVR32] Drop GFP_COMP for DMA memory allocations 2008-01-25 08:31:39 +01:00
fault.c avr32: Fix broken pte dump code in do_page_fault() 2008-02-13 14:44:04 +01:00
init.c arch/avr32: Eliminate NULL test and memset after alloc_bootmem 2009-01-06 12:39:25 +01:00
ioremap.c PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
Makefile [PATCH] avr32 architecture 2006-09-26 08:48:54 -07:00
tlb.c avr32: Clean up and optimize the TLB operations 2008-07-02 11:01:28 +02:00