ASoC: dapm: harden use of lookup tables

To detect potential errors, let's add:

a) build-time warnings when the table size isn't aligned with the enum
list
b) run-time warnings when the values are not initialized. This
requires an increase by one of all values to avoid the default 0.

Suggested-by: Takashi Iwai <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
Pierre-Louis Bossart 2019-02-05 10:22:28 -06:00 • committed by Mark Brown
commit f13d4b5f85
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0
2 changed files with 85 additions and 76 deletions

View file

@ -523,6 +523,9 @@ enum snd_soc_dapm_type {
snd_soc_dapm_asrc, /* DSP/CODEC ASRC component */
snd_soc_dapm_encoder, /* FW/SW audio encoder component */
snd_soc_dapm_decoder, /* FW/SW audio decoder component */
/* Don't edit below this line */
SND_SOC_DAPM_TYPE_COUNT
};
enum snd_soc_dapm_subclass {