aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/pnpbios/rsparser.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2005-09-06 18:16:51 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-07 19:57:21 -0400
commita2822e7f00cdccbff8e507b5ebbddce1aa95eb5d (patch)
tree07ac5760bb7771744daa59b759c34190fb39f3ae /drivers/pnp/pnpbios/rsparser.c
parentea2f1590aaffbd02f1850c19c3895ff4d092c6e0 (diff)
[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.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c
index e305bb132c24..b0ca65b68645 100644
--- a/drivers/pnp/pnpbios/rsparser.c
+++ b/drivers/pnp/pnpbios/rsparser.c
@@ -247,7 +247,7 @@ static void
247pnpbios_parse_mem_option(unsigned char *p, int size, struct pnp_option *option) 247pnpbios_parse_mem_option(unsigned char *p, int size, struct pnp_option *option)
248{ 248{
249 struct pnp_mem * mem; 249 struct pnp_mem * mem;
250 mem = pnpbios_kmalloc(sizeof(struct pnp_mem), GFP_KERNEL); 250 mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL);
251 if (!mem) 251 if (!mem)
252 return; 252 return;
253 mem->min = ((p[5] << 8) | p[4]) << 8; 253 mem->min = ((p[5] << 8) | p[4]) << 8;
@@ -263,7 +263,7 @@ static void
263pnpbios_parse_mem32_option(unsigned char *p, int size, struct pnp_option *option) 263pnpbios_parse_mem32_option(unsigned char *p, int size, struct pnp_option *option)
264{ 264{
265 struct pnp_mem * mem; 265 struct pnp_mem * mem;
266 mem = pnpbios_kmalloc(sizeof(struct pnp_mem), GFP_KERNEL); 266 mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL);
267 if (!mem) 267 if (!mem)
268 return; 268 return;
269 mem->min = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; 269 mem->min = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4];
@@ -279,7 +279,7 @@ static void
279pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, struct pnp_option *option) 279pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, struct pnp_option *option)
280{ 280{
281 struct pnp_mem * mem; 281 struct pnp_mem * mem;
282 mem = pnpbios_kmalloc(sizeof(struct pnp_mem), GFP_KERNEL); 282 mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL);
283 if (!mem) 283 if (!mem)
284 return; 284 return;
285 mem->min = mem->max = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; 285 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)
296 struct pnp_irq * irq; 296 struct pnp_irq * irq;
297 unsigned long bits; 297 unsigned long bits;
298 298
299 irq = pnpbios_kmalloc(sizeof(struct pnp_irq), GFP_KERNEL); 299 irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL);
300 if (!irq) 300 if (!irq)
301 return; 301 return;
302 bits = (p[2] << 8) | p[1]; 302 bits = (p[2] << 8) | p[1];
@@ -313,7 +313,7 @@ static void
313pnpbios_parse_dma_option(unsigned char *p, int size, struct pnp_option *option) 313pnpbios_parse_dma_option(unsigned char *p, int size, struct pnp_option *option)
314{ 314{
315 struct pnp_dma * dma; 315 struct pnp_dma * dma;
316 dma = pnpbios_kmalloc(sizeof(struct pnp_dma), GFP_KERNEL); 316 dma = kcalloc(1, sizeof(struct pnp_dma), GFP_KERNEL);
317 if (!dma) 317 if (!dma)
318 return; 318 return;
319 dma->map = p[1]; 319 dma->map = p[1];
@@ -326,7 +326,7 @@ static void
326pnpbios_parse_port_option(unsigned char *p, int size, struct pnp_option *option) 326pnpbios_parse_port_option(unsigned char *p, int size, struct pnp_option *option)
327{ 327{
328 struct pnp_port * port; 328 struct pnp_port * port;
329 port = pnpbios_kmalloc(sizeof(struct pnp_port), GFP_KERNEL); 329 port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL);
330 if (!port) 330 if (!port)
331 return; 331 return;
332 port->min = (p[3] << 8) | p[2]; 332 port->min = (p[3] << 8) | p[2];
@@ -342,7 +342,7 @@ static void
342pnpbios_parse_fixed_port_option(unsigned char *p, int size, struct pnp_option *option) 342pnpbios_parse_fixed_port_option(unsigned char *p, int size, struct pnp_option *option)
343{ 343{
344 struct pnp_port * port; 344 struct pnp_port * port;
345 port = pnpbios_kmalloc(sizeof(struct pnp_port), GFP_KERNEL); 345 port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL);
346 if (!port) 346 if (!port)
347 return; 347 return;
348 port->min = port->max = (p[2] << 8) | p[1]; 348 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
530 case SMALL_TAG_COMPATDEVID: /* compatible ID */ 530 case SMALL_TAG_COMPATDEVID: /* compatible ID */
531 if (len != 4) 531 if (len != 4)
532 goto len_err; 532 goto len_err;
533 dev_id = pnpbios_kmalloc(sizeof (struct pnp_id), GFP_KERNEL); 533 dev_id = kcalloc(1, sizeof (struct pnp_id), GFP_KERNEL);
534 if (!dev_id) 534 if (!dev_id)
535 return NULL; 535 return NULL;
536 memset(dev_id, 0, sizeof(struct pnp_id)); 536 memset(dev_id, 0, sizeof(struct pnp_id));