All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 000/102 - chunk#3] Actually fix wrong enum items
@ 2014-02-18 11:36 Takashi Iwai
  2014-02-18 11:36 ` [PATCH 017/102] ASoC: sta32x: Fix array access overflow Takashi Iwai
                   ` (11 more replies)
  0 siblings, 12 replies; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:36 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

Now, this patch chunk fixes the actual bugs in various codec drivers
that have either off-by-one number of items or lead to array overflow.

sta32x is the latter one, and this can be picked up for 3.14, too.

The other off-by-one fixes would change the driver behavior (now user
will see more items), thus they are potential regression risks
although the "fixes" are correct, per se.


Takashi

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 017/102] ASoC: sta32x: Fix array access overflow
  2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
@ 2014-02-18 11:36 ` Takashi Iwai
  2014-02-19 16:46   ` Mark Brown
  2014-02-18 11:36 ` [PATCH 018/102] ASoC: ad1980: Fix wrong number of items for capture source Takashi Iwai
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:36 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

Preset EQ enum of sta32x codec driver declares too many number of
items and it may lead to the access over the actual array size.

Use SOC_ENUM_SINGLE_DECL() helper and it's automatically fixed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/sta32x.c | 72 +++++++++++++++++++++++------------------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
index 06edb396e733..42c5b458b046 100644
--- a/sound/soc/codecs/sta32x.c
+++ b/sound/soc/codecs/sta32x.c
@@ -187,42 +187,42 @@ static const unsigned int sta32x_limiter_drc_release_tlv[] = {
 	13, 16, TLV_DB_SCALE_ITEM(-1500, 300, 0),
 };
 
-static const struct soc_enum sta32x_drc_ac_enum =
-	SOC_ENUM_SINGLE(STA32X_CONFD, STA32X_CONFD_DRC_SHIFT,
-			2, sta32x_drc_ac);
-static const struct soc_enum sta32x_auto_eq_enum =
-	SOC_ENUM_SINGLE(STA32X_AUTO1, STA32X_AUTO1_AMEQ_SHIFT,
-			3, sta32x_auto_eq_mode);
-static const struct soc_enum sta32x_auto_gc_enum =
-	SOC_ENUM_SINGLE(STA32X_AUTO1, STA32X_AUTO1_AMGC_SHIFT,
-			4, sta32x_auto_gc_mode);
-static const struct soc_enum sta32x_auto_xo_enum =
-	SOC_ENUM_SINGLE(STA32X_AUTO2, STA32X_AUTO2_XO_SHIFT,
-			16, sta32x_auto_xo_mode);
-static const struct soc_enum sta32x_preset_eq_enum =
-	SOC_ENUM_SINGLE(STA32X_AUTO3, STA32X_AUTO3_PEQ_SHIFT,
-			32, sta32x_preset_eq_mode);
-static const struct soc_enum sta32x_limiter_ch1_enum =
-	SOC_ENUM_SINGLE(STA32X_C1CFG, STA32X_CxCFG_LS_SHIFT,
-			3, sta32x_limiter_select);
-static const struct soc_enum sta32x_limiter_ch2_enum =
-	SOC_ENUM_SINGLE(STA32X_C2CFG, STA32X_CxCFG_LS_SHIFT,
-			3, sta32x_limiter_select);
-static const struct soc_enum sta32x_limiter_ch3_enum =
-	SOC_ENUM_SINGLE(STA32X_C3CFG, STA32X_CxCFG_LS_SHIFT,
-			3, sta32x_limiter_select);
-static const struct soc_enum sta32x_limiter1_attack_rate_enum =
-	SOC_ENUM_SINGLE(STA32X_L1AR, STA32X_LxA_SHIFT,
-			16, sta32x_limiter_attack_rate);
-static const struct soc_enum sta32x_limiter2_attack_rate_enum =
-	SOC_ENUM_SINGLE(STA32X_L2AR, STA32X_LxA_SHIFT,
-			16, sta32x_limiter_attack_rate);
-static const struct soc_enum sta32x_limiter1_release_rate_enum =
-	SOC_ENUM_SINGLE(STA32X_L1AR, STA32X_LxR_SHIFT,
-			16, sta32x_limiter_release_rate);
-static const struct soc_enum sta32x_limiter2_release_rate_enum =
-	SOC_ENUM_SINGLE(STA32X_L2AR, STA32X_LxR_SHIFT,
-			16, sta32x_limiter_release_rate);
+static SOC_ENUM_SINGLE_DECL(sta32x_drc_ac_enum,
+			    STA32X_CONFD, STA32X_CONFD_DRC_SHIFT,
+			    sta32x_drc_ac);
+static SOC_ENUM_SINGLE_DECL(sta32x_auto_eq_enum,
+			    STA32X_AUTO1, STA32X_AUTO1_AMEQ_SHIFT,
+			    sta32x_auto_eq_mode);
+static SOC_ENUM_SINGLE_DECL(sta32x_auto_gc_enum,
+			    STA32X_AUTO1, STA32X_AUTO1_AMGC_SHIFT,
+			    sta32x_auto_gc_mode);
+static SOC_ENUM_SINGLE_DECL(sta32x_auto_xo_enum,
+			    STA32X_AUTO2, STA32X_AUTO2_XO_SHIFT,
+			    sta32x_auto_xo_mode);
+static SOC_ENUM_SINGLE_DECL(sta32x_preset_eq_enum,
+			    STA32X_AUTO3, STA32X_AUTO3_PEQ_SHIFT,
+			    sta32x_preset_eq_mode);
+static SOC_ENUM_SINGLE_DECL(sta32x_limiter_ch1_enum,
+			    STA32X_C1CFG, STA32X_CxCFG_LS_SHIFT,
+			    sta32x_limiter_select);
+static SOC_ENUM_SINGLE_DECL(sta32x_limiter_ch2_enum,
+			    STA32X_C2CFG, STA32X_CxCFG_LS_SHIFT,
+			    sta32x_limiter_select);
+static SOC_ENUM_SINGLE_DECL(sta32x_limiter_ch3_enum,
+			    STA32X_C3CFG, STA32X_CxCFG_LS_SHIFT,
+			    sta32x_limiter_select);
+static SOC_ENUM_SINGLE_DECL(sta32x_limiter1_attack_rate_enum,
+			    STA32X_L1AR, STA32X_LxA_SHIFT,
+			    sta32x_limiter_attack_rate);
+static SOC_ENUM_SINGLE_DECL(sta32x_limiter2_attack_rate_enum,
+			    STA32X_L2AR, STA32X_LxA_SHIFT,
+			    sta32x_limiter_attack_rate);
+static SOC_ENUM_SINGLE_DECL(sta32x_limiter1_release_rate_enum,
+			    STA32X_L1AR, STA32X_LxR_SHIFT,
+			    sta32x_limiter_release_rate);
+static SOC_ENUM_SINGLE_DECL(sta32x_limiter2_release_rate_enum,
+			    STA32X_L2AR, STA32X_LxR_SHIFT,
+			    sta32x_limiter_release_rate);
 
 /* byte array controls for setting biquad, mixer, scaling coefficients;
  * for biquads all five coefficients need to be set in one go,
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 018/102] ASoC: ad1980: Fix wrong number of items for capture source
  2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
  2014-02-18 11:36 ` [PATCH 017/102] ASoC: sta32x: Fix array access overflow Takashi Iwai
@ 2014-02-18 11:36 ` Takashi Iwai
  2014-02-19 16:50   ` Mark Brown
  2014-02-18 11:36 ` [PATCH 019/102] ASoC: arizona: Fix wrong number of items in enum ctls Takashi Iwai
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:36 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

The number of capture sources is 8, not 7.
Use SOC_ENUM_DOUBLE_DECL() macro and it's automatically fixed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/ad1980.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/ad1980.c b/sound/soc/codecs/ad1980.c
index 7257a8885f42..34d965a4a040 100644
--- a/sound/soc/codecs/ad1980.c
+++ b/sound/soc/codecs/ad1980.c
@@ -57,8 +57,8 @@ static const u16 ad1980_reg[] = {
 static const char *ad1980_rec_sel[] = {"Mic", "CD", "NC", "AUX", "Line",
 		"Stereo Mix", "Mono Mix", "Phone"};
 
-static const struct soc_enum ad1980_cap_src =
-	SOC_ENUM_DOUBLE(AC97_REC_SEL, 8, 0, 7, ad1980_rec_sel);
+static SOC_ENUM_DOUBLE_DECL(ad1980_cap_src,
+			    AC97_REC_SEL, 8, 0, ad1980_rec_sel);
 
 static const struct snd_kcontrol_new ad1980_snd_ac97_controls[] = {
 SOC_DOUBLE("Master Playback Volume", AC97_MASTER, 8, 0, 31, 1),
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 019/102] ASoC: arizona: Fix wrong number of items in enum ctls
  2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
  2014-02-18 11:36 ` [PATCH 017/102] ASoC: sta32x: Fix array access overflow Takashi Iwai
  2014-02-18 11:36 ` [PATCH 018/102] ASoC: ad1980: Fix wrong number of items for capture source Takashi Iwai
@ 2014-02-18 11:36 ` Takashi Iwai
  2014-02-18 11:54   ` Takashi Iwai
  2014-02-20  1:58   ` Mark Brown
  2014-02-18 11:36 ` [PATCH 020/102] ASoC: isabelle: Fix the " Takashi Iwai
                   ` (8 subsequent siblings)
  11 siblings, 2 replies; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:36 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

arizona codec driver has a few places wrongly defining the number of
enum items.

Use SOC_ENUM_SINGLE_DECL() macro and they are automatically fixed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/arizona.c | 71 ++++++++++++++++++++++++++--------------------
 1 file changed, 40 insertions(+), 31 deletions(-)

diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index e4295fee8f13..a32b84ac03f6 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -542,67 +542,76 @@ static const char *arizona_vol_ramp_text[] = {
 	"15ms/6dB", "30ms/6dB",
 };
 
-const struct soc_enum arizona_in_vd_ramp =
-	SOC_ENUM_SINGLE(ARIZONA_INPUT_VOLUME_RAMP,
-			ARIZONA_IN_VD_RAMP_SHIFT, 7, arizona_vol_ramp_text);
+SOC_ENUM_SINGLE_DECL(arizona_in_vd_ramp,
+		     ARIZONA_INPUT_VOLUME_RAMP,
+		     ARIZONA_IN_VD_RAMP_SHIFT,
+		     arizona_vol_ramp_text);
 EXPORT_SYMBOL_GPL(arizona_in_vd_ramp);
 
-const struct soc_enum arizona_in_vi_ramp =
-	SOC_ENUM_SINGLE(ARIZONA_INPUT_VOLUME_RAMP,
-			ARIZONA_IN_VI_RAMP_SHIFT, 7, arizona_vol_ramp_text);
+SOC_ENUM_SINGLE_DECL(arizona_in_vi_ramp,
+		     ARIZONA_INPUT_VOLUME_RAMP,
+		     ARIZONA_IN_VI_RAMP_SHIFT,
+		     arizona_vol_ramp_text);
 EXPORT_SYMBOL_GPL(arizona_in_vi_ramp);
 
-const struct soc_enum arizona_out_vd_ramp =
-	SOC_ENUM_SINGLE(ARIZONA_OUTPUT_VOLUME_RAMP,
-			ARIZONA_OUT_VD_RAMP_SHIFT, 7, arizona_vol_ramp_text);
+SOC_ENUM_SINGLE_DECL(arizona_out_vd_ramp,
+		     ARIZONA_OUTPUT_VOLUME_RAMP,
+		     ARIZONA_OUT_VD_RAMP_SHIFT,
+		     arizona_vol_ramp_text);
 EXPORT_SYMBOL_GPL(arizona_out_vd_ramp);
 
-const struct soc_enum arizona_out_vi_ramp =
-	SOC_ENUM_SINGLE(ARIZONA_OUTPUT_VOLUME_RAMP,
-			ARIZONA_OUT_VI_RAMP_SHIFT, 7, arizona_vol_ramp_text);
+SOC_ENUM_SINGLE_DECL(arizona_out_vi_ramp,
+		     ARIZONA_OUTPUT_VOLUME_RAMP,
+		     ARIZONA_OUT_VI_RAMP_SHIFT,
+		     arizona_vol_ramp_text);
 EXPORT_SYMBOL_GPL(arizona_out_vi_ramp);
 
 static const char *arizona_lhpf_mode_text[] = {
 	"Low-pass", "High-pass"
 };
 
-const struct soc_enum arizona_lhpf1_mode =
-	SOC_ENUM_SINGLE(ARIZONA_HPLPF1_1, ARIZONA_LHPF1_MODE_SHIFT, 2,
-			arizona_lhpf_mode_text);
+SOC_ENUM_SINGLE_DECL(arizona_lhpf1_mode,
+		     ARIZONA_HPLPF1_1,
+		     ARIZONA_LHPF1_MODE_SHIFT,
+		     arizona_lhpf_mode_text);
 EXPORT_SYMBOL_GPL(arizona_lhpf1_mode);
 
-const struct soc_enum arizona_lhpf2_mode =
-	SOC_ENUM_SINGLE(ARIZONA_HPLPF2_1, ARIZONA_LHPF2_MODE_SHIFT, 2,
-			arizona_lhpf_mode_text);
+SOC_ENUM_SINGLE_DECL(arizona_lhpf2_mode,
+		     ARIZONA_HPLPF2_1,
+		     ARIZONA_LHPF2_MODE_SHIFT,
+		     arizona_lhpf_mode_text);
 EXPORT_SYMBOL_GPL(arizona_lhpf2_mode);
 
-const struct soc_enum arizona_lhpf3_mode =
-	SOC_ENUM_SINGLE(ARIZONA_HPLPF3_1, ARIZONA_LHPF3_MODE_SHIFT, 2,
-			arizona_lhpf_mode_text);
+SOC_ENUM_SINGLE_DECL(arizona_lhpf3_mode,
+		     ARIZONA_HPLPF3_1,
+		     ARIZONA_LHPF3_MODE_SHIFT,
+		     arizona_lhpf_mode_text);
 EXPORT_SYMBOL_GPL(arizona_lhpf3_mode);
 
-const struct soc_enum arizona_lhpf4_mode =
-	SOC_ENUM_SINGLE(ARIZONA_HPLPF4_1, ARIZONA_LHPF4_MODE_SHIFT, 2,
-			arizona_lhpf_mode_text);
+SOC_ENUM_SINGLE_DECL(arizona_lhpf4_mode,
+		     ARIZONA_HPLPF4_1,
+		     ARIZONA_LHPF4_MODE_SHIFT,
+		     arizona_lhpf_mode_text);
 EXPORT_SYMBOL_GPL(arizona_lhpf4_mode);
 
 static const char *arizona_ng_hold_text[] = {
 	"30ms", "120ms", "250ms", "500ms",
 };
 
-const struct soc_enum arizona_ng_hold =
-	SOC_ENUM_SINGLE(ARIZONA_NOISE_GATE_CONTROL, ARIZONA_NGATE_HOLD_SHIFT,
-			4, arizona_ng_hold_text);
+SOC_ENUM_SINGLE_DECL(arizona_ng_hold,
+		     ARIZONA_NOISE_GATE_CONTROL,
+		     ARIZONA_NGATE_HOLD_SHIFT,
+		     arizona_ng_hold_text);
 EXPORT_SYMBOL_GPL(arizona_ng_hold);
 
 static const char * const arizona_in_hpf_cut_text[] = {
 	"2.5Hz", "5Hz", "10Hz", "20Hz", "40Hz"
 };
 
-const struct soc_enum arizona_in_hpf_cut_enum =
-	SOC_ENUM_SINGLE(ARIZONA_HPF_CONTROL, ARIZONA_IN_HPF_CUT_SHIFT,
-			ARRAY_SIZE(arizona_in_hpf_cut_text),
-			arizona_in_hpf_cut_text);
+SOC_ENUM_SINGLE_DECL(arizona_in_hpf_cut_enum,
+		     ARIZONA_HPF_CONTROL,
+		     ARIZONA_IN_HPF_CUT_SHIFT,
+		     arizona_in_hpf_cut_text);
 EXPORT_SYMBOL_GPL(arizona_in_hpf_cut_enum);
 
 static const char * const arizona_in_dmic_osr_text[] = {
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 020/102] ASoC: isabelle: Fix the wrong number of items in enum ctls
  2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
                   ` (2 preceding siblings ...)
  2014-02-18 11:36 ` [PATCH 019/102] ASoC: arizona: Fix wrong number of items in enum ctls Takashi Iwai
@ 2014-02-18 11:36 ` Takashi Iwai
  2014-02-19 16:53   ` Mark Brown
  2014-02-18 11:36 ` [PATCH 021/102] ASoC: ssm2602: Omit superfluous elements in input select array Takashi Iwai
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:36 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

isabelle codec driver has a few places wrongly defining the number of
enum items.

Use SOC_ENUM_SINGLE_DECL() macro and they are automatically fixed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/isabelle.c | 52 ++++++++++++++++++++++++++-------------------
 1 file changed, 30 insertions(+), 22 deletions(-)

diff --git a/sound/soc/codecs/isabelle.c b/sound/soc/codecs/isabelle.c
index 5839048ec467..cb736ddc446d 100644
--- a/sound/soc/codecs/isabelle.c
+++ b/sound/soc/codecs/isabelle.c
@@ -140,13 +140,17 @@ static const char *isabelle_rx1_texts[] = {"VRX1", "ARX1"};
 static const char *isabelle_rx2_texts[] = {"VRX2", "ARX2"};
 
 static const struct soc_enum isabelle_rx1_enum[] = {
-	SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 3, 1, isabelle_rx1_texts),
-	SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 5, 1, isabelle_rx1_texts),
+	SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 3,
+			ARRAY_SIZE(isabelle_rx1_texts), isabelle_rx1_texts),
+	SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 5,
+			ARRAY_SIZE(isabelle_rx1_texts), isabelle_rx1_texts),
 };
 
 static const struct soc_enum isabelle_rx2_enum[] = {
-	SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 2, 1, isabelle_rx2_texts),
-	SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 4, 1, isabelle_rx2_texts),
+	SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 2,
+			ARRAY_SIZE(isabelle_rx2_texts), isabelle_rx2_texts),
+	SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 4,
+			ARRAY_SIZE(isabelle_rx2_texts), isabelle_rx2_texts),
 };
 
 /* Headset DAC playback switches */
@@ -161,13 +165,17 @@ static const char *isabelle_atx_texts[] = {"AMIC1", "DMIC"};
 static const char *isabelle_vtx_texts[] = {"AMIC2", "DMIC"};
 
 static const struct soc_enum isabelle_atx_enum[] = {
-	SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 7, 1, isabelle_atx_texts),
-	SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, 1, isabelle_atx_texts),
+	SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 7,
+			ARRAY_SIZE(isabelle_atx_texts), isabelle_atx_texts),
+	SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0,
+			ARRAY_SIZE(isabelle_atx_texts), isabelle_atx_texts),
 };
 
 static const struct soc_enum isabelle_vtx_enum[] = {
-	SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 6, 1, isabelle_vtx_texts),
-	SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0, 1, isabelle_vtx_texts),
+	SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 6,
+			ARRAY_SIZE(isabelle_vtx_texts), isabelle_vtx_texts),
+	SOC_ENUM_SINGLE(ISABELLE_DMIC_CFG_REG, 0,
+			ARRAY_SIZE(isabelle_vtx_texts), isabelle_vtx_texts),
 };
 
 static const struct snd_kcontrol_new atx_mux_controls =
@@ -183,17 +191,13 @@ static const char *isabelle_amic1_texts[] = {
 /* Left analog microphone selection */
 static const char *isabelle_amic2_texts[] = {"Sub Mic", "Aux/FM Right"};
 
-static const struct soc_enum isabelle_amic1_enum[] = {
-	SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 5,
-			ARRAY_SIZE(isabelle_amic1_texts),
-			isabelle_amic1_texts),
-};
+static SOC_ENUM_SINGLE_DECL(isabelle_amic1_enum,
+			    ISABELLE_AMIC_CFG_REG, 5,
+			    isabelle_amic1_texts);
 
-static const struct soc_enum isabelle_amic2_enum[] = {
-	SOC_ENUM_SINGLE(ISABELLE_AMIC_CFG_REG, 4,
-			ARRAY_SIZE(isabelle_amic2_texts),
-			isabelle_amic2_texts),
-};
+static SOC_ENUM_SINGLE_DECL(isabelle_amic2_enum,
+			    ISABELLE_AMIC_CFG_REG, 4,
+			    isabelle_amic2_texts);
 
 static const struct snd_kcontrol_new amic1_control =
 	SOC_DAPM_ENUM("Route", isabelle_amic1_enum);
@@ -206,16 +210,20 @@ static const char *isabelle_st_audio_texts[] = {"ATX1", "ATX2"};
 static const char *isabelle_st_voice_texts[] = {"VTX1", "VTX2"};
 
 static const struct soc_enum isabelle_st_audio_enum[] = {
-	SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA1_CFG_REG, 7, 1,
+	SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA1_CFG_REG, 7,
+			ARRAY_SIZE(isabelle_st_audio_texts),
 			isabelle_st_audio_texts),
-	SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA2_CFG_REG, 7, 1,
+	SOC_ENUM_SINGLE(ISABELLE_ATX_STPGA2_CFG_REG, 7,
+			ARRAY_SIZE(isabelle_st_audio_texts),
 			isabelle_st_audio_texts),
 };
 
 static const struct soc_enum isabelle_st_voice_enum[] = {
-	SOC_ENUM_SINGLE(ISABELLE_VTX_STPGA1_CFG_REG, 7, 1,
+	SOC_ENUM_SINGLE(ISABELLE_VTX_STPGA1_CFG_REG, 7,
+			ARRAY_SIZE(isabelle_st_voice_texts),
 			isabelle_st_voice_texts),
-	SOC_ENUM_SINGLE(ISABELLE_VTX2_STPGA2_CFG_REG, 7, 1,
+	SOC_ENUM_SINGLE(ISABELLE_VTX2_STPGA2_CFG_REG, 7,
+			ARRAY_SIZE(isabelle_st_voice_texts),
 			isabelle_st_voice_texts),
 };
 
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 021/102] ASoC: ssm2602: Omit superfluous elements in input select array
  2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
                   ` (3 preceding siblings ...)
  2014-02-18 11:36 ` [PATCH 020/102] ASoC: isabelle: Fix the " Takashi Iwai
@ 2014-02-18 11:36 ` Takashi Iwai
  2014-02-18 11:59   ` Lars-Peter Clausen
  2014-02-20  1:20   ` Mark Brown
  2014-02-18 11:36 ` [PATCH 022/102] ASoC: wm8400: Fix the wrong number of enum items Takashi Iwai
                   ` (6 subsequent siblings)
  11 siblings, 2 replies; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:36 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

