Skip to content

Commit c184826

Browse files
committed
ASoC: SDCA: Add missing default in switch in entity_pde_event()
JIRA: https://issues.redhat.com/browse/RHEL-101627 commit 2ed526b Author: Charles Keepax <ckeepax@opensource.cirrus.com> Date: Tue Jun 24 13:28:39 2025 +0100 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 <dan.carpenter@linaro.org> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev> Link: https://patch.msgid.link/20250624122844.2761627-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
1 parent b908999 commit c184826

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)