[alsa-devel] [PATCH] ALSA: ctxfi: make hw structures const

Takashi Iwai tiwai at suse.de
Wed Aug 23 15:55:36 CEST 2017


On Wed, 23 Aug 2017 14:28:42 +0200,
Bhumika Goyal wrote:
> 
> Make these const as they are only used in a copy operation.
> Done using Coccinelle:
> 
> @match disable optional_qualifier@
> identifier s;
> @@
> static struct hw s = {...};
> 
> @ref@
> position p;
> identifier match.s;
> @@
> s at p
> 
> @good1@
> position ref.p;
> identifier match.s,f,c;
> expression e;
> @@
> (
> e = s at p
> |
> e = s at p.f
> |
> c(...,s at p.f,...)
> |
> c(...,s at p,...)
> )
> 
> @bad depends on  !good1@
> position ref.p;
> identifier match.s;
> @@
> s at p
> 
> @depends on forall !bad disable optional_qualifier@
> identifier match.s;
> @@
> static
> + const
> struct hw s;
> 
> Signed-off-by: Bhumika Goyal <bhumirks at gmail.com>

Applied, thanks.


Takashi


More information about the Alsa-devel mailing list