Skip to content

Commit 8854144

Browse files
drvgithubuserbroonie
authored andcommitted
ASoC: imx-pcm-rpmsg: Remove unused variable
Variable ret is initialed but is never modified or used except for returning the initial value 0. The value can be directly returned instead and the variable definition can be dropped. Issue identified using returnvar.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent f7d00a9 commit 8854144

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sound/soc/fsl/imx-pcm-rpmsg.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ static int imx_rpmsg_pcm_hw_params(struct snd_soc_component *component,
140140
{
141141
struct rpmsg_info *info = dev_get_drvdata(component->dev);
142142
struct rpmsg_msg *msg;
143-
int ret = 0;
144143

145144
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
146145
msg = &info->msg[TX_HW_PARAM];
@@ -184,7 +183,7 @@ static int imx_rpmsg_pcm_hw_params(struct snd_soc_component *component,
184183

185184
info->send_message(msg, info);
186185

187-
return ret;
186+
return 0;
188187
}
189188

190189
static snd_pcm_uframes_t imx_rpmsg_pcm_pointer(struct snd_soc_component *component,
@@ -282,7 +281,6 @@ static int imx_rpmsg_pcm_close(struct snd_soc_component *component,
282281
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
283282
struct rpmsg_info *info = dev_get_drvdata(component->dev);
284283
struct rpmsg_msg *msg;
285-
int ret = 0;
286284

287285
/* Flush work in workqueue to make TX_CLOSE is the last message */
288286
flush_workqueue(info->rpmsg_wq);
@@ -305,7 +303,7 @@ static int imx_rpmsg_pcm_close(struct snd_soc_component *component,
305303
dev_warn(rtd->dev, "Msg is dropped!, number is %d\n",
306304
info->msg_drop_count[substream->stream]);
307305

308-
return ret;
306+
return 0;
309307
}
310308

311309
static int imx_rpmsg_pcm_prepare(struct snd_soc_component *component,

0 commit comments

Comments
 (0)