Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: alc5623: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE

DECLARE_TLV_DB_RANGE() has the advantage over using TLV_DB_RANGE_HEAD()
that it automatically calculates the number of items in the TLV and is
hence less prone to manual error.

Generate using the following coccinelle script

// <smpl>
@@
declarer name DECLARE_TLV_DB_RANGE;
identifier tlv;
constant x;
@@
-unsigned int tlv[] = {
- TLV_DB_RANGE_HEAD(x),
+DECLARE_TLV_DB_RANGE(tlv,
...
-};
+);
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Lars-Peter Clausen and committed by
Mark Brown
c8aeb0f6 31581f3c

+3 -4
+3 -4
sound/soc/codecs/alc5623.c
··· 82 82 static const DECLARE_TLV_DB_SCALE(vol_tlv, -3450, 150, 0); 83 83 static const DECLARE_TLV_DB_SCALE(hp_tlv, -4650, 150, 0); 84 84 static const DECLARE_TLV_DB_SCALE(adc_rec_tlv, -1650, 150, 0); 85 - static const unsigned int boost_tlv[] = { 86 - TLV_DB_RANGE_HEAD(3), 85 + static const DECLARE_TLV_DB_RANGE(boost_tlv, 87 86 0, 0, TLV_DB_SCALE_ITEM(0, 0, 0), 88 87 1, 1, TLV_DB_SCALE_ITEM(2000, 0, 0), 89 - 2, 2, TLV_DB_SCALE_ITEM(3000, 0, 0), 90 - }; 88 + 2, 2, TLV_DB_SCALE_ITEM(3000, 0, 0) 89 + ); 91 90 static const DECLARE_TLV_DB_SCALE(dig_tlv, 0, 600, 0); 92 91 93 92 static const struct snd_kcontrol_new alc5621_vol_snd_controls[] = {