提交 3de3af13 编写于 作者: R Robert P. J. Day 提交者: Linus Torvalds

[PATCH] Remove unnecessary memset(0) calls after kzalloc() calls.

Delete the few remaining unnecessary calls to memset(0) after a call to
kzalloc().
Signed-off-by: NRobert P. J. Day <rpjday@mindspring.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 100bb934
...@@ -401,7 +401,6 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu, ...@@ -401,7 +401,6 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
b = kzalloc(sizeof(struct threshold_block), GFP_KERNEL); b = kzalloc(sizeof(struct threshold_block), GFP_KERNEL);
if (!b) if (!b)
return -ENOMEM; return -ENOMEM;
memset(b, 0, sizeof(struct threshold_block));
b->block = block; b->block = block;
b->bank = bank; b->bank = bank;
...@@ -490,7 +489,6 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) ...@@ -490,7 +489,6 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
} }
memset(b, 0, sizeof(struct threshold_bank));
kobject_set_name(&b->kobj, "threshold_bank%i", bank); kobject_set_name(&b->kobj, "threshold_bank%i", bank);
b->kobj.parent = &per_cpu(device_mce, cpu).kobj; b->kobj.parent = &per_cpu(device_mce, cpu).kobj;
......
...@@ -151,7 +151,6 @@ static int ns558_isa_probe(int io) ...@@ -151,7 +151,6 @@ static int ns558_isa_probe(int io)
return -ENOMEM; return -ENOMEM;
} }
memset(ns558, 0, sizeof(struct ns558));
ns558->io = io; ns558->io = io;
ns558->size = 1 << i; ns558->size = 1 << i;
ns558->gameport = port; ns558->gameport = port;
......
...@@ -530,7 +530,6 @@ pnpbios_parse_compatible_ids(unsigned char *p, unsigned char *end, struct pnp_de ...@@ -530,7 +530,6 @@ pnpbios_parse_compatible_ids(unsigned char *p, unsigned char *end, struct pnp_de
dev_id = kzalloc(sizeof (struct pnp_id), GFP_KERNEL); dev_id = kzalloc(sizeof (struct pnp_id), GFP_KERNEL);
if (!dev_id) if (!dev_id)
return NULL; return NULL;
memset(dev_id, 0, sizeof(struct pnp_id));
pnpid32_to_pnpid(p[1] | p[2] << 8 | p[3] << 16 | p[4] << 24,id); pnpid32_to_pnpid(p[1] | p[2] << 8 | p[3] << 16 | p[4] << 24,id);
memcpy(&dev_id->id, id, 7); memcpy(&dev_id->id, id, 7);
pnp_add_id(dev_id, dev); pnp_add_id(dev_id, dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册