diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-02-28 09:34:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 17:35:17 -0500 |
commit | f5afe8064f3087bead8fea7e32547c2a3ada5fd0 (patch) | |
tree | de6a9d60aad6ee262c04290d73e414cd92b4ad5d /drivers/pci/hotplug/ibmphp_core.c | |
parent | 7c8f25da12a3dda46fb730699582895d5fc51287 (diff) |
[PATCH] PCI: kzalloc() conversion in drivers/pci
this patch converts drivers/pci to kzalloc usage.
Compile tested with allyes config.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/ibmphp_core.c')
-rw-r--r-- | drivers/pci/hotplug/ibmphp_core.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c index dc59da675c08..45e2a0d9b596 100644 --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c | |||
@@ -1141,7 +1141,7 @@ static int enable_slot(struct hotplug_slot *hs) | |||
1141 | goto error_power; | 1141 | goto error_power; |
1142 | } | 1142 | } |
1143 | 1143 | ||
1144 | slot_cur->func = kmalloc(sizeof(struct pci_func), GFP_KERNEL); | 1144 | slot_cur->func = kzalloc(sizeof(struct pci_func), GFP_KERNEL); |
1145 | if (!slot_cur->func) { | 1145 | if (!slot_cur->func) { |
1146 | /* We cannot do update_slot_info here, since no memory for | 1146 | /* We cannot do update_slot_info here, since no memory for |
1147 | * kmalloc n.e.ways, and update_slot_info allocates some */ | 1147 | * kmalloc n.e.ways, and update_slot_info allocates some */ |
@@ -1149,7 +1149,6 @@ static int enable_slot(struct hotplug_slot *hs) | |||
1149 | rc = -ENOMEM; | 1149 | rc = -ENOMEM; |
1150 | goto error_power; | 1150 | goto error_power; |
1151 | } | 1151 | } |
1152 | memset(slot_cur->func, 0, sizeof(struct pci_func)); | ||
1153 | slot_cur->func->busno = slot_cur->bus; | 1152 | slot_cur->func->busno = slot_cur->bus; |
1154 | slot_cur->func->device = slot_cur->device; | 1153 | slot_cur->func->device = slot_cur->device; |
1155 | for (i = 0; i < 4; i++) | 1154 | for (i = 0; i < 4; i++) |
@@ -1252,13 +1251,12 @@ int ibmphp_do_disable_slot(struct slot *slot_cur) | |||
1252 | 1251 | ||
1253 | if (slot_cur->func == NULL) { | 1252 | if (slot_cur->func == NULL) { |
1254 | /* We need this for fncs's that were there on bootup */ | 1253 | /* We need this for fncs's that were there on bootup */ |
1255 | slot_cur->func = kmalloc(sizeof(struct pci_func), GFP_KERNEL); | 1254 | slot_cur->func = kzalloc(sizeof(struct pci_func), GFP_KERNEL); |
1256 | if (!slot_cur->func) { | 1255 | if (!slot_cur->func) { |
1257 | err("out of system memory\n"); | 1256 | err("out of system memory\n"); |
1258 | rc = -ENOMEM; | 1257 | rc = -ENOMEM; |
1259 | goto error; | 1258 | goto error; |
1260 | } | 1259 | } |
1261 | memset(slot_cur->func, 0, sizeof(struct pci_func)); | ||
1262 | slot_cur->func->busno = slot_cur->bus; | 1260 | slot_cur->func->busno = slot_cur->bus; |
1263 | slot_cur->func->device = slot_cur->device; | 1261 | slot_cur->func->device = slot_cur->device; |
1264 | } | 1262 | } |