From cd86128088554d64fea1679191509f00e6353c5b Mon Sep 17 00:00:00 2001 From: "Robert P. J. Day" Date: Wed, 13 Dec 2006 00:34:52 -0800 Subject: [PATCH] Fix numerous kcalloc() calls, convert to kzalloc() All kcalloc() calls of the form "kcalloc(1,...)" are converted to the equivalent kzalloc() calls, and a few kcalloc() calls with the incorrect ordering of the first two arguments are fixed. Signed-off-by: Robert P. J. Day Cc: Jeff Garzik Cc: Alan Cox Cc: Dominik Brodowski Cc: Adam Belay Cc: James Bottomley Cc: Greg KH Cc: Mark Fasheh Cc: Trond Myklebust Cc: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/pnp/pnpacpi/core.c | 6 +++--- drivers/pnp/pnpacpi/rsparser.c | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'drivers/pnp/pnpacpi') diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 6cf34a63c79..62eda5d5902 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c @@ -139,7 +139,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) return 0; pnp_dbg("ACPI device : hid %s", acpi_device_hid(device)); - dev = kcalloc(1, sizeof(struct pnp_dev), GFP_KERNEL); + dev = kzalloc(sizeof(struct pnp_dev), GFP_KERNEL); if (!dev) { pnp_err("Out of memory"); return -ENOMEM; @@ -169,7 +169,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) dev->number = num; /* set the initial values for the PnP device */ - dev_id = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL); + dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL); if (!dev_id) goto err; pnpidacpi_to_pnpid(acpi_device_hid(device), dev_id->id); @@ -201,7 +201,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 = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL); + dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL); if (!dev_id) continue; diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index 379048fdf05..7a535542fe9 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c @@ -298,7 +298,7 @@ static void pnpacpi_parse_dma_option(struct pnp_option *option, struct acpi_reso if (p->channel_count == 0) return; - dma = kcalloc(1, sizeof(struct pnp_dma), GFP_KERNEL); + dma = kzalloc(sizeof(struct pnp_dma), GFP_KERNEL); if (!dma) return; @@ -354,7 +354,7 @@ static void pnpacpi_parse_irq_option(struct pnp_option *option, if (p->interrupt_count == 0) return; - irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL); + irq = kzalloc(sizeof(struct pnp_irq), GFP_KERNEL); if (!irq) return; @@ -375,7 +375,7 @@ static void pnpacpi_parse_ext_irq_option(struct pnp_option *option, if (p->interrupt_count == 0) return; - irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL); + irq = kzalloc(sizeof(struct pnp_irq), GFP_KERNEL); if (!irq) return; @@ -396,7 +396,7 @@ pnpacpi_parse_port_option(struct pnp_option *option, if (io->address_length == 0) return; - port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); + port = kzalloc(sizeof(struct pnp_port), GFP_KERNEL); if (!port) return; port->min = io->minimum; @@ -417,7 +417,7 @@ pnpacpi_parse_fixed_port_option(struct pnp_option *option, if (io->address_length == 0) return; - port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); + port = kzalloc(sizeof(struct pnp_port), GFP_KERNEL); if (!port) return; port->min = port->max = io->address; @@ -436,7 +436,7 @@ pnpacpi_parse_mem24_option(struct pnp_option *option, if (p->address_length == 0) return; - mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); + mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL); if (!mem) return; mem->min = p->minimum; @@ -459,7 +459,7 @@ pnpacpi_parse_mem32_option(struct pnp_option *option, if (p->address_length == 0) return; - mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); + mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL); if (!mem) return; mem->min = p->minimum; @@ -482,7 +482,7 @@ pnpacpi_parse_fixed_mem32_option(struct pnp_option *option, if (p->address_length == 0) return; - mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); + mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL); if (!mem) return; mem->min = mem->max = p->address; @@ -514,7 +514,7 @@ pnpacpi_parse_address_option(struct pnp_option *option, struct acpi_resource *r) return; if (p->resource_type == ACPI_MEMORY_RANGE) { - mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); + mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL); if (!mem) return; mem->min = mem->max = p->minimum; @@ -524,7 +524,7 @@ pnpacpi_parse_address_option(struct pnp_option *option, struct acpi_resource *r) ACPI_READ_WRITE_MEMORY) ? IORESOURCE_MEM_WRITEABLE : 0; pnp_register_mem_resource(option, mem); } else if (p->resource_type == ACPI_IO_RANGE) { - port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); + port = kzalloc(sizeof(struct pnp_port), GFP_KERNEL); if (!port) return; port->min = port->max = p->minimum; @@ -721,7 +721,7 @@ int pnpacpi_build_resource_template(acpi_handle handle, if (!res_cnt) return -EINVAL; buffer->length = sizeof(struct acpi_resource) * (res_cnt + 1) + 1; - buffer->pointer = kcalloc(1, buffer->length - 1, GFP_KERNEL); + buffer->pointer = kzalloc(buffer->length - 1, GFP_KERNEL); if (!buffer->pointer) return -ENOMEM; pnp_dbg("Res cnt %d", res_cnt); -- cgit v1.2.3-18-g5258