The array contains too many elements although it should have only
two.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/ssm2602.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
index f444d585b916..e32b82ff6304 100644
--- a/sound/soc/codecs/ssm2602.c
+++ b/sound/soc/codecs/ssm2602.c
@@ -75,15 +75,16 @@ static const u16 ssm2602_reg[SSM2602_CACHEREGNUM] = {
 
 /*Appending several "None"s just for OSS mixer use*/
 static const char *ssm2602_input_select[] = {
-	"Line", "Mic", "None", "None", "None",
-	"None", "None", "None",
+	"Line", "Mic",
 };
 
 static const char *ssm2602_deemph[] = {"None", "32Khz", "44.1Khz", "48Khz"};
 
 static const struct soc_enum ssm2602_enum[] = {
-	SOC_ENUM_SINGLE(SSM2602_APANA, 2, 2, ssm2602_input_select),
-	SOC_ENUM_SINGLE(SSM2602_APDIGI, 1, 4, ssm2602_deemph),
+	SOC_ENUM_SINGLE(SSM2602_APANA, 2, ARRAY_SIZE(ssm2602_input_select),
+			ssm2602_input_select),
+	SOC_ENUM_SINGLE(SSM2602_APDIGI, 1, ARRAY_SIZE(ssm2602_deemph),
+			ssm2602_deemph),
 };
 
 static const unsigned int ssm260x_outmix_tlv[] = {
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 022/102] ASoC: wm8400: Fix the wrong number of enum items
  2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
                   ` (4 preceding siblings ...)
  2014-02-18 11:36 ` [PATCH 021/102] ASoC: ssm2602: Omit superfluous elements in input select array Takashi Iwai
@ 2014-02-18 11:36 ` Takashi Iwai
  2014-02-20  1:21   ` Mark Brown
  2014-02-18 11:36 ` [PATCH 023/102] ASoC: wm8770: Fix " Takashi Iwai
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:36 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

wm8400 codec driver has a few places wrongly defining the number of
enum items.

Use SOC_ENUM_SINGLE_DECL() macro and they are automatically fixed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/wm8400.c | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/sound/soc/codecs/wm8400.c b/sound/soc/codecs/wm8400.c
index 48dc7d2fee36..6d684d934f4d 100644
--- a/sound/soc/codecs/wm8400.c
+++ b/sound/soc/codecs/wm8400.c
@@ -117,19 +117,23 @@ static int wm8400_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
 static const char *wm8400_digital_sidetone[] =
 	{"None", "Left ADC", "Right ADC", "Reserved"};
 
-static const struct soc_enum wm8400_left_digital_sidetone_enum =
-SOC_ENUM_SINGLE(WM8400_DIGITAL_SIDE_TONE,
-		WM8400_ADC_TO_DACL_SHIFT, 2, wm8400_digital_sidetone);
+static SOC_ENUM_SINGLE_DECL(wm8400_left_digital_sidetone_enum,
+			    WM8400_DIGITAL_SIDE_TONE,
+			    WM8400_ADC_TO_DACL_SHIFT,
+			    wm8400_digital_sidetone);
 
-static const struct soc_enum wm8400_right_digital_sidetone_enum =
-SOC_ENUM_SINGLE(WM8400_DIGITAL_SIDE_TONE,
-		WM8400_ADC_TO_DACR_SHIFT, 2, wm8400_digital_sidetone);
+static SOC_ENUM_SINGLE_DECL(wm8400_right_digital_sidetone_enum,
+			    WM8400_DIGITAL_SIDE_TONE,
+			    WM8400_ADC_TO_DACR_SHIFT,
+			    wm8400_digital_sidetone);
 
 static const char *wm8400_adcmode[] =
 	{"Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3"};
 
-static const struct soc_enum wm8400_right_adcmode_enum =
-SOC_ENUM_SINGLE(WM8400_ADC_CTRL, WM8400_ADC_HPF_CUT_SHIFT, 3, wm8400_adcmode);
+static SOC_ENUM_SINGLE_DECL(wm8400_right_adcmode_enum,
+			    WM8400_ADC_CTRL,
+			    WM8400_ADC_HPF_CUT_SHIFT,
+			    wm8400_adcmode);
 
 static const struct snd_kcontrol_new wm8400_snd_controls[] = {
 /* INMIXL */
@@ -422,9 +426,10 @@ SOC_DAPM_SINGLE("RINPGA34 Switch", WM8400_INPUT_MIXER3, WM8400_L34MNB_SHIFT,
 static const char *wm8400_ainlmux[] =
 	{"INMIXL Mix", "RXVOICE Mix", "DIFFINL Mix"};
 
-static const struct soc_enum wm8400_ainlmux_enum =
-SOC_ENUM_SINGLE( WM8400_INPUT_MIXER1, WM8400_AINLMODE_SHIFT,
-	ARRAY_SIZE(wm8400_ainlmux), wm8400_ainlmux);
+static SOC_ENUM_SINGLE_DECL(wm8400_ainlmux_enum,
+			    WM8400_INPUT_MIXER1,
+			    WM8400_AINLMODE_SHIFT,
+			    wm8400_ainlmux);
 
 static const struct snd_kcontrol_new wm8400_dapm_ainlmux_controls =
 SOC_DAPM_ENUM("Route", wm8400_ainlmux_enum);
@@ -435,9 +440,10 @@ SOC_DAPM_ENUM("Route", wm8400_ainlmux_enum);
 static const char *wm8400_ainrmux[] =
 	{"INMIXR Mix", "RXVOICE Mix", "DIFFINR Mix"};
 
-static const struct soc_enum wm8400_ainrmux_enum =
-SOC_ENUM_SINGLE( WM8400_INPUT_MIXER1, WM8400_AINRMODE_SHIFT,
-	ARRAY_SIZE(wm8400_ainrmux), wm8400_ainrmux);
+static SOC_ENUM_SINGLE_DECL(wm8400_ainrmux_enum,
+			    WM8400_INPUT_MIXER1,
+			    WM8400_AINRMODE_SHIFT,
+			    wm8400_ainrmux);
 
 static const struct snd_kcontrol_new wm8400_dapm_ainrmux_controls =
 SOC_DAPM_ENUM("Route", wm8400_ainrmux_enum);
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 023/102] ASoC: wm8770: Fix wrong number of enum items
  2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
                   ` (5 preceding siblings ...)
  2014-02-18 11:36 ` [PATCH 022/102] ASoC: wm8400: Fix the wrong number of enum items Takashi Iwai
@ 2014-02-18 11:36 ` Takashi Iwai
  2014-02-20  1:24   ` Mark Brown
  2014-02-18 11:36 ` [PATCH 024/102] ASoC: wm8900: Fix the " Takashi Iwai
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:36 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

wm8770 codec driver defines ain_enum with a wrong number of items.

Use SOC_ENUM_DOUBLE_DECL() macro and it's automatically fixed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/wm8770.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wm8770.c b/sound/soc/codecs/wm8770.c
index 89a18d82f303..5bce21013485 100644
--- a/sound/soc/codecs/wm8770.c
+++ b/sound/soc/codecs/wm8770.c
@@ -196,8 +196,8 @@ static const char *ain_text[] = {
 	"AIN5", "AIN6", "AIN7", "AIN8"
 };
 
-static const struct soc_enum ain_enum =
-	SOC_ENUM_DOUBLE(WM8770_ADCMUX, 0, 4, 8, ain_text);
+static SOC_ENUM_DOUBLE_DECL(ain_enum,
+			    WM8770_ADCMUX, 0, 4, ain_text);
 
 static const struct snd_kcontrol_new ain_mux =
 	SOC_DAPM_ENUM("Capture Mux", ain_enum);
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 024/102] ASoC: wm8900: Fix the wrong number of enum items
  2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
                   ` (6 preceding siblings ...)
  2014-02-18 11:36 ` [PATCH 023/102] ASoC: wm8770: Fix " Takashi Iwai
