summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2015-08-05 22:34:22 +0800
committerMark Brown <broonie@kernel.org>2015-08-06 12:35:15 +0100
commit4ca7deb1e15e0030d04051cf4285e88249ebe252 (patch)
tree6361859360aadbc05b35f65667089a5470f84a1b /sound
parentd770e558e21961ad6cfdf0ff7df0eb5d7d4f0754 (diff)
downloadop-kernel-dev-4ca7deb1e15e0030d04051cf4285e88249ebe252.zip
op-kernel-dev-4ca7deb1e15e0030d04051cf4285e88249ebe252.tar.gz
ASoC: topology: Use kcalloc instead of kzalloc for array allocation
Also remove unnecessary memset. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-topology.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index d096068..f038c6e 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1070,7 +1070,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create(
struct snd_soc_tplg_mixer_control *mc;
int i, err;
- kc = kzalloc(sizeof(*kc) * num_kcontrols, GFP_KERNEL);
+ kc = kcalloc(num_kcontrols, sizeof(*kc), GFP_KERNEL);
if (kc == NULL)
return NULL;
@@ -1251,7 +1251,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dbytes_create(
struct snd_kcontrol_new *kc;
int i, err;
- kc = kzalloc(sizeof(*kc) * count, GFP_KERNEL);
+ kc = kcalloc(count, sizeof(*kc), GFP_KERNEL);
if (!kc)
return NULL;
@@ -1274,7 +1274,6 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dbytes_create(
"ASoC: adding bytes kcontrol %s with access 0x%x\n",
be->hdr.name, be->hdr.access);
- memset(kc, 0, sizeof(*kc));
kc[i].name = be->hdr.name;
kc[i].private_value = (long)sbe;
kc[i].iface = SNDRV_CTL_ELEM_IFACE_MIXER;
OpenPOWER on IntegriCloud