diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-03-20 14:46:41 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-03-21 17:06:17 -0500 |
commit | d2a02b93cf78205dd23226efb66481569900976e (patch) | |
tree | 94760abdafe5cb72a41d3edd405a26d0c8e2e0d3 /arch/arm/mach-integrator | |
parent | 18ec5c731271939acb414614e964c15c8ef52156 (diff) |
[ARM] Convert kmalloc+memset to kzalloc
Convert all uses of kmalloc followed by memset to use kzalloc instead.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-integrator')
-rw-r--r-- | arch/arm/mach-integrator/impd1.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-integrator/integrator_ap.c | 4 |
2 files changed, 3 insertions, 8 deletions
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index a85d471c5bfa..92d79fb39311 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c | |||
@@ -355,12 +355,11 @@ static int impd1_probe(struct lm_device *dev) | |||
355 | if (!request_mem_region(dev->resource.start, SZ_4K, "LM registers")) | 355 | if (!request_mem_region(dev->resource.start, SZ_4K, "LM registers")) |
356 | return -EBUSY; | 356 | return -EBUSY; |
357 | 357 | ||
358 | impd1 = kmalloc(sizeof(struct impd1_module), GFP_KERNEL); | 358 | impd1 = kzalloc(sizeof(struct impd1_module), GFP_KERNEL); |
359 | if (!impd1) { | 359 | if (!impd1) { |
360 | ret = -ENOMEM; | 360 | ret = -ENOMEM; |
361 | goto release_lm; | 361 | goto release_lm; |
362 | } | 362 | } |
363 | memset(impd1, 0, sizeof(struct impd1_module)); | ||
364 | 363 | ||
365 | impd1->base = ioremap(dev->resource.start, SZ_4K); | 364 | impd1->base = ioremap(dev->resource.start, SZ_4K); |
366 | if (!impd1->base) { | 365 | if (!impd1->base) { |
@@ -389,12 +388,10 @@ static int impd1_probe(struct lm_device *dev) | |||
389 | 388 | ||
390 | pc_base = dev->resource.start + idev->offset; | 389 | pc_base = dev->resource.start + idev->offset; |
391 | 390 | ||
392 | d = kmalloc(sizeof(struct amba_device), GFP_KERNEL); | 391 | d = kzalloc(sizeof(struct amba_device), GFP_KERNEL); |
393 | if (!d) | 392 | if (!d) |
394 | continue; | 393 | continue; |
395 | 394 | ||
396 | memset(d, 0, sizeof(struct amba_device)); | ||
397 | |||
398 | snprintf(d->dev.bus_id, sizeof(d->dev.bus_id), | 395 | snprintf(d->dev.bus_id, sizeof(d->dev.bus_id), |
399 | "lm%x:%5.5lx", dev->id, idev->offset >> 12); | 396 | "lm%x:%5.5lx", dev->id, idev->offset >> 12); |
400 | 397 | ||
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index d8d3c2a5a97e..6d65c96ebfd2 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
@@ -319,12 +319,10 @@ static void __init ap_init(void) | |||
319 | if ((sc_dec & (16 << i)) == 0) | 319 | if ((sc_dec & (16 << i)) == 0) |
320 | continue; | 320 | continue; |
321 | 321 | ||
322 | lmdev = kmalloc(sizeof(struct lm_device), GFP_KERNEL); | 322 | lmdev = kzalloc(sizeof(struct lm_device), GFP_KERNEL); |
323 | if (!lmdev) | 323 | if (!lmdev) |
324 | continue; | 324 | continue; |
325 | 325 | ||
326 | memset(lmdev, 0, sizeof(struct lm_device)); | ||
327 | |||
328 | lmdev->resource.start = 0xc0000000 + 0x10000000 * i; | 326 | lmdev->resource.start = 0xc0000000 + 0x10000000 * i; |
329 | lmdev->resource.end = lmdev->resource.start + 0x0fffffff; | 327 | lmdev->resource.end = lmdev->resource.start + 0x0fffffff; |
330 | lmdev->resource.flags = IORESOURCE_MEM; | 328 | lmdev->resource.flags = IORESOURCE_MEM; |