@ 2014-02-18 11:36 ` Takashi Iwai
  2014-02-20  1:28   ` Mark Brown
  2014-02-18 11:37 ` [PATCH 025/102] ASoC: wm8990: " Takashi Iwai
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:36 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

wm8900 codec driver has a few places wrongly defining the number of
enum items.

Use SOC_ENUM_SINGLE_DECL() macro and they are automatically fixed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/wm8900.c | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c
index e98bc7038a08..43c2201cb901 100644
--- a/sound/soc/codecs/wm8900.c
+++ b/sound/soc/codecs/wm8900.c
@@ -304,53 +304,53 @@ static const DECLARE_TLV_DB_SCALE(adc_tlv, -7200, 75, 1);
 
 static const char *mic_bias_level_txt[] = { "0.9*AVDD", "0.65*AVDD" };
 
-static const struct soc_enum mic_bias_level =
-SOC_ENUM_SINGLE(WM8900_REG_INCTL, 8, 2, mic_bias_level_txt);
+static SOC_ENUM_SINGLE_DECL(mic_bias_level,
+			    WM8900_REG_INCTL, 8, mic_bias_level_txt);
 
 static const char *dac_mute_rate_txt[] = { "Fast", "Slow" };
 
-static const struct soc_enum dac_mute_rate =
-SOC_ENUM_SINGLE(WM8900_REG_DACCTRL, 7, 2, dac_mute_rate_txt);
+static SOC_ENUM_SINGLE_DECL(dac_mute_rate,
+			    WM8900_REG_DACCTRL, 7, dac_mute_rate_txt);
 
 static const char *dac_deemphasis_txt[] = {
 	"Disabled", "32kHz", "44.1kHz", "48kHz"
 };
 
-static const struct soc_enum dac_deemphasis =
-SOC_ENUM_SINGLE(WM8900_REG_DACCTRL, 4, 4, dac_deemphasis_txt);
+static SOC_ENUM_SINGLE_DECL(dac_deemphasis,
+			    WM8900_REG_DACCTRL, 4, dac_deemphasis_txt);
 
 static const char *adc_hpf_cut_txt[] = {
 	"Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3"
 };
 
-static const struct soc_enum adc_hpf_cut =
-SOC_ENUM_SINGLE(WM8900_REG_ADCCTRL, 5, 4, adc_hpf_cut_txt);
+static SOC_ENUM_SINGLE_DECL(adc_hpf_cut,
+			    WM8900_REG_ADCCTRL, 5, adc_hpf_cut_txt);
 
 static const char *lr_txt[] = {
 	"Left", "Right"
 };
 
-static const struct soc_enum aifl_src =
-SOC_ENUM_SINGLE(WM8900_REG_AUDIO1, 15, 2, lr_txt);
+static SOC_ENUM_SINGLE_DECL(aifl_src,
+			    WM8900_REG_AUDIO1, 15, lr_txt);
 
-static const struct soc_enum aifr_src =
-SOC_ENUM_SINGLE(WM8900_REG_AUDIO1, 14, 2, lr_txt);
+static SOC_ENUM_SINGLE_DECL(aifr_src,
+			    WM8900_REG_AUDIO1, 14, lr_txt);
 
-static const struct soc_enum dacl_src =
-SOC_ENUM_SINGLE(WM8900_REG_AUDIO2, 15, 2, lr_txt);
+static SOC_ENUM_SINGLE_DECL(dacl_src,
+			    WM8900_REG_AUDIO2, 15, lr_txt);
 
-static const struct soc_enum dacr_src =
-SOC_ENUM_SINGLE(WM8900_REG_AUDIO2, 14, 2, lr_txt);
+static SOC_ENUM_SINGLE_DECL(dacr_src,
+			    WM8900_REG_AUDIO2, 14, lr_txt);
 
 static const char *sidetone_txt[] = {
 	"Disabled", "Left ADC", "Right ADC"
 };
 
-static const struct soc_enum dacl_sidetone =
-SOC_ENUM_SINGLE(WM8900_REG_SIDETONE, 2, 3, sidetone_txt);
+static SOC_ENUM_SINGLE_DECL(dacl_sidetone,
+			    WM8900_REG_SIDETONE, 2, sidetone_txt);
 
-static const struct soc_enum dacr_sidetone =
-SOC_ENUM_SINGLE(WM8900_REG_SIDETONE, 0, 3, sidetone_txt);
+static SOC_ENUM_SINGLE_DECL(dacr_sidetone,
+			    WM8900_REG_SIDETONE, 0, sidetone_txt);
 
 static const struct snd_kcontrol_new wm8900_snd_controls[] = {
 SOC_ENUM("Mic Bias Level", mic_bias_level),
@@ -496,8 +496,8 @@ SOC_DAPM_SINGLE("RINPUT3 Switch", WM8900_REG_INCTL, 0, 1, 0),
 
 static const char *wm8900_lp_mux[] = { "Disabled", "Enabled" };
 
-static const struct soc_enum wm8900_lineout2_lp_mux =
-SOC_ENUM_SINGLE(WM8900_REG_LOUTMIXCTL1, 1, 2, wm8900_lp_mux);
+static SOC_ENUM_SINGLE_DECL(wm8900_lineout2_lp_mux,
+			    WM8900_REG_LOUTMIXCTL1, 1, wm8900_lp_mux);
 
 static const struct snd_kcontrol_new wm8900_lineout2_lp =
 SOC_DAPM_ENUM("Route", wm8900_lineout2_lp_mux);
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 025/102] ASoC: wm8990: Fix the wrong number of enum items
  2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
                   ` (7 preceding siblings ...)
  2014-02-18 11:36 ` [PATCH 024/102] ASoC: wm8900: Fix the " Takashi Iwai
@ 2014-02-18 11:37 ` Takashi Iwai
  2014-02-20  1:30   ` Mark Brown
  2014-02-18 11:37 ` [PATCH 026/102] ASoC: wm8991: " Takashi Iwai
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:37 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

wm8990 codec driver has a few places wrongly defining the number of
enum items.

Use SOC_ENUM_SINGLE_DECL() macro and they are automatically fixed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/wm8990.c | 41 +++++++++++++++++++----------------------
 1 file changed, 19 insertions(+), 22 deletions(-)

diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index 0ccd4d8d043b..33f53ab1e7b0 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -157,26 +157,23 @@ static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
 static const char *wm8990_digital_sidetone[] =
 	{"None", "Left ADC", "Right ADC", "Reserved"};
 
-static const struct soc_enum wm8990_left_digital_sidetone_enum =
-SOC_ENUM_SINGLE(WM8990_DIGITAL_SIDE_TONE,
-	WM8990_ADC_TO_DACL_SHIFT,
-	WM8990_ADC_TO_DACL_MASK,
-	wm8990_digital_sidetone);
-
-static const struct soc_enum wm8990_right_digital_sidetone_enum =
-SOC_ENUM_SINGLE(WM8990_DIGITAL_SIDE_TONE,
-	WM8990_ADC_TO_DACR_SHIFT,
-	WM8990_ADC_TO_DACR_MASK,
-	wm8990_digital_sidetone);
+static SOC_ENUM_SINGLE_DECL(wm8990_left_digital_sidetone_enum,
+			    WM8990_DIGITAL_SIDE_TONE,
+			    WM8990_ADC_TO_DACL_SHIFT,
+			    wm8990_digital_sidetone);
+
+static SOC_ENUM_SINGLE_DECL(wm8990_right_digital_sidetone_enum,
+			    WM8990_DIGITAL_SIDE_TONE,
+			    WM8990_ADC_TO_DACR_SHIFT,
+			    wm8990_digital_sidetone);
 
 static const char *wm8990_adcmode[] =
 	{"Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3"};
 
