From eb19fd36c58d98d39342d27913504097fd9c12ee Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Tue, 14 Aug 2018 18:35:02 -0700 Subject: [PATCH] Remove always true condition in msgs Clang was catching that since the char buffer was part of the struct this will always result in true. Change-Id: Ice25db4baa16ac2cf2118ba1efaa4af89081bc80 Signed-off-by: Curtis Malainey --- sound/soc/sof/topology.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 6b843d935d0926..e5e6399b3987f0 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -1346,7 +1346,8 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, dev_dbg(sdev->dev, "tplg: ready widget id %d pipe %d type %d name : %s stream %s\n", swidget->comp_id, index, swidget->id, tw->name, - tw->sname ? tw->sname : "none"); + strnlen(tw->sname, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) > 0 + ? tw->sname : "none"); /* handle any special case widgets */ switch (w->id) { @@ -1419,7 +1420,8 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, dev_err(sdev->dev, "error: DSP failed to add widget id %d type %d name : %s stream %s reply %d\n", tw->shift, swidget->id, tw->name, - tw->sname ? tw->sname : "none", reply.rhdr.error); + strnlen(tw->sname, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) > 0 + ? tw->sname : "none", reply.rhdr.error); kfree(swidget); return ret; }