Skip to content

Commit 2ed526b

Browse files
charleskeepaxbroonie
authored andcommitted
ASoC: SDCA: Add missing default in switch in entity_pde_event()
The current code should be safe as the PDE widget only registers for the two events handled in the switch statement. However, it is causing a smatch warning and also is a little fragile to future code changes, add a default case to avoid the warning and make the code more robust. Fixes: 2c8b3a8 ("ASoC: SDCA: Create DAPM widgets and routes from DisCo") Reported-by: Dan Carpenter <[email protected]> Reviewed-by: Bard Liao <[email protected]> Signed-off-by: Charles Keepax <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 0383a71 commit 2ed526b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sound/soc/sdca/sdca_asoc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,8 @@ static int entity_pde_event(struct snd_soc_dapm_widget *widget,
397397
from = widget->off_val;
398398
to = widget->on_val;
399399
break;
400+
default:
401+
return 0;
400402
}
401403

402404
for (i = 0; i < entity->pde.num_max_delay; i++) {

0 commit comments

Comments
 (0)