-static const struct soc_enum wm8990_right_adcmode_enum =
-SOC_ENUM_SINGLE(WM8990_ADC_CTRL,
-	WM8990_ADC_HPF_CUT_SHIFT,
-	WM8990_ADC_HPF_CUT_MASK,
-	wm8990_adcmode);
+static SOC_ENUM_SINGLE_DECL(wm8990_right_adcmode_enum,
+			    WM8990_ADC_CTRL,
+			    WM8990_ADC_HPF_CUT_SHIFT,
+			    wm8990_adcmode);
 
 static const struct snd_kcontrol_new wm8990_snd_controls[] = {
 /* INMIXL */
@@ -475,9 +472,9 @@ SOC_DAPM_SINGLE("RINPGA34 Switch", WM8990_INPUT_MIXER3, WM8990_L34MNB_BIT,
 static const char *wm8990_ainlmux[] =
 	{"INMIXL Mix", "RXVOICE Mix", "DIFFINL Mix"};
 
-static const struct soc_enum wm8990_ainlmux_enum =
-SOC_ENUM_SINGLE(WM8990_INPUT_MIXER1, WM8990_AINLMODE_SHIFT,
-	ARRAY_SIZE(wm8990_ainlmux), wm8990_ainlmux);
+static SOC_ENUM_SINGLE_DECL(wm8990_ainlmux_enum,
+			    WM8990_INPUT_MIXER1, WM8990_AINLMODE_SHIFT,
+			    wm8990_ainlmux);
 
 static const struct snd_kcontrol_new wm8990_dapm_ainlmux_controls =
 SOC_DAPM_ENUM("Route", wm8990_ainlmux_enum);
@@ -488,9 +485,9 @@ SOC_DAPM_ENUM("Route", wm8990_ainlmux_enum);
 static const char *wm8990_ainrmux[] =
 	{"INMIXR Mix", "RXVOICE Mix", "DIFFINR Mix"};
 
-static const struct soc_enum wm8990_ainrmux_enum =
-SOC_ENUM_SINGLE(WM8990_INPUT_MIXER1, WM8990_AINRMODE_SHIFT,
-	ARRAY_SIZE(wm8990_ainrmux), wm8990_ainrmux);
+static SOC_ENUM_SINGLE_DECL(wm8990_ainrmux_enum,
+			    WM8990_INPUT_MIXER1, WM8990_AINRMODE_SHIFT,
+			    wm8990_ainrmux);
 
 static const struct snd_kcontrol_new wm8990_dapm_ainrmux_controls =
 SOC_DAPM_ENUM("Route", wm8990_ainrmux_enum);
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 026/102] ASoC: wm8991: Fix the wrong number of enum items
  2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
                   ` (8 preceding siblings ...)
  2014-02-18 11:37 ` [PATCH 025/102] ASoC: wm8990: " Takashi Iwai
@ 2014-02-18 11:37 ` Takashi Iwai
  2014-02-20  1:32   ` Mark Brown
  2014-02-18 11:37 ` [PATCH 027/102] ASoC: wm8994: " Takashi Iwai
  2014-02-20  2:05 ` [PATCH 000/102 - chunk#3] Actually fix wrong " Mark Brown
  11 siblings, 1 reply; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:37 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

wm8991 codec driver has a few places wrongly defining the number of
enum items.

Use SOC_ENUM_SINGLE_DECL() macro and they are automatically fixed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/wm8991.c | 41 +++++++++++++++++++----------------------
 1 file changed, 19 insertions(+), 22 deletions(-)

diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c
index 244eb09ffa43..32d219570cca 100644
--- a/sound/soc/codecs/wm8991.c
+++ b/sound/soc/codecs/wm8991.c
@@ -171,26 +171,23 @@ static int wm899x_outpga_put_volsw_vu(struct snd_kcontrol *kcontrol,
 static const char *wm8991_digital_sidetone[] =
 {"None", "Left ADC", "Right ADC", "Reserved"};
 
-static const struct soc_enum wm8991_left_digital_sidetone_enum =
-	SOC_ENUM_SINGLE(WM8991_DIGITAL_SIDE_TONE,
-			WM8991_ADC_TO_DACL_SHIFT,
-			WM8991_ADC_TO_DACL_MASK,
-			wm8991_digital_sidetone);
-
-static const struct soc_enum wm8991_right_digital_sidetone_enum =
-	SOC_ENUM_SINGLE(WM8991_DIGITAL_SIDE_TONE,
-			WM8991_ADC_TO_DACR_SHIFT,
-			WM8991_ADC_TO_DACR_MASK,
-			wm8991_digital_sidetone);
+static SOC_ENUM_SINGLE_DECL(wm8991_left_digital_sidetone_enum,
+			    WM8991_DIGITAL_SIDE_TONE,
+			    WM8991_ADC_TO_DACL_SHIFT,
+			    wm8991_digital_sidetone);
+
+static SOC_ENUM_SINGLE_DECL(wm8991_right_digital_sidetone_enum,
+			    WM8991_DIGITAL_SIDE_TONE,
+			    WM8991_ADC_TO_DACR_SHIFT,
+			    wm8991_digital_sidetone);
 
 static const char *wm8991_adcmode[] =
 {"Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3"};
 
-static const struct soc_enum wm8991_right_adcmode_enum =
-	SOC_ENUM_SINGLE(WM8991_ADC_CTRL,
-			WM8991_ADC_HPF_CUT_SHIFT,
-			WM8991_ADC_HPF_CUT_MASK,
-			wm8991_adcmode);
+static SOC_ENUM_SINGLE_DECL(wm8991_right_adcmode_enum,
+			    WM8991_ADC_CTRL,
+			    WM8991_ADC_HPF_CUT_SHIFT,
+			    wm8991_adcmode);
 
 static const struct snd_kcontrol_new wm8991_snd_controls[] = {
 	/* INMIXL */
@@ -486,9 +483,9 @@ static const struct snd_kcontrol_new wm8991_dapm_inmixr_controls[] = {
 static const char *wm8991_ainlmux[] =
 {"INMIXL Mix", "RXVOICE Mix", "DIFFINL Mix"};
 
-static const struct soc_enum wm8991_ainlmux_enum =
-	SOC_ENUM_SINGLE(WM8991_INPUT_MIXER1, WM8991_AINLMODE_SHIFT,
-			ARRAY_SIZE(wm8991_ainlmux), wm8991_ainlmux);
+static SOC_ENUM_SINGLE_DECL(wm8991_ainlmux_enum,
+			    WM8991_INPUT_MIXER1, WM8991_AINLMODE_SHIFT,
+			    wm8991_ainlmux);
 
 static const struct snd_kcontrol_new wm8991_dapm_ainlmux_controls =
 	SOC_DAPM_ENUM("Route", wm8991_ainlmux_enum);
@@ -499,9 +496,9 @@ static const struct snd_kcontrol_new wm8991_dapm_ainlmux_controls =
 static const char *wm8991_ainrmux[] =
 {"INMIXR Mix", "RXVOICE Mix", "DIFFINR Mix"};
 
-static const struct soc_enum wm8991_ainrmux_enum =
-	SOC_ENUM_SINGLE(WM8991_INPUT_MIXER1, WM8991_AINRMODE_SHIFT,
-			ARRAY_SIZE(wm8991_ainrmux), wm8991_ainrmux);
+static SOC_ENUM_SINGLE_DECL(wm8991_ainrmux_enum,
+			    WM8991_INPUT_MIXER1, WM8991_AINRMODE_SHIFT,
+			    wm8991_ainrmux);
 
 static const struct snd_kcontrol_new wm8991_dapm_ainrmux_controls =
 	SOC_DAPM_ENUM("Route", wm8991_ainrmux_enum);
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 027/102] ASoC: wm8994: Fix the wrong number of enum items
  2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
                   ` (9 preceding siblings ...)
  2014-02-18 11:37 ` [PATCH 026/102] ASoC: wm8991: " Takashi Iwai
@ 2014-02-18 11:37 ` Takashi Iwai
  2014-02-20  1:33   ` Mark Brown
  2014-02-20  2:05 ` [PATCH 000/102 - chunk#3] Actually fix wrong " Mark Brown
  11 siblings, 1 reply; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:37 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

wm8994 codec driver has a few places wrongly defining the number of
enum items.

Use SOC_ENUM_SINGLE_DECL() macro and they are automatically fixed.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/codecs/wm8994.c | 135 ++++++++++++++++++++++++----------------------
 1 file changed, 70 insertions(+), 65 deletions(-)

diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 8253c3c6db0e..e5695d2644b3 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -265,21 +265,21 @@ static const char *sidetone_hpf_text[] = {
 	"2.7kHz", "1.35kHz", "675Hz", "370Hz", "180Hz", "90Hz", "45Hz"
 };
 
-static const struct soc_enum sidetone_hpf =
-	SOC_ENUM_SINGLE(WM8994_SIDETONE, 7, 7, sidetone_hpf_text);
+static SOC_ENUM_SINGLE_DECL(sidetone_hpf,
+			    WM8994_SIDETONE, 7, sidetone_hpf_text);
 
 static const char *adc_hpf_text[] = {
 	"HiFi", "Voice 1", "Voice 2", "Voice 3"
 };
 
-static const struct soc_enum aif1adc1_hpf =
-	SOC_ENUM_SINGLE(WM8994_AIF1_ADC1_FILTERS, 13, 4, adc_hpf_text);
+static SOC_ENUM_SINGLE_DECL(aif1adc1_hpf,
+			    WM8994_AIF1_ADC1_FILTERS, 13, adc_hpf_text);
 
-static const struct soc_enum aif1adc2_hpf =
-	SOC_ENUM_SINGLE(WM8994_AIF1_ADC2_FILTERS, 13, 4, adc_hpf_text);
+static SOC_ENUM_SINGLE_DECL(aif1adc2_hpf,
+			    WM8994_AIF1_ADC2_FILTERS, 13, adc_hpf_text);
 
-static const struct soc_enum aif2adc_hpf =
-	SOC_ENUM_SINGLE(WM8994_AIF2_ADC_FILTERS, 13, 4, adc_hpf_text);
+static SOC_ENUM_SINGLE_DECL(aif2adc_hpf,
+			    WM8994_AIF2_ADC_FILTERS, 13, adc_hpf_text);
 
 static const DECLARE_TLV_DB_SCALE(aif_tlv, 0, 600, 0);
 static const DECLARE_TLV_DB_SCALE(digital_tlv, -7200, 75, 1);
@@ -501,39 +501,39 @@ static const char *aif_chan_src_text[] = {
 	"Left", "Right"
 };
 
-static const struct soc_enum aif1adcl_src =
-	SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_1, 15, 2, aif_chan_src_text);
+static SOC_ENUM_SINGLE_DECL(aif1adcl_src,
+			    WM8994_AIF1_CONTROL_1, 15, aif_chan_src_text);
 
-static const struct soc_enum aif1adcr_src =
-	SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_1, 14, 2, aif_chan_src_text);
+static SOC_ENUM_SINGLE_DECL(aif1adcr_src,
+			    WM8994_AIF1_CONTROL_1, 14, aif_chan_src_text);
 
-static const struct soc_enum aif2adcl_src =
-	SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_1, 15, 2, aif_chan_src_text);
+static SOC_ENUM_SINGLE_DECL(aif2adcl_src,
+			    WM8994_AIF2_CONTROL_1, 15, aif_chan_src_text);
 
-static const struct soc_enum aif2adcr_src =
-	SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_1, 14, 2, aif_chan_src_text);
+static SOC_ENUM_SINGLE_DECL(aif2adcr_src,
+			    WM8994_AIF2_CONTROL_1, 14, aif_chan_src_text);
 
-static const struct soc_enum aif1dacl_src =
-	SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, 15, 2, aif_chan_src_text);
+static SOC_ENUM_SINGLE_DECL(aif1dacl_src,
+			    WM8994_AIF1_CONTROL_2, 15, aif_chan_src_text);
 
-static const struct soc_enum aif1dacr_src =
-	SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, 14, 2, aif_chan_src_text);
+static SOC_ENUM_SINGLE_DECL(aif1dacr_src,
+			    WM8994_AIF1_CONTROL_2, 14, aif_chan_src_text);
 
-static const struct soc_enum aif2dacl_src =
-	SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, 15, 2, aif_chan_src_text);
+static SOC_ENUM_SINGLE_DECL(aif2dacl_src,
+			    WM8994_AIF2_CONTROL_2, 15, aif_chan_src_text);
 
-static const struct soc_enum aif2dacr_src =
-	SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, 14, 2, aif_chan_src_text);
+static SOC_ENUM_SINGLE_DECL(aif2dacr_src,
+			    WM8994_AIF2_CONTROL_2, 14, aif_chan_src_text);
 
 static const char *osr_text[] = {
 	"Low Power", "High Performance",
 };
 
-static const struct soc_enum dac_osr =
-	SOC_ENUM_SINGLE(WM8994_OVERSAMPLING, 0, 2, osr_text);
+static SOC_ENUM_SINGLE_DECL(dac_osr,
+			    WM8994_OVERSAMPLING, 0, osr_text);
 
-static const struct soc_enum adc_osr =
-	SOC_ENUM_SINGLE(WM8994_OVERSAMPLING, 1, 2, osr_text);
+static SOC_ENUM_SINGLE_DECL(adc_osr,
+			    WM8994_OVERSAMPLING, 1, osr_text);
 
 static const struct snd_kcontrol_new wm8994_snd_controls[] = {
 SOC_DOUBLE_R_TLV("AIF1ADC1 Volume", WM8994_AIF1_ADC1_LEFT_VOLUME,
@@ -690,17 +690,20 @@ static const char *wm8958_ng_text[] = {
 	"30ms", "125ms", "250ms", "500ms",
 };
 
-static const struct soc_enum wm8958_aif1dac1_ng_hold =
-	SOC_ENUM_SINGLE(WM8958_AIF1_DAC1_NOISE_GATE,
-			WM8958_AIF1DAC1_NG_THR_SHIFT, 4, wm8958_ng_text);
+static SOC_ENUM_SINGLE_DECL(wm8958_aif1dac1_ng_hold,
+			    WM8958_AIF1_DAC1_NOISE_GATE,
+			    WM8958_AIF1DAC1_NG_THR_SHIFT,
+			    wm8958_ng_text);
 
-static const struct soc_enum wm8958_aif1dac2_ng_hold =
-	SOC_ENUM_SINGLE(WM8958_AIF1_DAC2_NOISE_GATE,
-			WM8958_AIF1DAC2_NG_THR_SHIFT, 4, wm8958_ng_text);
+static SOC_ENUM_SINGLE_DECL(wm8958_aif1dac2_ng_hold,
+			    WM8958_AIF1_DAC2_NOISE_GATE,
+			    WM8958_AIF1DAC2_NG_THR_SHIFT,
+			    wm8958_ng_text);
 
-static const struct soc_enum wm8958_aif2dac_ng_hold =
-	SOC_ENUM_SINGLE(WM8958_AIF2_DAC_NOISE_GATE,
-			WM8958_AIF2DAC_NG_THR_SHIFT, 4, wm8958_ng_text);
+static SOC_ENUM_SINGLE_DECL(wm8958_aif2dac_ng_hold,
+			    WM8958_AIF2_DAC_NOISE_GATE,
+			    WM8958_AIF2DAC_NG_THR_SHIFT,
+			    wm8958_ng_text);
 
 static const struct snd_kcontrol_new wm8958_snd_controls[] = {
 SOC_SINGLE_TLV("AIF3 Boost Volume", WM8958_AIF3_CONTROL_2, 10, 3, 0, aif_tlv),
@@ -1341,8 +1344,8 @@ static const char *adc_mux_text[] = {
 	"DMIC",
 };
 
-static const struct soc_enum adc_enum =
-	SOC_ENUM_SINGLE(0, 0, 2, adc_mux_text);
+static SOC_ENUM_SINGLE_DECL(adc_enum,
+			    0, 0, adc_mux_text);
 
 static const struct snd_kcontrol_new adcl_mux =
 	SOC_DAPM_ENUM_VIRT("ADCL Mux", adc_enum);
@@ -1478,14 +1481,14 @@ static const char *sidetone_text[] = {
 	"ADC/DMIC1", "DMIC2",
 };
 
-static const struct soc_enum sidetone1_enum =
-	SOC_ENUM_SINGLE(WM8994_SIDETONE, 0, 2, sidetone_text);
+static SOC_ENUM_SINGLE_DECL(sidetone1_enum,
+			    WM8994_SIDETONE, 0, sidetone_text);
 
 static const struct snd_kcontrol_new sidetone1_mux =
 	SOC_DAPM_ENUM("Left Sidetone Mux", sidetone1_enum);
 
-static const struct soc_enum sidetone2_enum =
-	SOC_ENUM_SINGLE(WM8994_SIDETONE, 1, 2, sidetone_text);
+static SOC_ENUM_SINGLE_DECL(sidetone2_enum,
+			    WM8994_SIDETONE, 1, sidetone_text);
 
 static const struct snd_kcontrol_new sidetone2_mux =
 	SOC_DAPM_ENUM("Right Sidetone Mux", sidetone2_enum);
@@ -1498,22 +1501,24 @@ static const char *loopback_text[] = {
 	"None", "ADCDAT",
 };
 
-static const struct soc_enum aif1_loopback_enum =
-	SOC_ENUM_SINGLE(WM8994_AIF1_CONTROL_2, WM8994_AIF1_LOOPBACK_SHIFT, 2,
-			loopback_text);
+static SOC_ENUM_SINGLE_DECL(aif1_loopback_enum,
+			    WM8994_AIF1_CONTROL_2,
+			    WM8994_AIF1_LOOPBACK_SHIFT,
+			    loopback_text);
 
 static const struct snd_kcontrol_new aif1_loopback =
 	SOC_DAPM_ENUM("AIF1 Loopback", aif1_loopback_enum);
 
-static const struct soc_enum aif2_loopback_enum =
-	SOC_ENUM_SINGLE(WM8994_AIF2_CONTROL_2, WM8994_AIF2_LOOPBACK_SHIFT, 2,
-			loopback_text);
+static SOC_ENUM_SINGLE_DECL(aif2_loopback_enum,
+			    WM8994_AIF2_CONTROL_2,
+			    WM8994_AIF2_LOOPBACK_SHIFT,
+			    loopback_text);
 
 static const struct snd_kcontrol_new aif2_loopback =
 	SOC_DAPM_ENUM("AIF2 Loopback", aif2_loopback_enum);
 
-static const struct soc_enum aif1dac_enum =
-	SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 0, 2, aif1dac_text);
+static SOC_ENUM_SINGLE_DECL(aif1dac_enum,
+			    WM8994_POWER_MANAGEMENT_6, 0, aif1dac_text);
 
 static const struct snd_kcontrol_new aif1dac_mux =
 	SOC_DAPM_ENUM("AIF1DAC Mux", aif1dac_enum);
@@ -1522,8 +1527,8 @@ static const char *aif2dac_text[] = {
 	"AIF2DACDAT", "AIF3DACDAT",
 };
 
-static const struct soc_enum aif2dac_enum =
-	SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 1, 2, aif2dac_text);
+static SOC_ENUM_SINGLE_DECL(aif2dac_enum,
+			    WM8994_POWER_MANAGEMENT_6, 1, aif2dac_text);
 
 static const struct snd_kcontrol_new aif2dac_mux =
 	SOC_DAPM_ENUM("AIF2DAC Mux", aif2dac_enum);
@@ -1532,8 +1537,8 @@ static const char *aif2adc_text[] = {
 	"AIF2ADCDAT", "AIF3DACDAT",
 };
 
-static const struct soc_enum aif2adc_enum =
-	SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 2, 2, aif2adc_text);
+static SOC_ENUM_SINGLE_DECL(aif2adc_enum,
+			    WM8994_POWER_MANAGEMENT_6, 2, aif2adc_text);
 
 static const struct snd_kcontrol_new aif2adc_mux =
 	SOC_DAPM_ENUM("AIF2ADC Mux", aif2adc_enum);
@@ -1542,14 +1547,14 @@ static const char *aif3adc_text[] = {
 	"AIF1ADCDAT", "AIF2ADCDAT", "AIF2DACDAT", "Mono PCM",
 };
 
-static const struct soc_enum wm8994_aif3adc_enum =
-	SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 3, 3, aif3adc_text);
+static SOC_ENUM_SINGLE_DECL(wm8994_aif3adc_enum,
+			    WM8994_POWER_MANAGEMENT_6, 3, aif3adc_text);
 
 static const struct snd_kcontrol_new wm8994_aif3adc_mux =
 	SOC_DAPM_ENUM("AIF3ADC Mux", wm8994_aif3adc_enum);
 
-static const struct soc_enum wm8958_aif3adc_enum =
-	SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 3, 4, aif3adc_text);
+static SOC_ENUM_SINGLE_DECL(wm8958_aif3adc_enum,
+			    WM8994_POWER_MANAGEMENT_6, 3, aif3adc_text);
 
 static const struct snd_kcontrol_new wm8958_aif3adc_mux =
 	SOC_DAPM_ENUM("AIF3ADC Mux", wm8958_aif3adc_enum);
@@ -1558,8 +1563,8 @@ static const char *mono_pcm_out_text[] = {
 	"None", "AIF2ADCL", "AIF2ADCR",
 };
 
-static const struct soc_enum mono_pcm_out_enum =
-	SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 9, 3, mono_pcm_out_text);
+static SOC_ENUM_SINGLE_DECL(mono_pcm_out_enum,
+			    WM8994_POWER_MANAGEMENT_6, 9, mono_pcm_out_text);
 
 static const struct snd_kcontrol_new mono_pcm_out_mux =
 	SOC_DAPM_ENUM("Mono PCM Out Mux", mono_pcm_out_enum);
@@ -1569,14 +1574,14 @@ static const char *aif2dac_src_text[] = {
 };
 
 /* Note that these two control shouldn't be simultaneously switched to AIF3 */
-static const struct soc_enum aif2dacl_src_enum =
-	SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 7, 2, aif2dac_src_text);
+static SOC_ENUM_SINGLE_DECL(aif2dacl_src_enum,
+			    WM8994_POWER_MANAGEMENT_6, 7, aif2dac_src_text);
 
 static const struct snd_kcontrol_new aif2dacl_src_mux =
 	SOC_DAPM_ENUM("AIF2DACL Mux", aif2dacl_src_enum);
 
-static const struct soc_enum aif2dacr_src_enum =
-	SOC_ENUM_SINGLE(WM8994_POWER_MANAGEMENT_6, 8, 2, aif2dac_src_text);
+static SOC_ENUM_SINGLE_DECL(aif2dacr_src_enum,
+			    WM8994_POWER_MANAGEMENT_6, 8, aif2dac_src_text);
 
 static const struct snd_kcontrol_new aif2dacr_src_mux =
 	SOC_DAPM_ENUM("AIF2DACR Mux", aif2dacr_src_enum);
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* Re: [PATCH 019/102] ASoC: arizona: Fix wrong number of items in enum ctls
  2014-02-18 11:36 ` [PATCH 019/102] ASoC: arizona: Fix wrong number of items in enum ctls Takashi Iwai
@ 2014-02-18 11:54   ` Takashi Iwai
  2014-02-20  1:58   ` Mark Brown
  1 sibling, 0 replies; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 11:54 UTC (permalink / raw
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

At Tue, 18 Feb 2014 12:36:54 +0100,
Takashi Iwai wrote:
> 
> arizona codec driver has a few places wrongly defining the number of
> enum items.
> 
> Use SOC_ENUM_SINGLE_DECL() macro and they are automatically fixed.
> 
> Signed-off-by: Takashi Iwai <tiwai@suse.de>

Note that this change needs the previous preliminary patch for adding
const to SOC_ENUM_SINGLE_DECL().  Otherwise the build will fail due to
type conflicts.

Other patches for converting with SOC_ENUM_SINGLE_DECL() should be
applicable individually, but only this one needs attention.


Takashi

> ---
>  sound/soc/codecs/arizona.c | 71 ++++++++++++++++++++++++++--------------------
>  1 file changed, 40 insertions(+), 31 deletions(-)
> 
> diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
> index e4295fee8f13..a32b84ac03f6 100644
> --- a/sound/soc/codecs/arizona.c
> +++ b/sound/soc/codecs/arizona.c
> @@ -542,67 +542,76 @@ static const char *arizona_vol_ramp_text[] = {
>  	"15ms/6dB", "30ms/6dB",
>  };
>  
> -const struct soc_enum arizona_in_vd_ramp =
> -	SOC_ENUM_SINGLE(ARIZONA_INPUT_VOLUME_RAMP,
> -			ARIZONA_IN_VD_RAMP_SHIFT, 7, arizona_vol_ramp_text);
> +SOC_ENUM_SINGLE_DECL(arizona_in_vd_ramp,
> +		     ARIZONA_INPUT_VOLUME_RAMP,
> +		     ARIZONA_IN_VD_RAMP_SHIFT,
> +		     arizona_vol_ramp_text);
>  EXPORT_SYMBOL_GPL(arizona_in_vd_ramp);
>  
> -const struct soc_enum arizona_in_vi_ramp =
> -	SOC_ENUM_SINGLE(ARIZONA_INPUT_VOLUME_RAMP,
> -			ARIZONA_IN_VI_RAMP_SHIFT, 7, arizona_vol_ramp_text);
> +SOC_ENUM_SINGLE_DECL(arizona_in_vi_ramp,
> +		     ARIZONA_INPUT_VOLUME_RAMP,
> +		     ARIZONA_IN_VI_RAMP_SHIFT,
> +		     arizona_vol_ramp_text);
>  EXPORT_SYMBOL_GPL(arizona_in_vi_ramp);
>  
> -const struct soc_enum arizona_out_vd_ramp =
> -	SOC_ENUM_SINGLE(ARIZONA_OUTPUT_VOLUME_RAMP,
> -			ARIZONA_OUT_VD_RAMP_SHIFT, 7, arizona_vol_ramp_text);
> +SOC_ENUM_SINGLE_DECL(arizona_out_vd_ramp,
> +		     ARIZONA_OUTPUT_VOLUME_RAMP,
> +		     ARIZONA_OUT_VD_RAMP_SHIFT,
> +		     arizona_vol_ramp_text);
>  EXPORT_SYMBOL_GPL(arizona_out_vd_ramp);
>  
> -const struct soc_enum arizona_out_vi_ramp =
> -	SOC_ENUM_SINGLE(ARIZONA_OUTPUT_VOLUME_RAMP,
> -			ARIZONA_OUT_VI_RAMP_SHIFT, 7, arizona_vol_ramp_text);
> +SOC_ENUM_SINGLE_DECL(arizona_out_vi_ramp,
> +		     ARIZONA_OUTPUT_VOLUME_RAMP,
> +		     ARIZONA_OUT_VI_RAMP_SHIFT,
> +		     arizona_vol_ramp_text);
>  EXPORT_SYMBOL_GPL(arizona_out_vi_ramp);
>  
>  static const char *arizona_lhpf_mode_text[] = {
>  	"Low-pass", "High-pass"
>  };
>  
> -const struct soc_enum arizona_lhpf1_mode =
> -	SOC_ENUM_SINGLE(ARIZONA_HPLPF1_1, ARIZONA_LHPF1_MODE_SHIFT, 2,
> -			arizona_lhpf_mode_text);
> +SOC_ENUM_SINGLE_DECL(arizona_lhpf1_mode,
> +		     ARIZONA_HPLPF1_1,
> +		     ARIZONA_LHPF1_MODE_SHIFT,
> +		     arizona_lhpf_mode_text);
>  EXPORT_SYMBOL_GPL(arizona_lhpf1_mode);
>  
> -const struct soc_enum arizona_lhpf2_mode =
> -	SOC_ENUM_SINGLE(ARIZONA_HPLPF2_1, ARIZONA_LHPF2_MODE_SHIFT, 2,
> -			arizona_lhpf_mode_text);
> +SOC_ENUM_SINGLE_DECL(arizona_lhpf2_mode,
> +		     ARIZONA_HPLPF2_1,
> +		     ARIZONA_LHPF2_MODE_SHIFT,
> +		     arizona_lhpf_mode_text);
>  EXPORT_SYMBOL_GPL(arizona_lhpf2_mode);
>  
> -const struct soc_enum arizona_lhpf3_mode =
> -	SOC_ENUM_SINGLE(ARIZONA_HPLPF3_1, ARIZONA_LHPF3_MODE_SHIFT, 2,
> -			arizona_lhpf_mode_text);
> +SOC_ENUM_SINGLE_DECL(arizona_lhpf3_mode,
> +		     ARIZONA_HPLPF3_1,
> +		     ARIZONA_LHPF3_MODE_SHIFT,
> +		     arizona_lhpf_mode_text);
>  EXPORT_SYMBOL_GPL(arizona_lhpf3_mode);
>  
> -const struct soc_enum arizona_lhpf4_mode =
> -	SOC_ENUM_SINGLE(ARIZONA_HPLPF4_1, ARIZONA_LHPF4_MODE_SHIFT, 2,
> -			arizona_lhpf_mode_text);
> +SOC_ENUM_SINGLE_DECL(arizona_lhpf4_mode,
> +		     ARIZONA_HPLPF4_1,
> +		     ARIZONA_LHPF4_MODE_SHIFT,
> +		     arizona_lhpf_mode_text);
>  EXPORT_SYMBOL_GPL(arizona_lhpf4_mode);
>  
>  static const char *arizona_ng_hold_text[] = {
>  	"30ms", "120ms", "250ms", "500ms",
>  };
>  
> -const struct soc_enum arizona_ng_hold =
> -	SOC_ENUM_SINGLE(ARIZONA_NOISE_GATE_CONTROL, ARIZONA_NGATE_HOLD_SHIFT,
> -			4, arizona_ng_hold_text);
> +SOC_ENUM_SINGLE_DECL(arizona_ng_hold,
> +		     ARIZONA_NOISE_GATE_CONTROL,
> +		     ARIZONA_NGATE_HOLD_SHIFT,
> +		     arizona_ng_hold_text);
>  EXPORT_SYMBOL_GPL(arizona_ng_hold);
>  
>  static const char * const arizona_in_hpf_cut_text[] = {
>  	"2.5Hz", "5Hz", "10Hz", "20Hz", "40Hz"
>  };
>  
> -const struct soc_enum arizona_in_hpf_cut_enum =
> -	SOC_ENUM_SINGLE(ARIZONA_HPF_CONTROL, ARIZONA_IN_HPF_CUT_SHIFT,
> -			ARRAY_SIZE(arizona_in_hpf_cut_text),
> -			arizona_in_hpf_cut_text);
> +SOC_ENUM_SINGLE_DECL(arizona_in_hpf_cut_enum,
> +		     ARIZONA_HPF_CONTROL,
> +		     ARIZONA_IN_HPF_CUT_SHIFT,
> +		     arizona_in_hpf_cut_text);
>  EXPORT_SYMBOL_GPL(arizona_in_hpf_cut_enum);
>  
>  static const char * const arizona_in_dmic_osr_text[] = {
> -- 
> 1.8.5.2
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 021/102] ASoC: ssm2602: Omit superfluous elements in input select array
  2014-02-18 11:36 ` [PATCH 021/102] ASoC: ssm2602: Omit superfluous elements in input select array Takashi Iwai
@ 2014-02-18 11:59   ` Lars-Peter Clausen
  2014-02-18 13:23     ` Liam Girdwood
  2014-02-20  1:20   ` Mark Brown
  1 sibling, 1 reply; 29+ messages in thread
From: Lars-Peter Clausen @ 2014-02-18 11:59 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Mark Brown, Liam Girdwood

On 02/18/2014 12:36 PM, Takashi Iwai wrote:
> The array contains too many elements although it should have only
> two.
>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
>   sound/soc/codecs/ssm2602.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
> index f444d585b916..e32b82ff6304 100644
> --- a/sound/soc/codecs/ssm2602.c
> +++ b/sound/soc/codecs/ssm2602.c
> @@ -75,15 +75,16 @@ static const u16 ssm2602_reg[SSM2602_CACHEREGNUM] = {
>
>   /*Appending several "None"s just for OSS mixer use*/
>   static const char *ssm2602_input_select[] = {
> -	"Line", "Mic", "None", "None", "None",
> -	"None", "None", "None",
> +	"Line", "Mic",
>   };

I never dared to change it because of the comment above the array. I must 
admit that I have no idea though why those extra None entries are necessary 
for OSS.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 021/102] ASoC: ssm2602: Omit superfluous elements in input select array
  2014-02-18 11:59   ` Lars-Peter Clausen
@ 2014-02-18 13:23     ` Liam Girdwood
  2014-02-18 13:29       ` Takashi Iwai
  0 siblings, 1 reply; 29+ messages in thread
From: Liam Girdwood @ 2014-02-18 13:23 UTC (permalink / raw
  To: Lars-Peter Clausen; +Cc: Takashi Iwai, alsa-devel, Mark Brown, Liam Girdwood

On Tue, 2014-02-18 at 12:59 +0100, Lars-Peter Clausen wrote:
> On 02/18/2014 12:36 PM, Takashi Iwai wrote:
> > The array contains too many elements although it should have only
> > two.
> >
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > ---
> >   sound/soc/codecs/ssm2602.c | 9 +++++----
> >   1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
> > index f444d585b916..e32b82ff6304 100644
> > --- a/sound/soc/codecs/ssm2602.c
> > +++ b/sound/soc/codecs/ssm2602.c
> > @@ -75,15 +75,16 @@ static const u16 ssm2602_reg[SSM2602_CACHEREGNUM] = {
> >
> >   /*Appending several "None"s just for OSS mixer use*/
> >   static const char *ssm2602_input_select[] = {
> > -	"Line", "Mic", "None", "None", "None",
> > -	"None", "None", "None",
> > +	"Line", "Mic",
> >   };
> 
> I never dared to change it because of the comment above the array. I must 
> admit that I have no idea though why those extra None entries are necessary 
> for OSS.

iirc the OSS input mixer in userspace may expect a similar number of
entries to be compatible with the old Soundblaster16 input mixer ?

Liam 



---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 021/102] ASoC: ssm2602: Omit superfluous elements in input select array
  2014-02-18 13:23     ` Liam Girdwood
@ 2014-02-18 13:29       ` Takashi Iwai
  2014-02-18 15:35         ` Liam Girdwood
  0 siblings, 1 reply; 29+ messages in thread
From: Takashi Iwai @ 2014-02-18 13:29 UTC (permalink / raw
  To: Liam Girdwood; +Cc: alsa-devel, Lars-Peter Clausen, Mark Brown, Liam Girdwood

At Tue, 18 Feb 2014 13:23:27 +0000,
Liam Girdwood wrote:
> 
> On Tue, 2014-02-18 at 12:59 +0100, Lars-Peter Clausen wrote:
> > On 02/18/2014 12:36 PM, Takashi Iwai wrote:
> > > The array contains too many elements although it should have only
> > > two.
> > >
> > > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > > ---
> > >   sound/soc/codecs/ssm2602.c | 9 +++++----
> > >   1 file changed, 5 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
> > > index f444d585b916..e32b82ff6304 100644
> > > --- a/sound/soc/codecs/ssm2602.c
> > > +++ b/sound/soc/codecs/ssm2602.c
> > > @@ -75,15 +75,16 @@ static const u16 ssm2602_reg[SSM2602_CACHEREGNUM] = {
> > >
> > >   /*Appending several "None"s just for OSS mixer use*/
> > >   static const char *ssm2602_input_select[] = {
> > > -	"Line", "Mic", "None", "None", "None",
> > > -	"None", "None", "None",
> > > +	"Line", "Mic",
> > >   };
> > 
> > I never dared to change it because of the comment above the array. I must 
> > admit that I have no idea though why those extra None entries are necessary 
> > for OSS.
> 
> iirc the OSS input mixer in userspace may expect a similar number of
> entries to be compatible with the old Soundblaster16 input mixer ?

But this array is referred as having only two elements,

	SOC_ENUM_SINGLE(SSM2602_APANA, 2, 2, ssm2602_input_select),

so the OSS access (via emulation) won't take more than two, either.


Takashi

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 021/102] ASoC: ssm2602: Omit superfluous elements in input select array
  2014-02-18 13:29       ` Takashi Iwai
@ 2014-02-18 15:35         ` Liam Girdwood
  0 siblings, 0 replies; 29+ messages in thread
From: Liam Girdwood @ 2014-02-18 15:35 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Lars-Peter Clausen, Mark Brown, Liam Girdwood

On Tue, 2014-02-18 at 14:29 +0100, Takashi Iwai wrote:
> At Tue, 18 Feb 2014 13:23:27 +0000,
> Liam Girdwood wrote:
> > 
> > On Tue, 2014-02-18 at 12:59 +0100, Lars-Peter Clausen wrote:
> > > On 02/18/2014 12:36 PM, Takashi Iwai wrote:
> > > > The array contains too many elements although it should have only
> > > > two.
> > > >
> > > > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > > > ---
> > > >   sound/soc/codecs/ssm2602.c | 9 +++++----
> > > >   1 file changed, 5 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
> > > > index f444d585b916..e32b82ff6304 100644
> > > > --- a/sound/soc/codecs/ssm2602.c
> > > > +++ b/sound/soc/codecs/ssm2602.c
> > > > @@ -75,15 +75,16 @@ static const u16 ssm2602_reg[SSM2602_CACHEREGNUM] = {
> > > >
> > > >   /*Appending several "None"s just for OSS mixer use*/
> > > >   static const char *ssm2602_input_select[] = {
> > > > -	"Line", "Mic", "None", "None", "None",
> > > > -	"None", "None", "None",
> > > > +	"Line", "Mic",
> > > >   };
> > > 
> > > I never dared to change it because of the comment above the array. I must 
> > > admit that I have no idea though why those extra None entries are necessary 
> > > for OSS.
> > 
> > iirc the OSS input mixer in userspace may expect a similar number of
> > entries to be compatible with the old Soundblaster16 input mixer ?
> 
> But this array is referred as having only two elements,
> 
> 	SOC_ENUM_SINGLE(SSM2602_APANA, 2, 2, ssm2602_input_select),
> 
> so the OSS access (via emulation) won't take more than two, either.

Hmm, that is quite odd then. Maybe an error on behalf of the original
author or just plain weirdness...

Liam

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 017/102] ASoC: sta32x: Fix array access overflow
  2014-02-18 11:36 ` [PATCH 017/102] ASoC: sta32x: Fix array access overflow Takashi Iwai
@ 2014-02-19 16:46   ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2014-02-19 16:46 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 214 bytes --]

On Tue, Feb 18, 2014 at 12:36:52PM +0100, Takashi Iwai wrote:
> Preset EQ enum of sta32x codec driver declares too many number of
> items and it may lead to the access over the actual array size.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 018/102] ASoC: ad1980: Fix wrong number of items for capture source
  2014-02-18 11:36 ` [PATCH 018/102] ASoC: ad1980: Fix wrong number of items for capture source Takashi Iwai
@ 2014-02-19 16:50   ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2014-02-19 16:50 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 190 bytes --]

On Tue, Feb 18, 2014 at 12:36:53PM +0100, Takashi Iwai wrote:
> The number of capture sources is 8, not 7.
> Use SOC_ENUM_DOUBLE_DECL() macro and it's automatically fixed.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 020/102] ASoC: isabelle: Fix the wrong number of items in enum ctls
  2014-02-18 11:36 ` [PATCH 020/102] ASoC: isabelle: Fix the " Takashi Iwai
@ 2014-02-19 16:53   ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2014-02-19 16:53 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 740 bytes --]

On Tue, Feb 18, 2014 at 12:36:55PM +0100, Takashi Iwai wrote:
> isabelle codec driver has a few places wrongly defining the number of
> enum items.

Applied, thanks.

> Use SOC_ENUM_SINGLE_DECL() macro and they are automatically fixed.

There's also these other fixes not using that:

>  static const struct soc_enum isabelle_rx1_enum[] = {
> -	SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 3, 1, isabelle_rx1_texts),
> -	SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 5, 1, isabelle_rx1_texts),
> +	SOC_ENUM_SINGLE(ISABELLE_VOICE_HPF_CFG_REG, 3,
> +			ARRAY_SIZE(isabelle_rx1_texts), isabelle_rx1_texts),
> +	SOC_ENUM_SINGLE(ISABELLE_AUDIO_HPF_CFG_REG, 5,
> +			ARRAY_SIZE(isabelle_rx1_texts), isabelle_rx1_texts),

but they're fine of course.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 021/102] ASoC: ssm2602: Omit superfluous elements in input select array
  2014-02-18 11:36 ` [PATCH 021/102] ASoC: ssm2602: Omit superfluous elements in input select array Takashi Iwai
  2014-02-18 11:59   ` Lars-Peter Clausen
@ 2014-02-20  1:20   ` Mark Brown
  1 sibling, 0 replies; 29+ messages in thread
From: Mark Brown @ 2014-02-20  1:20 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 155 bytes --]

On Tue, Feb 18, 2014 at 12:36:56PM +0100, Takashi Iwai wrote:
> The array contains too many elements although it should have only
> two.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 022/102] ASoC: wm8400: Fix the wrong number of enum items
  2014-02-18 11:36 ` [PATCH 022/102] ASoC: wm8400: Fix the wrong number of enum items Takashi Iwai
@ 2014-02-20  1:21   ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2014-02-20  1:21 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 164 bytes --]

On Tue, Feb 18, 2014 at 12:36:57PM +0100, Takashi Iwai wrote:
> wm8400 codec driver has a few places wrongly defining the number of
> enum items.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 023/102] ASoC: wm8770: Fix wrong number of enum items
  2014-02-18 11:36 ` [PATCH 023/102] ASoC: wm8770: Fix " Takashi Iwai
@ 2014-02-20  1:24   ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2014-02-20  1:24 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 149 bytes --]

On Tue, Feb 18, 2014 at 12:36:58PM +0100, Takashi Iwai wrote:
> wm8770 codec driver defines ain_enum with a wrong number of items.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 024/102] ASoC: wm8900: Fix the wrong number of enum items
  2014-02-18 11:36 ` [PATCH 024/102] ASoC: wm8900: Fix the " Takashi Iwai
@ 2014-02-20  1:28   ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2014-02-20  1:28 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 164 bytes --]

On Tue, Feb 18, 2014 at 12:36:59PM +0100, Takashi Iwai wrote:
> wm8900 codec driver has a few places wrongly defining the number of
> enum items.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 025/102] ASoC: wm8990: Fix the wrong number of enum items
  2014-02-18 11:37 ` [PATCH 025/102] ASoC: wm8990: " Takashi Iwai
@ 2014-02-20  1:30   ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2014-02-20  1:30 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 164 bytes --]

