diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2016-09-26 23:09:03 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-27 13:06:55 +0200 |
commit | cfb459edaa91d624e42a959f0356d341a3347c76 (patch) | |
tree | c0cc6757b976e27e464bb2d0b7f247f103b146f7 /drivers/staging | |
parent | ca8b3fa7ea44738f02979dfdc72a1d75a27dcddb (diff) |
Staging: most: aim-sound: constify snd_pcm_ops structures
Check for snd_pcm_ops structures that are only passed as the third
argument to the function snd_pcm_set_ops. As this argument is
constant, so snd_pcm_ops structures having this property can also be
made constant.
Done using coccinelle:
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct snd_pcm_ops i@p = {...};
@ok1@
identifier r1.i;
position p;
expression e1,e2;
@@
snd_pcm_set_ops(e1,e2,&i@p)
@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct snd_pcm_ops i={...};
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct snd_pcm_ops i;
File size before:
text data bss dec hex filename
4963 192 16 5171 1433
drivers/staging/most/aim-sound/sound.o
File size after:
text data bss dec hex filename
5075 64 16 5155 1423
drivers/staging/most/aim-sound/sound.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/most/aim-sound/sound.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/most/aim-sound/sound.c b/drivers/staging/most/aim-sound/sound.c index 00f01c91e389..e4198e5e064b 100644 --- a/drivers/staging/most/aim-sound/sound.c +++ b/drivers/staging/most/aim-sound/sound.c @@ -453,7 +453,7 @@ static snd_pcm_uframes_t pcm_pointer(struct snd_pcm_substream *substream) /** * Initialization of struct snd_pcm_ops */ -static struct snd_pcm_ops pcm_ops = { +static const struct snd_pcm_ops pcm_ops = { .open = pcm_open, .close = pcm_close, .ioctl = snd_pcm_lib_ioctl, |