Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06f9c24e authored by Xiubo Li's avatar Xiubo Li Committed by Mark Brown
Browse files

regmap: cache: use kmalloc_array instead of kmalloc



This patch fixes checkpatch.pl warning for regmap cache.
WARNING : prefer kmalloc_array over kmalloc with multiply

Signed-off-by: default avatarXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent fbba43c5
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -61,7 +61,7 @@ static int regcache_hw_init(struct regmap *map)
		if (!regmap_volatile(map, i * map->reg_stride))
		if (!regmap_volatile(map, i * map->reg_stride))
			count++;
			count++;


	map->reg_defaults = kmalloc(count * sizeof(struct reg_default),
	map->reg_defaults = kmalloc_array(count, sizeof(struct reg_default),
					  GFP_KERNEL);
					  GFP_KERNEL);
	if (!map->reg_defaults) {
	if (!map->reg_defaults) {
		ret = -ENOMEM;
		ret = -ENOMEM;