On Tue, Feb 18, 2014 at 12:37:00PM +0100, Takashi Iwai wrote:
> wm8990 codec driver has a few places wrongly defining the number of
> enum items.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 026/102] ASoC: wm8991: Fix the wrong number of enum items
  2014-02-18 11:37 ` [PATCH 026/102] ASoC: wm8991: " Takashi Iwai
@ 2014-02-20  1:32   ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2014-02-20  1:32 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 164 bytes --]

On Tue, Feb 18, 2014 at 12:37:01PM +0100, Takashi Iwai wrote:
> wm8991 codec driver has a few places wrongly defining the number of
> enum items.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 027/102] ASoC: wm8994: Fix the wrong number of enum items
  2014-02-18 11:37 ` [PATCH 027/102] ASoC: wm8994: " Takashi Iwai
@ 2014-02-20  1:33   ` Mark Brown
  0 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2014-02-20  1:33 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 164 bytes --]

On Tue, Feb 18, 2014 at 12:37:02PM +0100, Takashi Iwai wrote:
> wm8994 codec driver has a few places wrongly defining the number of
> enum items.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 019/102] ASoC: arizona: Fix wrong number of items in enum ctls
  2014-02-18 11:36 ` [PATCH 019/102] ASoC: arizona: Fix wrong number of items in enum ctls Takashi Iwai
  2014-02-18 11:54   ` Takashi Iwai
@ 2014-02-20  1:58   ` Mark Brown
  1 sibling, 0 replies; 29+ messages in thread
