From a2822e7f00cdccbff8e507b5ebbddce1aa95eb5d Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 6 Sep 2005 15:16:51 -0700 Subject: [PATCH] pnp: consolidate kmalloc wrappers ISAPNP, PNPBIOS, and PNPACPI all had their own kmalloc wrappers that reimplemented kcalloc(). Remove the wrappers and just use kcalloc() directly. Note that this also removes the PNPBIOS error message when the kmalloc fails. Signed-off-by: Bjorn Helgaas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/pnp/pnpacpi/core.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'drivers/pnp/pnpacpi/core.c') diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 8655dd2e5b83..d3d292ea5876 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c @@ -41,14 +41,6 @@ static inline int is_exclusive_device(struct acpi_device *dev) return (!acpi_match_ids(dev, excluded_id_list)); } -void *pnpacpi_kmalloc(size_t size, int f) -{ - void *p = kmalloc(size, f); - if (p) - memset(p, 0, size); - return p; -} - /* * Compatible Device IDs */ @@ -143,7 +135,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) return 0; pnp_dbg("ACPI device : hid %s", acpi_device_hid(device)); - dev = pnpacpi_kmalloc(sizeof(struct pnp_dev), GFP_KERNEL); + dev = kcalloc(1, sizeof(struct pnp_dev), GFP_KERNEL); if (!dev) { pnp_err("Out of memory"); return -ENOMEM; @@ -173,7 +165,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) dev->number = num; /* set the initial values for the PnP device */ - dev_id = pnpacpi_kmalloc(sizeof(struct pnp_id), GFP_KERNEL); + dev_id = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL); if (!dev_id) goto err; pnpidacpi_to_pnpid(acpi_device_hid(device), dev_id->id); @@ -205,8 +197,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) for (i = 0; i < cid_list->count; i++) { if (!ispnpidacpi(cid_list->id[i].value)) continue; - dev_id = pnpacpi_kmalloc(sizeof(struct pnp_id), - GFP_KERNEL); + dev_id = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL); if (!dev_id) continue; -- cgit v1.2.3