Re: [PATCH 00/42] ASoC: Replace users of TLV_DB_RANGE_HEAD

Charles Keepax
2015-08-07T08:26:05Z

On Sun, Aug 02, 2015 at 05:19:28PM +0200, Lars-Peter Clausen wrote:
> Usage of TLV_DB_RANGE_HEAD() is deprecated in favor of
> DECLARE_TLV_DB_RANGE(). The reason for this is that the former requires to
> specify the number of items inside the range container while the later is
> able to calculate this automatically and hence leaves less room for error.
>
> While non of the current users of TLV_DB_RANGE_HEAD() gets it wrong it
> still makes sense to clean this up since existing drivers are often used as
> templates for new drivers. As an added bonus the code is also slightly
> shorter.
>
> There are also a few drivers which use TLV_DB_RANGE_HEAD() with only a
> single sub-item. Those are updated to not use a range container at all
> since it is not necessary.
>
> Most of the conversion was auto-generated 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>
>
> - Lars
>

For the Wolfson parts:

Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

Thanks,
Charles