mirror of https://github.com/thesofproject/sof.git
volume: replace switch by if for readability
MISRA C:2012, 16.5: Every switch statement shall have at least two switch-clauses Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
This commit is contained in:
parent
c3253e1d8f
commit
8f03c9ba0a
|
@ -476,18 +476,14 @@ static int volume_ctrl_get_cmd(struct comp_dev *dev, struct sof_ipc_ctrl_data *c
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (cdata->cmd) {
|
||||
case SOF_CTRL_CMD_VOLUME:
|
||||
|
||||
if (cdata->cmd == SOF_CTRL_CMD_VOLUME) {
|
||||
for (i = 0; i < cdata->num_elems; i++) {
|
||||
for (j = 0; j < cdata->num_elems; j++) {
|
||||
if (cdata->chanv[j].value == cd->chan[i])
|
||||
cdata->chanv[j].value = cd->tvolume[i];
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
} else {
|
||||
trace_volume_error("ec2");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue