diff options
author | Robert P. J. Day <rpjday@mindspring.com> | 2006-12-13 03:34:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:52 -0500 |
commit | cd86128088554d64fea1679191509f00e6353c5b (patch) | |
tree | a828960f4bd44ef1682d88618e58c6ccd2367bc1 /drivers/pnp/pnpbios | |
parent | 90aef12e6dd609e1ad7fb70044eedc78ca55ee5e (diff) |
[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 <rpjday@mindspring.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Greg KH <greg@kroah.com>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pnp/pnpbios')
-rw-r--r-- | drivers/pnp/pnpbios/core.c | 14 | ||||
-rw-r--r-- | drivers/pnp/pnpbios/proc.c | 8 | ||||
-rw-r--r-- | drivers/pnp/pnpbios/rsparser.c | 16 |
3 files changed, 19 insertions, 19 deletions
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c index 33adeba1a31f..b7fdb4d21a96 100644 --- a/drivers/pnp/pnpbios/core.c +++ b/drivers/pnp/pnpbios/core.c | |||
@@ -112,7 +112,7 @@ static int pnp_dock_event(int dock, struct pnp_docking_station_info *info) | |||
112 | if (!(envp = (char **) kcalloc (20, sizeof (char *), GFP_KERNEL))) { | 112 | if (!(envp = (char **) kcalloc (20, sizeof (char *), GFP_KERNEL))) { |
113 | return -ENOMEM; | 113 | return -ENOMEM; |
114 | } | 114 | } |
115 | if (!(buf = kcalloc (1, 256, GFP_KERNEL))) { | 115 | if (!(buf = kzalloc(256, GFP_KERNEL))) { |
116 | kfree (envp); | 116 | kfree (envp); |
117 | return -ENOMEM; | 117 | return -ENOMEM; |
118 | } | 118 | } |
@@ -220,7 +220,7 @@ static int pnpbios_get_resources(struct pnp_dev * dev, struct pnp_resource_table | |||
220 | if(!pnpbios_is_dynamic(dev)) | 220 | if(!pnpbios_is_dynamic(dev)) |
221 | return -EPERM; | 221 | return -EPERM; |
222 | 222 | ||
223 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); | 223 | node = kzalloc(node_info.max_node_size, GFP_KERNEL); |
224 | if (!node) | 224 | if (!node) |
225 | return -1; | 225 | return -1; |
226 | if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_DYNAMIC, node)) { | 226 | if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_DYNAMIC, node)) { |
@@ -243,7 +243,7 @@ static int pnpbios_set_resources(struct pnp_dev * dev, struct pnp_resource_table | |||
243 | if (!pnpbios_is_dynamic(dev)) | 243 | if (!pnpbios_is_dynamic(dev)) |
244 | return -EPERM; | 244 | return -EPERM; |
245 | 245 | ||
246 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); | 246 | node = kzalloc(node_info.max_node_size, GFP_KERNEL); |
247 | if (!node) | 247 | if (!node) |
248 | return -1; | 248 | return -1; |
249 | if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_DYNAMIC, node)) { | 249 | if (pnp_bios_get_dev_node(&nodenum, (char )PNPMODE_DYNAMIC, node)) { |
@@ -294,7 +294,7 @@ static int pnpbios_disable_resources(struct pnp_dev *dev) | |||
294 | if(dev->flags & PNPBIOS_NO_DISABLE || !pnpbios_is_dynamic(dev)) | 294 | if(dev->flags & PNPBIOS_NO_DISABLE || !pnpbios_is_dynamic(dev)) |
295 | return -EPERM; | 295 | return -EPERM; |
296 | 296 | ||
297 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); | 297 | node = kzalloc(node_info.max_node_size, GFP_KERNEL); |
298 | if (!node) | 298 | if (!node) |
299 | return -ENOMEM; | 299 | return -ENOMEM; |
300 | 300 | ||
@@ -336,7 +336,7 @@ static int insert_device(struct pnp_dev *dev, struct pnp_bios_node * node) | |||
336 | } | 336 | } |
337 | 337 | ||
338 | /* set the initial values for the PnP device */ | 338 | /* set the initial values for the PnP device */ |
339 | dev_id = kcalloc(1, sizeof(struct pnp_id), GFP_KERNEL); | 339 | dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL); |
340 | if (!dev_id) | 340 | if (!dev_id) |
341 | return -1; | 341 | return -1; |
342 | pnpid32_to_pnpid(node->eisa_id,id); | 342 | pnpid32_to_pnpid(node->eisa_id,id); |
@@ -374,7 +374,7 @@ static void __init build_devlist(void) | |||
374 | struct pnp_bios_node *node; | 374 | struct pnp_bios_node *node; |
375 | struct pnp_dev *dev; | 375 | struct pnp_dev *dev; |
376 | 376 | ||
377 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); | 377 | node = kzalloc(node_info.max_node_size, GFP_KERNEL); |
378 | if (!node) | 378 | if (!node) |
379 | return; | 379 | return; |
380 | 380 | ||
@@ -391,7 +391,7 @@ static void __init build_devlist(void) | |||
391 | break; | 391 | break; |
392 | } | 392 | } |
393 | nodes_got++; | 393 | nodes_got++; |
394 | dev = kcalloc(1, sizeof (struct pnp_dev), GFP_KERNEL); | 394 | dev = kzalloc(sizeof (struct pnp_dev), GFP_KERNEL); |
395 | if (!dev) | 395 | if (!dev) |
396 | break; | 396 | break; |
397 | if(insert_device(dev,node)<0) | 397 | if(insert_device(dev,node)<0) |
diff --git a/drivers/pnp/pnpbios/proc.c b/drivers/pnp/pnpbios/proc.c index 5a3dfc97f5e9..8027073f7919 100644 --- a/drivers/pnp/pnpbios/proc.c +++ b/drivers/pnp/pnpbios/proc.c | |||
@@ -87,7 +87,7 @@ static int proc_read_escd(char *buf, char **start, off_t pos, | |||
87 | return -EFBIG; | 87 | return -EFBIG; |
88 | } | 88 | } |
89 | 89 | ||
90 | tmpbuf = kcalloc(1, escd.escd_size, GFP_KERNEL); | 90 | tmpbuf = kzalloc(escd.escd_size, GFP_KERNEL); |
91 | if (!tmpbuf) return -ENOMEM; | 91 | if (!tmpbuf) return -ENOMEM; |
92 | 92 | ||
93 | if (pnp_bios_read_escd(tmpbuf, escd.nv_storage_base)) { | 93 | if (pnp_bios_read_escd(tmpbuf, escd.nv_storage_base)) { |
@@ -133,7 +133,7 @@ static int proc_read_devices(char *buf, char **start, off_t pos, | |||
133 | if (pos >= 0xff) | 133 | if (pos >= 0xff) |
134 | return 0; | 134 | return 0; |
135 | 135 | ||
136 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); | 136 | node = kzalloc(node_info.max_node_size, GFP_KERNEL); |
137 | if (!node) return -ENOMEM; | 137 | if (!node) return -ENOMEM; |
138 | 138 | ||
139 | for (nodenum=pos; nodenum<0xff; ) { | 139 | for (nodenum=pos; nodenum<0xff; ) { |
@@ -168,7 +168,7 @@ static int proc_read_node(char *buf, char **start, off_t pos, | |||
168 | u8 nodenum = (long)data; | 168 | u8 nodenum = (long)data; |
169 | int len; | 169 | int len; |
170 | 170 | ||
171 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); | 171 | node = kzalloc(node_info.max_node_size, GFP_KERNEL); |
172 | if (!node) return -ENOMEM; | 172 | if (!node) return -ENOMEM; |
173 | if (pnp_bios_get_dev_node(&nodenum, boot, node)) { | 173 | if (pnp_bios_get_dev_node(&nodenum, boot, node)) { |
174 | kfree(node); | 174 | kfree(node); |
@@ -188,7 +188,7 @@ static int proc_write_node(struct file *file, const char __user *buf, | |||
188 | u8 nodenum = (long)data; | 188 | u8 nodenum = (long)data; |
189 | int ret = count; | 189 | int ret = count; |
190 | 190 | ||
191 | node = kcalloc(1, node_info.max_node_size, GFP_KERNEL); | 191 | node = kzalloc(node_info.max_node_size, GFP_KERNEL); |
192 | if (!node) | 192 | if (!node) |
193 | return -ENOMEM; | 193 | return -ENOMEM; |
194 | if (pnp_bios_get_dev_node(&nodenum, boot, node)) { | 194 | if (pnp_bios_get_dev_node(&nodenum, boot, node)) { |
diff --git a/drivers/pnp/pnpbios/rsparser.c b/drivers/pnp/pnpbios/rsparser.c index ef508a4de557..95b79685a9d1 100644 --- a/drivers/pnp/pnpbios/rsparser.c +++ b/drivers/pnp/pnpbios/rsparser.c | |||
@@ -248,7 +248,7 @@ static void | |||
248 | pnpbios_parse_mem_option(unsigned char *p, int size, struct pnp_option *option) | 248 | pnpbios_parse_mem_option(unsigned char *p, int size, struct pnp_option *option) |
249 | { | 249 | { |
250 | struct pnp_mem * mem; | 250 | struct pnp_mem * mem; |
251 | mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); | 251 | mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL); |
252 | if (!mem) | 252 | if (!mem) |
253 | return; | 253 | return; |
254 | mem->min = ((p[5] << 8) | p[4]) << 8; | 254 | mem->min = ((p[5] << 8) | p[4]) << 8; |
@@ -264,7 +264,7 @@ static void | |||
264 | pnpbios_parse_mem32_option(unsigned char *p, int size, struct pnp_option *option) | 264 | pnpbios_parse_mem32_option(unsigned char *p, int size, struct pnp_option *option) |
265 | { | 265 | { |
266 | struct pnp_mem * mem; | 266 | struct pnp_mem * mem; |
267 | mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); | 267 | mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL); |
268 | if (!mem) | 268 | if (!mem) |
269 | return; | 269 | return; |
270 | mem->min = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; | 270 | mem->min = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; |
@@ -280,7 +280,7 @@ static void | |||
280 | pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, struct pnp_option *option) | 280 | pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, struct pnp_option *option) |
281 | { | 281 | { |
282 | struct pnp_mem * mem; | 282 | struct pnp_mem * mem; |
283 | mem = kcalloc(1, sizeof(struct pnp_mem), GFP_KERNEL); | 283 | mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL); |
284 | if (!mem) | 284 | if (!mem) |
285 | return; | 285 | return; |
286 | mem->min = mem->max = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; | 286 | mem->min = mem->max = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4]; |
@@ -297,7 +297,7 @@ pnpbios_parse_irq_option(unsigned char *p, int size, struct pnp_option *option) | |||
297 | struct pnp_irq * irq; | 297 | struct pnp_irq * irq; |
298 | unsigned long bits; | 298 | unsigned long bits; |
299 | 299 | ||
300 | irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL); | 300 | irq = kzalloc(sizeof(struct pnp_irq), GFP_KERNEL); |
301 | if (!irq) | 301 | if (!irq) |
302 | return; | 302 | return; |
303 | bits = (p[2] << 8) | p[1]; | 303 | bits = (p[2] << 8) | p[1]; |
@@ -314,7 +314,7 @@ static void | |||
314 | pnpbios_parse_dma_option(unsigned char *p, int size, struct pnp_option *option) | 314 | pnpbios_parse_dma_option(unsigned char *p, int size, struct pnp_option *option) |
315 | { | 315 | { |
316 | struct pnp_dma * dma; | 316 | struct pnp_dma * dma; |
317 | dma = kcalloc(1, sizeof(struct pnp_dma), GFP_KERNEL); | 317 | dma = kzalloc(sizeof(struct pnp_dma), GFP_KERNEL); |
318 | if (!dma) | 318 | if (!dma) |
319 | return; | 319 | return; |
320 | dma->map = p[1]; | 320 | dma->map = p[1]; |
@@ -327,7 +327,7 @@ static void | |||
327 | pnpbios_parse_port_option(unsigned char *p, int size, struct pnp_option *option) | 327 | pnpbios_parse_port_option(unsigned char *p, int size, struct pnp_option *option) |
328 | { | 328 | { |
329 | struct pnp_port * port; | 329 | struct pnp_port * port; |
330 | port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); | 330 | port = kzalloc(sizeof(struct pnp_port), GFP_KERNEL); |
331 | if (!port) | 331 | if (!port) |
332 | return; | 332 | return; |
333 | port->min = (p[3] << 8) | p[2]; | 333 | port->min = (p[3] << 8) | p[2]; |
@@ -343,7 +343,7 @@ static void | |||
343 | pnpbios_parse_fixed_port_option(unsigned char *p, int size, struct pnp_option *option) | 343 | pnpbios_parse_fixed_port_option(unsigned char *p, int size, struct pnp_option *option) |
344 | { | 344 | { |
345 | struct pnp_port * port; | 345 | struct pnp_port * port; |
346 | port = kcalloc(1, sizeof(struct pnp_port), GFP_KERNEL); | 346 | port = kzalloc(sizeof(struct pnp_port), GFP_KERNEL); |
347 | if (!port) | 347 | if (!port) |
348 | return; | 348 | return; |
349 | port->min = port->max = (p[2] << 8) | p[1]; | 349 | port->min = port->max = (p[2] << 8) | p[1]; |
@@ -527,7 +527,7 @@ pnpbios_parse_compatible_ids(unsigned char *p, unsigned char *end, struct pnp_de | |||
527 | case SMALL_TAG_COMPATDEVID: /* compatible ID */ | 527 | case SMALL_TAG_COMPATDEVID: /* compatible ID */ |
528 | if (len != 4) | 528 | if (len != 4) |
529 | goto len_err; | 529 | goto len_err; |
530 | dev_id = kcalloc(1, sizeof (struct pnp_id), GFP_KERNEL); | 530 | dev_id = kzalloc(sizeof (struct pnp_id), GFP_KERNEL); |
531 | if (!dev_id) | 531 | if (!dev_id) |
532 | return NULL; | 532 | return NULL; |
533 | memset(dev_id, 0, sizeof(struct pnp_id)); | 533 | memset(dev_id, 0, sizeof(struct pnp_id)); |