diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2005-09-06 22:16:51 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 23:57:21 (GMT) |
commit | a2822e7f00cdccbff8e507b5ebbddce1aa95eb5d (patch) | |
tree | 07ac5760bb7771744daa59b759c34190fb39f3ae /drivers/pnp/pnpbios/rsparser.c | |
parent | ea2f1590aaffbd02f1850c19c3895ff4d092c6e0 (diff) | |
download | linux-fsl-qoriq-a2822e7f00cdccbff8e507b5ebbddce1aa95eb5d.tar.xz |
[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 <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pnp/pnpbios/rsparser.c')
-rw-r--r-- | drivers/pnp/pnpbios/rsparser.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c index e305bb1..b0ca65b 100644 --- a/drivers/pnp/pnpbios/rsparser.c +++ b/drivers/pnp/pnpbios/rsparser.c @@ -247,7 +247,7 @@ static void pnpbios_parse_mem_option(unsigned char *p, int size, struct pnp_option *option) { struct pnp_mem * mem; - mem = pnpbios_kmalloc(sizeof(struct pnp_mem), GFP_KERNEL); + mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); if (!mem) return; mem->min = ((p[5] << 8) | p[4]) << 8; @@ -263,7 +263,7 @@ static void pnpbios_parse_mem32_option(unsigned char *p, int size, struct pnp_option *option) { struct pnp_mem * mem; - mem = pnpbios_kmalloc(sizeof(struct pnp_mem), GFP_KERNEL); + mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); if (!mem) return; mem->min = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; @@ -279,7 +279,7 @@ static void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, struct pnp_option *option) { struct pnp_mem * mem; - mem = pnpbios_kmalloc(sizeof(struct pnp_mem), GFP_KERNEL); + mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); if (!mem) return; mem->min = mem->max = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; @@ -296,7 +296,7 @@ pnpbios_parse_irq_option(unsigned char *p, int size, struct pnp_option *option) struct pnp_irq * irq; unsigned long bits; - irq = pnpbios_kmalloc(sizeof(struct pnp_irq), GFP_KERNEL); + irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL); if (!irq) return; bits = (p[2] << 8) | p[1]; @@ -313,7 +313,7 @@ static void pnpbios_parse_dma_option(unsigned char *p, int size, struct pnp_option *option) { struct pnp_dma * dma; - dma = pnpbios_kmalloc(sizeof(struct pnp_dma), GFP_KERNEL); + dma = kcalloc(1, sizeof(struct pnp_dma), GFP_KERNEL); if (!dma) return; dma->map = p[1]; @@ -326,7 +326,7 @@ static void pnpbios_parse_port_option(unsigned char *p, int size, struct pnp_option *option) { struct pnp_port * port; - port = pnpbios_kmalloc(sizeof(struct pnp_port), GFP_KERNEL); + port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); if (!port) return; port->min = (p[3] << 8) | p[2]; @@ -342,7 +342,7 @@ static void pnpbios_parse_fixed_port_option(unsigned char *p, int size, struct pnp_option *option) { struct pnp_port * port; - port = pnpbios_kmalloc(sizeof(struct pnp_port), GFP_KERNEL); + port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); if (!port) return; port->min = port->max = (p[2] << 8) | p[1]; @@ -530,7 +530,7 @@ pnpbios_parse_compatible_ids(unsigned char *p, unsigned char *end, struct pnp_de case SMALL_TAG_COMPATDEVID: /* compatible ID */ if (len != 4) goto len_err; - dev_id = pnpbios_kmalloc(sizeof (struct pnp_id), GFP_KERNEL); + dev_id = kcalloc(1, sizeof (struct pnp_id), GFP_KERNEL); if (!dev_id) return NULL; memset(dev_id, 0, sizeof(struct pnp_id)); |