Skip to content

Commit 8ac5436

Browse files
Deepak SaxenaLinus Torvalds
authored andcommitted
[PATCH] drivers/eisa: kmalloc + memset -> kzalloc conversion
Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent e66860c commit 8ac5436

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎drivers/eisa/eisa-bus.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,11 @@ static int __init eisa_probe (struct eisa_root_device *root)
281281
/* First try to get hold of slot 0. If there is no device
282282
* here, simply fail, unless root->force_probe is set. */
283283

284-
if (!(edev = kmalloc (sizeof (*edev), GFP_KERNEL))) {
284+
if (!(edev = kzalloc (sizeof (*edev), GFP_KERNEL))) {
285285
printk (KERN_ERR "EISA: Couldn't allocate mainboard slot\n");
286286
return -ENOMEM;
287287
}
288288

289-
memset (edev, 0, sizeof (*edev));
290-
291289
if (eisa_request_resources (root, edev, 0)) {
292290
printk (KERN_WARNING \
293291
"EISA: Cannot allocate resource for mainboard\n");
@@ -317,13 +315,11 @@ static int __init eisa_probe (struct eisa_root_device *root)
317315
force_probe:
318316

319317
for (c = 0, i = 1; i <= root->slots; i++) {
320-
if (!(edev = kmalloc (sizeof (*edev), GFP_KERNEL))) {
318+
if (!(edev = kzalloc (sizeof (*edev), GFP_KERNEL))) {
321319
printk (KERN_ERR "EISA: Out of memory for slot %d\n",
322320
i);
323321
continue;
324322
}
325-
326-
memset (edev, 0, sizeof (*edev));
327323

328324
if (eisa_request_resources (root, edev, i)) {
329325
printk (KERN_WARNING \

0 commit comments

Comments
 (0)