linux-stable/drivers/s390
Julia Lawall 3ca1c9907a [S390] drivers/s390: 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.

 drivers/s390/char/raw3270.c  |   11 +----------
 drivers/s390/char/sclp_con.c |    2 --
 2 files changed, 1 insertion(+), 12 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: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2008-07-14 10:02:15 +02:00
..
block [S390] cio: introduce fcx enabled scsw format 2008-07-14 10:02:07 +02:00
char [S390] drivers/s390: Eliminate NULL test and memset after alloc_bootmem 2008-07-14 10:02:15 +02:00
cio [S390] cio: Add chsc subchannel driver. 2008-07-14 10:02:12 +02:00
crypto [S390] zcrypt: Add additional card IDs to CEX2C and CEX2A 2008-07-14 10:02:14 +02:00
kvm virtio: set device index in common code. 2008-05-30 15:09:42 +10:00
net [S390] cio: introduce fcx enabled scsw format 2008-07-14 10:02:07 +02:00
scsi [SCSI] Let scsi_cmnd->cmnd use request->cmd buffer 2008-05-02 10:18:22 -05:00
ebcdic.c
Makefile s390: KVM guest: virtio device support, and kvm hypercalls 2008-04-27 12:00:51 +03:00
s390_rdev.c
s390mach.c [S390] stp support. 2008-07-14 10:02:09 +02:00
s390mach.h [S390] stp support. 2008-07-14 10:02:09 +02:00
sysinfo.c [S390] Add new fields for System z10 to /proc/sysinfo 2008-04-17 07:47:01 +02:00