ASoC: Rename soc_enum.max field with items
authorTakashi Iwai <tiwai@suse.de>
Tue, 18 Feb 2014 07:11:42 +0000 (08:11 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 20 Feb 2014 01:42:53 +0000 (10:42 +0900)
commit9a8d38db030f016bee45b927af02d9b46398ed46
tree3f0e1d8e3d42778880caf5ac6f4bfef6e96dc5c0
parent38dbfb59d1175ef458d006556061adeaa8751b72
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>
include/sound/soc.h
sound/soc/codecs/max98088.c
sound/soc/codecs/max98095.c
sound/soc/codecs/twl4030.c
sound/soc/codecs/wm8904.c
sound/soc/codecs/wm8958-dsp2.c
sound/soc/codecs/wm8994.c
sound/soc/codecs/wm8996.c
sound/soc/omap/ams-delta.c
sound/soc/soc-core.c
sound/soc/soc-dapm.c
This page took 0.028013 seconds and 5 git commands to generate.