diff options
author | lixiubo <lixiubo@cmss.chinamobile.com> | 2015-11-20 11:06:30 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-11-20 13:27:59 +0100 |
commit | 549e08a0a93442ab62e0aee8aeb8ae6a7f2b5273 (patch) | |
tree | 9bf090c5b8126d10c939fbc3ed8070858d22c951 /drivers/base/regmap/regmap-irq.c | |
parent | regmap: replace kzalloc with kcalloc (diff) | |
download | linux-549e08a0a93442ab62e0aee8aeb8ae6a7f2b5273.tar.xz linux-549e08a0a93442ab62e0aee8aeb8ae6a7f2b5273.zip |
regmap: replace kmalloc with kmalloc_array
Replace kmalloc with specialized function kmalloc_array when the size
is a multiplication of : number * size
Signed-off-by: lixiubo <lixiubo@cmss.chinamobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/base/regmap/regmap-irq.c')
-rw-r--r-- | drivers/base/regmap/regmap-irq.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c index 4ebbe21ded82..4d2cb21254aa 100644 --- a/drivers/base/regmap/regmap-irq.c +++ b/drivers/base/regmap/regmap-irq.c @@ -422,8 +422,9 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, if (!map->use_single_read && map->reg_stride == 1 && d->irq_reg_stride == 1) { - d->status_reg_buf = kmalloc(map->format.val_bytes * - chip->num_regs, GFP_KERNEL); + d->status_reg_buf = kmalloc_array(chip->num_regs, + map->format.val_bytes, + GFP_KERNEL); if (!d->status_reg_buf) goto err_alloc; } |