[PATCH 78] fs/proc/vmcore.c: kmalloc + memset conversion to kzalloc

[PATCH 78] fs/proc/vmcore.c: kmalloc + memset conversion to kzalloc

Post by Mariusz Ko » Thu, 02 Aug 2007 07:20:06


Signed-off-by: Mariusz Kozlowski < XXXX@XXXXX.COM >

fs/proc/vmcore.c | 16780 -> 16727 (-53 bytes)
fs/proc/vmcore.o | 113032 -> 112744 (-288 bytes)

fs/proc/vmcore.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

--- linux-2.6.23-rc1-mm1-a/fs/proc/vmcore.c 2007-07-26 13:07:46.000000000 +0200
+++ linux-2.6.23-rc1-mm1-b/fs/proc/vmcore.c 2007-07-31 15:51:05.000000000 +0200
@@ -178,12 +178,7 @@ const struct file_operations proc_vmcore

static struct vmcore* __init get_new_element(void)
{
- struct vmcore *p;
-
- p = kmalloc(sizeof(*p), GFP_KERNEL);
- if (p)
- memset(p, 0, sizeof(*p));
- return p;
+ return kzalloc(sizeof(struct vmcore), GFP_KERNEL);
}

static u64 __init get_vmcore_size_elf64(char *elfptr)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/
 
 
 

1. [PATCH] fs: Convert kmalloc() + memset() to kzalloc() in fs/.

2. [PATCH] fs: Convert kmalloc()+memset() combo to kzalloc().


Convert all obvious combinations of kmalloc()+memset() to single
kzalloc() in the fs/ directory.

Signed-off-by: Robert P. J. Day < XXXX@XXXXX.COM >

---

binfmt_elf_fdpic.c | 3 +--
seq_file.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index f86d5c9..789c1c6 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -709,12 +709,11 @@ #endif
return -ELIBBAD;

size = sizeof(*loadmap) + nloads * sizeof(*seg);
- loadmap = kmalloc(size, GFP_KERNEL);
+ loadmap = kzalloc(size, GFP_KERNEL);
if (!loadmap)
return -ENOMEM;

params->loadmap = loadmap;
- memset(loadmap, 0, size);

loadmap->version = ELF32_FDPIC_LOADMAP_VERSION;
loadmap->nsegs = nloads;
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 555b9ac..f85feba 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -31,12 +31,11 @@ int seq_open(struct file *file, struct s
struct seq_file *p = file->private_data;

if (!p) {
- p = kmalloc(sizeof(*p), GFP_KERNEL);
+ p = kzalloc(sizeof(*p), GFP_KERNEL);
if (!p)
return -ENOMEM;
file->private_data = p;
}
- memset(p, 0, sizeof(*p));
mutex_init(&p->lock);
p->op = op;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/

3. [PATCH 55] drivers/char/n_hdlc.c: kmalloc + memset conversion to kzalloc

4. [PATCH] [drivers/cdrom] kmalloc + memset -> kzalloc conversion

5. [PATCH] [BLUETOOTH] kmalloc + memset -> kzalloc conversion

6. [PATCH 04] drivers/sbus/char/bbc_i2c.c: kmalloc + memset conversion to kzalloc

7. [PATCH 73] drivers/parport/share.c: kmalloc + memset conversion to kzalloc

8. [PATCH 26] drivers/scsi/gdth.c: kmalloc + memset conversion to kzalloc

9. [PATCH] [drivers/eisa] kmalloc + memset -> kzalloc conversion

10. [PATCH 25] drivers/usb/misc/ftdi-elan.c: kmalloc + memset conversion to kzalloc

11. [PATCH 09] drivers/char/consolemap.c: kmalloc + memset conversion to kzalloc

12. [PATCH] drivers/media: Conversions from kmalloc+memset to kzalloc.

13. [PATCH 17] drivers/md/dm-path-selector.c: kmalloc + memset conversion to kzalloc

14. [PATCH] wireless net: Conversions of kmalloc/memset to kzalloc

15. [PATCH] [IDE] kmalloc + memset -> kzalloc conversion