diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-03-20 19:46:41 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-03-21 22:06:17 +0000 |
commit | d2a02b93cf78205dd23226efb66481569900976e (patch) | |
tree | 94760abdafe5cb72a41d3edd405a26d0c8e2e0d3 /arch/arm/common | |
parent | 18ec5c731271939acb414614e964c15c8ef52156 (diff) | |
download | talos-op-linux-d2a02b93cf78205dd23226efb66481569900976e.tar.gz talos-op-linux-d2a02b93cf78205dd23226efb66481569900976e.zip |
[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) struct locomo_dev *dev; int ret; - dev = kmalloc(sizeof(struct locomo_dev), GFP_KERNEL); + dev = kzalloc(sizeof(struct locomo_dev), GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto out; } - memset(dev, 0, sizeof(struct locomo_dev)); strncpy(dev->dev.bus_id,info->name,sizeof(dev->dev.bus_id)); /* @@ -664,12 +663,10 @@ __locomo_probe(struct device *me, struct resource *mem, int irq) unsigned long r; int i, ret = -ENODEV; - lchip = kmalloc(sizeof(struct locomo), GFP_KERNEL); + lchip = kzalloc(sizeof(struct locomo), GFP_KERNEL); if (!lchip) return -ENOMEM; - memset(lchip, 0, sizeof(struct locomo)); - spin_lock_init(&lchip->lock); 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, struct sa1111_dev *dev; int ret; - dev = kmalloc(sizeof(struct sa1111_dev), GFP_KERNEL); + dev = kzalloc(sizeof(struct sa1111_dev), GFP_KERNEL); if (!dev) { ret = -ENOMEM; goto out; } - memset(dev, 0, sizeof(struct sa1111_dev)); snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), "%4.4lx", info->offset); @@ -621,12 +620,10 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq) unsigned int has_devs, val; int i, ret = -ENODEV; - sachip = kmalloc(sizeof(struct sa1111), GFP_KERNEL); + sachip = kzalloc(sizeof(struct sa1111), GFP_KERNEL); if (!sachip) return -ENOMEM; - memset(sachip, 0, sizeof(struct sa1111)); - sachip->clk = clk_get(me, "GPIO27_CLK"); if (!sachip->clk) { 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) if (!mem) return -EINVAL; - devptr = kmalloc(sizeof(struct scoop_dev), GFP_KERNEL); - + devptr = kzalloc(sizeof(struct scoop_dev), GFP_KERNEL); if (!devptr) - return -ENOMEM; + return -ENOMEM; - memset(devptr, 0, sizeof(struct scoop_dev)); spin_lock_init(&devptr->scoop_lock); inf = pdev->dev.platform_data; |