[alsa-devel] [PATCH] ASoC: intel: mfld: Make static string arrays 'const 'char * const []'

Vinod Koul vinod.koul at intel.com
Wed Nov 16 03:51:59 CET 2016


On Tue, Nov 15, 2016 at 09:40:45PM +0100, Lars-Peter Clausen wrote:
> const char * const [] is the preferred type for static string arrays since
> this states explicitly that the individual entries are not going to be
> changed. Due to limitations in the ASoC API it was not possible to use it
> for enum text arrays. Commit 87023ff74b23 ("ASoC: Declare const properly
> for enum texts") changed this, but most drivers still use 'const char
> * []' as the type for their enum text arrays.
> 
> Change these occurrences of 'static * const char * []' to 'static const
> char * const []'.
> 
> The conversion was done automatically using the following coccinelle
> semantic patch:
> // <smpl>
> @disable optional_qualifier@
> identifier s;
> @@
>  static
> -const char *
> +const char * const
>  s[] = ...;
> // </smpl>
> 
> Signed-off-by: Lars-Peter Clausen <lars at metafoo.de>

Acked-by: Vinod Koul <vinod.koul at intel.com>

-- 
~Vinod


More information about the Alsa-devel mailing list