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/common | |
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/common')
-rw-r--r-- | arch/arm/common/locomo.c | 7 | ||||
-rw-r--r-- | arch/arm/common/sa1111.c | 7 | ||||
-rw-r--r-- | arch/arm/common/scoop.c | 6 |
3 files changed, 6 insertions, 14 deletions
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 787e0d027f04..a7dc1370695b 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c | |||
@@ -501,12 +501,11 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info) | |||
501 | struct locomo_dev *dev; | 501 | struct locomo_dev *dev; |
502 | int ret; | 502 | int ret; |
503 | 503 | ||
504 | dev = kmalloc(sizeof(struct locomo_dev), GFP_KERNEL); | 504 | dev = kzalloc(sizeof(struct locomo_dev), GFP_KERNEL); |
505 | if (!dev) { | 505 | if (!dev) { |
506 | ret = -ENOMEM; | 506 | ret = -ENOMEM; |
507 | goto out; | 507 | goto out; |
508 | } | 508 | } |
509 | memset(dev, 0, sizeof(struct locomo_dev)); | ||
510 | 509 | ||
511 | strncpy(dev->dev.bus_id,info->name,sizeof(dev->dev.bus_id)); | 510 | strncpy(dev->dev.bus_id,info->name,sizeof(dev->dev.bus_id)); |
512 | /* | 511 | /* |
@@ -664,12 +663,10 @@ __locomo_probe(struct device *me, struct resource *mem, int irq) | |||
664 | unsigned long r; | 663 | unsigned long r; |
665 | int i, ret = -ENODEV; | 664 | int i, ret = -ENODEV; |
666 | 665 | ||
667 | lchip = kmalloc(sizeof(struct locomo), GFP_KERNEL); | 666 | lchip = kzalloc(sizeof(struct locomo), GFP_KERNEL); |
668 | if (!lchip) | 667 | if (!lchip) |
669 | return -ENOMEM; | 668 | return -ENOMEM; |
670 | 669 | ||
671 | memset(lchip, 0, sizeof(struct locomo)); | ||
672 | |||
673 | spin_lock_init(&lchip->lock); | 670 | spin_lock_init(&lchip->lock); |
674 | 671 | ||
675 | lchip->dev = me; | 672 | lchip->dev = me; |
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 5ba1ee042349..3f68db84e5e6 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c | |||
@@ -541,12 +541,11 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent, | |||
541 | struct sa1111_dev *dev; | 541 | struct sa1111_dev *dev; |
542 | int ret; | 542 | int ret; |
543 | 543 | ||
544 | dev = kmalloc(sizeof(struct sa1111_dev), GFP_KERNEL); | 544 | dev = kzalloc(sizeof(struct sa1111_dev), GFP_KERNEL); |
545 | if (!dev) { | 545 | if (!dev) { |
546 | ret = -ENOMEM; | 546 | ret = -ENOMEM; |
547 | goto out; | 547 | goto out; |
548 | } | 548 | } |
549 | memset(dev, 0, sizeof(struct sa1111_dev)); | ||
550 | 549 | ||
551 | snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), | 550 | snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), |
552 | "%4.4lx", info->offset); | 551 | "%4.4lx", info->offset); |
@@ -621,12 +620,10 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq) | |||
621 | unsigned int has_devs, val; | 620 | unsigned int has_devs, val; |
622 | int i, ret = -ENODEV; | 621 | int i, ret = -ENODEV; |
623 | 622 | ||
624 | sachip = kmalloc(sizeof(struct sa1111), GFP_KERNEL); | 623 | sachip = kzalloc(sizeof(struct sa1111), GFP_KERNEL); |
625 | if (!sachip) | 624 | if (!sachip) |
626 | return -ENOMEM; | 625 | return -ENOMEM; |
627 | 626 | ||
628 | memset(sachip, 0, sizeof(struct sa1111)); | ||
629 | |||
630 | sachip->clk = clk_get(me, "GPIO27_CLK"); | 627 | sachip->clk = clk_get(me, "GPIO27_CLK"); |
631 | if (!sachip->clk) { | 628 | if (!sachip->clk) { |
632 | ret = PTR_ERR(sachip->clk); | 629 | ret = PTR_ERR(sachip->clk); |
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c index a2dfe0b0f1ec..5e830f444c6c 100644 --- a/arch/arm/common/scoop.c +++ b/arch/arm/common/scoop.c | |||
@@ -132,12 +132,10 @@ int __init scoop_probe(struct platform_device *pdev) | |||
132 | if (!mem) | 132 | if (!mem) |
133 | return -EINVAL; | 133 | return -EINVAL; |
134 | 134 | ||
135 | devptr = kmalloc(sizeof(struct scoop_dev), GFP_KERNEL); | 135 | devptr = kzalloc(sizeof(struct scoop_dev), GFP_KERNEL); |
136 | |||
137 | if (!devptr) | 136 | if (!devptr) |
138 | return -ENOMEM; | 137 | return -ENOMEM; |
139 | 138 | ||
140 | memset(devptr, 0, sizeof(struct scoop_dev)); | ||
141 | spin_lock_init(&devptr->scoop_lock); | 139 | spin_lock_init(&devptr->scoop_lock); |
142 | 140 | ||
143 | inf = pdev->dev.platform_data; | 141 | inf = pdev->dev.platform_data; |