From: Dan Carpenter <dan.carpenter@oracle.com>
To: lars@metafoo.de
Cc: alsa-devel@alsa-project.org
Subject: Re: ASoC: dapm: Simplify list creation in dapm_dai_get_connected_widgets()
Date: Tue, 4 Aug 2015 20:38:50 +0300 [thread overview]
Message-ID: <20150804173850.GA28511@mwanda> (raw)
Hello Lars-Peter Clausen,
The patch 1ce43acff0c0: "ASoC: dapm: Simplify list creation in
dapm_dai_get_connected_widgets()" from Jul 26, 2015, leads to the
following static checker warning:
sound/soc/soc-dapm.c:1199 snd_soc_dapm_dai_get_connected_widgets()
warn: inconsistent returns 'mutex:&card->dapm_mutex'.
Locked on: line 1194
Unlocked on: line 1199
sound/soc/soc-dapm.c
1164 int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
1165 struct snd_soc_dapm_widget_list **list)
1166 {
1167 struct snd_soc_card *card = dai->component->card;
1168 struct snd_soc_dapm_widget *w;
1169 LIST_HEAD(widgets);
1170 int paths;
1171 int ret;
1172
1173 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
1174
1175 /*
1176 * For is_connected_{output,input}_ep fully discover the graph we need
1177 * to reset the cached number of inputs and outputs.
1178 */
1179 list_for_each_entry(w, &card->widgets, list) {
1180 w->inputs = -1;
1181 w->outputs = -1;
1182 }
1183
1184 if (stream == SNDRV_PCM_STREAM_PLAYBACK)
1185 paths = is_connected_output_ep(dai->playback_widget, &widgets);
1186 else
1187 paths = is_connected_input_ep(dai->capture_widget, &widgets);
1188
1189 /* Drop starting point */
1190 list_del(widgets.next);
1191
1192 ret = dapm_widget_list_create(list, &widgets);
1193 if (ret)
1194 return ret;
^^^^^^^^^^^
Holding card->dapm_mutex.
1195
1196 trace_snd_soc_dapm_connected(paths, stream);
1197 mutex_unlock(&card->dapm_mutex);
1198
1199 return paths;
1200 }
regards,
dan carpenter
next reply other threads:[~2015-08-04 17:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 17:38 Dan Carpenter [this message]
2015-08-04 18:51 ` ASoC: dapm: Simplify list creation in dapm_dai_get_connected_widgets() Lars-Peter Clausen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150804173850.GA28511@mwanda \
--to=dan.carpenter@oracle.com \
--cc=alsa-devel@alsa-project.org \
--cc=lars@metafoo.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.