ASoC: Rename soc_enum.max field with items
The name "max" in struct soc_enum is rather confusing since it actually takes the number of items. With "max", one might try to assign (nitems - 1) value. Rename the field to a more appropriate one, "items", which is also used in struct snd_ctl_elem_info, too. This patch also rewrites some code like "if (x > e->nitems - 1)" with "if (x >= e->nitems)". Not only the latter improves the readability, it also fixes a potential bug when e->items is zero. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
这个提交包含在:
@@ -2595,7 +2595,7 @@ static void wm8996_retune_mobile_pdata(struct snd_soc_codec *codec)
|
||||
dev_dbg(codec->dev, "Allocated %d unique ReTune Mobile names\n",
|
||||
wm8996->num_retune_mobile_texts);
|
||||
|
||||
wm8996->retune_mobile_enum.max = wm8996->num_retune_mobile_texts;
|
||||
wm8996->retune_mobile_enum.items = wm8996->num_retune_mobile_texts;
|
||||
wm8996->retune_mobile_enum.texts = wm8996->retune_mobile_texts;
|
||||
|
||||
ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
|
||||
|
在新工单中引用
屏蔽一个用户