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:
Pierre-Louis Bossart 2017-09-25 14:52:14 -05:00 committed by Liam Girdwood
parent c3253e1d8f
commit 8f03c9ba0a
1 changed files with 2 additions and 6 deletions

View File

@ -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;
}