[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>
This commit is contained in:
parent
e66860cbda
commit
8ac5436ced
|
@ -281,13 +281,11 @@ static int __init eisa_probe (struct eisa_root_device *root)
|
||||||
/* First try to get hold of slot 0. If there is no device
|
/* First try to get hold of slot 0. If there is no device
|
||||||
* here, simply fail, unless root->force_probe is set. */
|
* here, simply fail, unless root->force_probe is set. */
|
||||||
|
|
||||||
if (!(edev = kmalloc (sizeof (*edev), GFP_KERNEL))) {
|
if (!(edev = kzalloc (sizeof (*edev), GFP_KERNEL))) {
|
||||||
printk (KERN_ERR "EISA: Couldn't allocate mainboard slot\n");
|
printk (KERN_ERR "EISA: Couldn't allocate mainboard slot\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset (edev, 0, sizeof (*edev));
|
|
||||||
|
|
||||||
if (eisa_request_resources (root, edev, 0)) {
|
if (eisa_request_resources (root, edev, 0)) {
|
||||||
printk (KERN_WARNING \
|
printk (KERN_WARNING \
|
||||||
"EISA: Cannot allocate resource for mainboard\n");
|
"EISA: Cannot allocate resource for mainboard\n");
|
||||||
|
@ -317,14 +315,12 @@ static int __init eisa_probe (struct eisa_root_device *root)
|
||||||
force_probe:
|
force_probe:
|
||||||
|
|
||||||
for (c = 0, i = 1; i <= root->slots; i++) {
|
for (c = 0, i = 1; i <= root->slots; i++) {
|
||||||
if (!(edev = kmalloc (sizeof (*edev), GFP_KERNEL))) {
|
if (!(edev = kzalloc (sizeof (*edev), GFP_KERNEL))) {
|
||||||
printk (KERN_ERR "EISA: Out of memory for slot %d\n",
|
printk (KERN_ERR "EISA: Out of memory for slot %d\n",
|
||||||
i);
|
i);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset (edev, 0, sizeof (*edev));
|
|
||||||
|
|
||||||
if (eisa_request_resources (root, edev, i)) {
|
if (eisa_request_resources (root, edev, i)) {
|
||||||
printk (KERN_WARNING \
|
printk (KERN_WARNING \
|
||||||
"Cannot allocate resource for EISA slot %d\n",
|
"Cannot allocate resource for EISA slot %d\n",
|
||||||
|
|
Loading…
Reference in New Issue