Skip to content

Commit eb19fd3

Browse files
committed
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 <cujomalainey@google.com>
1 parent 2a7a5d9 commit eb19fd3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

sound/soc/sof/topology.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,8 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
13461346

13471347
dev_dbg(sdev->dev, "tplg: ready widget id %d pipe %d type %d name : %s stream %s\n",
13481348
swidget->comp_id, index, swidget->id, tw->name,
1349-
tw->sname ? tw->sname : "none");
1349+
strnlen(tw->sname, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) > 0
1350+
? tw->sname : "none");
13501351

13511352
/* handle any special case widgets */
13521353
switch (w->id) {
@@ -1419,7 +1420,8 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
14191420
dev_err(sdev->dev,
14201421
"error: DSP failed to add widget id %d type %d name : %s stream %s reply %d\n",
14211422
tw->shift, swidget->id, tw->name,
1422-
tw->sname ? tw->sname : "none", reply.rhdr.error);
1423+
strnlen(tw->sname, SNDRV_CTL_ELEM_ID_NAME_MAXLEN) > 0
1424+
? tw->sname : "none", reply.rhdr.error);
14231425
kfree(swidget);
14241426
return ret;
14251427
}

0 commit comments

Comments
 (0)