linux/arch/avr32
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
..
boards avr32: Allow reserving multiple pins at once 2009-01-05 12:16:13 +01:00
boot avr32: add .gitignore files 2008-09-19 18:21:29 +02:00
configs avr32: Add defconfig for the favr-32 board 2008-10-14 13:22:19 +02:00
include/asm container freezer: add TIF_FREEZE flag to all architectures 2008-10-20 08:52:33 -07:00
kernel avr32: Introducing asm/syscalls.h 2008-12-17 13:32:38 +01:00
lib avr32: add generic_find_next_le_bit bit function 2008-09-19 18:21:30 +02:00
mach-at32ap avr32: Allow reserving multiple pins at once 2009-01-05 12:16:13 +01:00
mm arch/avr32: Eliminate NULL test and memset after alloc_bootmem 2009-01-06 12:39:25 +01:00
oprofile Add kernel support for oprofile callgraphs on AVR32 2008-09-22 09:51:01 +02:00
Kconfig Merge branches 'boards' and 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6 2008-10-23 15:24:10 +02:00
Kconfig.debug [AVR32] Include instrumentation menu 2008-01-25 08:31:40 +01:00
Makefile avr32: Add MIMC200 board support 2008-10-13 16:36:25 +02:00