From: Mark Brown @ 2014-02-20  1:58 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 165 bytes --]

On Tue, Feb 18, 2014 at 12:36:54PM +0100, Takashi Iwai wrote:
> arizona codec driver has a few places wrongly defining the number of
> enum items.

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: [PATCH 000/102 - chunk#3] Actually fix wrong enum items
  2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
                   ` (10 preceding siblings ...)
  2014-02-18 11:37 ` [PATCH 027/102] ASoC: wm8994: " Takashi Iwai
@ 2014-02-20  2:05 ` Mark Brown
  11 siblings, 0 replies; 29+ messages in thread
From: Mark Brown @ 2014-02-20  2:05 UTC (permalink / raw
  To: Takashi Iwai; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 666 bytes --]

On Tue, Feb 18, 2014 at 12:36:51PM +0100, Takashi Iwai wrote:
> Now, this patch chunk fixes the actual bugs in various codec drivers
> that have either off-by-one number of items or lead to array overflow.
> 
> sta32x is the latter one, and this can be picked up for 3.14, too.
> 
> The other off-by-one fixes would change the driver behavior (now user
> will see more items), thus they are potential regression risks
> although the "fixes" are correct, per se.

Since these are actual bug fixes they should probably have been at the
start of the series rather than dropped into the middle of it, this
makes it easier to direct them to the right place.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2014-02-20  2:26 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-18 11:36 [PATCH 000/102 - chunk#3] Actually fix wrong enum items Takashi Iwai
2014-02-18 11:36 ` [PATCH 017/102] ASoC: sta32x: Fix array access overflow Takashi Iwai
2014-02-19 16:46   ` Mark Brown
2014-02-18 11:36 ` [PATCH 018/102] ASoC: ad1980: Fix wrong number of items for capture source Takashi Iwai
2014-02-19 16:50   ` Mark Brown
2014-02-18 11:36 ` [PATCH 019/102] ASoC: arizona: Fix wrong number of items in enum ctls Takashi Iwai
2014-02-18 11:54   ` Takashi Iwai
2014-02-20  1:58   ` Mark Brown
2014-02-18 11:36 ` [PATCH 020/102] ASoC: isabelle: Fix the " Takashi Iwai
2014-02-19 16:53   ` Mark Brown
2014-02-18 11:36 ` [PATCH 021/102] ASoC: ssm2602: Omit superfluous elements in input select array Takashi Iwai
2014-02-18 11:59   ` Lars-Peter Clausen
2014-02-18 13:23     ` Liam Girdwood
2014-02-18 13:29       ` Takashi Iwai
2014-02-18 15:35         ` Liam Girdwood
2014-02-20  1:20   ` Mark Brown
2014-02-18 11:36 ` [PATCH 022/102] ASoC: wm8400: Fix the wrong number of enum items Takashi Iwai
2014-02-20  1:21   ` Mark Brown
2014-02-18 11:36 ` [PATCH 023/102] ASoC: wm8770: Fix " Takashi Iwai
2014-02-20  1:24   ` Mark Brown
2014-02-18 11:36 ` [PATCH 024/102] ASoC: wm8900: Fix the " Takashi Iwai
2014-02-20  1:28   ` Mark Brown
2014-02-18 11:37 ` [PATCH 025/102] ASoC: wm8990: " Takashi Iwai
2014-02-20  1:30   ` Mark Brown
2014-02-18 11:37 ` [PATCH 026/102] ASoC: wm8991: " Takashi Iwai
2014-02-20  1:32   ` Mark Brown
2014-02-18 11:37 ` [PATCH 027/102] ASoC: wm8994: " Takashi Iwai
2014-02-20  1:33   ` Mark Brown
2014-02-20  2:05 ` [PATCH 000/102 - chunk#3] Actually fix wrong " Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.