ASoC: soc-dapm: cleanup cppcheck warning at dapm_new_dai_link()
This patch cleanups below cppcheck warning, and its related code. sound/soc/soc-dapm.c:1077:9: style: The scope of the variable 'ret' can be reduced. [variableScope] int i, ret; ^ Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87sfzou24s.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Родитель
a16cfb1bee
Коммит
5c52e48fb1
|
@ -1074,10 +1074,7 @@ static int dapm_new_pga(struct snd_soc_dapm_widget *w)
|
||||||
/* create new dapm dai link control */
|
/* create new dapm dai link control */
|
||||||
static int dapm_new_dai_link(struct snd_soc_dapm_widget *w)
|
static int dapm_new_dai_link(struct snd_soc_dapm_widget *w)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i;
|
||||||
struct snd_kcontrol *kcontrol;
|
|
||||||
struct snd_soc_dapm_context *dapm = w->dapm;
|
|
||||||
struct snd_card *card = dapm->card->snd_card;
|
|
||||||
struct snd_soc_pcm_runtime *rtd = w->priv;
|
struct snd_soc_pcm_runtime *rtd = w->priv;
|
||||||
|
|
||||||
/* create control for links with > 1 config */
|
/* create control for links with > 1 config */
|
||||||
|
@ -1086,9 +1083,12 @@ static int dapm_new_dai_link(struct snd_soc_dapm_widget *w)
|
||||||
|
|
||||||
/* add kcontrol */
|
/* add kcontrol */
|
||||||
for (i = 0; i < w->num_kcontrols; i++) {
|
for (i = 0; i < w->num_kcontrols; i++) {
|
||||||
kcontrol = snd_soc_cnew(&w->kcontrol_news[i], w,
|
struct snd_soc_dapm_context *dapm = w->dapm;
|
||||||
w->name, NULL);
|
struct snd_card *card = dapm->card->snd_card;
|
||||||
ret = snd_ctl_add(card, kcontrol);
|
struct snd_kcontrol *kcontrol = snd_soc_cnew(&w->kcontrol_news[i],
|
||||||
|
w, w->name, NULL);
|
||||||
|
int ret = snd_ctl_add(card, kcontrol);
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(dapm->dev,
|
dev_err(dapm->dev,
|
||||||
"ASoC: failed to add widget %s dapm kcontrol %s: %d\n",
|
"ASoC: failed to add widget %s dapm kcontrol %s: %d\n",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче