Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1718371
| From | Takashi Iwai <tiwai@suse.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] ALSA: ctxfi: make hw structures const |
| Date | 2017-08-23 16:00 +0200 |
| Message-ID | <uhEml-1ex-5@gated-at.bofh.it> (permalink) |
| References | <uhCXg-u4-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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@p
>
> @good1@
> position ref.p;
> identifier match.s,f,c;
> expression e;
> @@
> (
> e = s@p
> |
> e = s@p.f
> |
> c(...,s@p.f,...)
> |
> c(...,s@p,...)
> )
>
> @bad depends on !good1@
> position ref.p;
> identifier match.s;
> @@
> s@p
>
> @depends on forall !bad disable optional_qualifier@
> identifier match.s;
> @@
> static
> + const
> struct hw s;
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Applied, thanks.
Takashi
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] ALSA: ctxfi: make hw structures const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-23 14:30 +0200 Re: [PATCH] ALSA: ctxfi: make hw structures const Takashi Iwai <tiwai@suse.de> - 2017-08-23 16:00 +0200
csiph-web