linux/arch
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
..
alpha Merge branch 'personality' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-10-16 12:32:52 -07:00
arm Merge branch 'personality' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-10-16 12:32:52 -07:00
avr32 Merge branch 'personality' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-10-16 12:32:52 -07:00
blackfin Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6 2008-10-16 12:45:08 -07:00
cris cpufreq: remove policy->governor setting in drivers initialization 2008-10-15 16:42:47 -07:00
frv FRV: Eliminate NULL test and memset after alloc_bootmem 2008-10-16 15:06:54 -07:00
h8300 Merge branch 'personality' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-10-16 12:32:52 -07:00
ia64 Merge branch 'personality' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-10-16 12:32:52 -07:00
m32r misc: replace __FUNCTION__ with __func__ 2008-10-16 11:21:30 -07:00
m68k arch/m68k/mm/kmap.c: introduce missing kfree 2008-10-14 10:23:27 -07:00
m68knommu [PATCH] remove unused ibcs2/PER_SVR4 in SET_PERSONALITY 2008-10-16 15:40:05 +02:00
mips Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2008-10-16 12:40:26 -07:00
mn10300 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2008-10-13 17:13:56 +01:00
parisc Merge branch 'personality' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-10-16 12:32:52 -07:00
powerpc Merge branch 'personality' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-10-16 12:32:52 -07:00
s390 Merge branch 'personality' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2008-10-16 12:32:52 -07:00
sh [PATCH] remove unused ibcs2/PER_SVR4 in SET_PERSONALITY 2008-10-16 15:40:05 +02:00
sparc [PATCH] remove unused ibcs2/PER_SVR4 in SET_PERSONALITY 2008-10-16 15:40:05 +02:00
sparc64 sparc64: use iommu_num_pages function in IOMMU code 2008-10-16 11:21:33 -07:00
um uml: remove the dead TTY_LOG code 2008-10-16 11:21:30 -07:00
x86 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6 2008-10-16 12:40:26 -07:00
xtensa xtensa: remove dead CONFIG_BLK_DEV_IDE code 2008-10-13 21:39:34 +02:00
.gitignore
Kconfig Kconfig: eliminate "def_bool n" constructs 2008-10-16 11:21:31 -07:00