linux/drivers/staging/most
Bhumika Goyal cfb459edaa 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>
2016-09-27 13:06:55 +02:00
..
aim-cdev staging: most: aim-cdev: make syscall write accept buffers of arbitrary size 2016-09-23 19:00:44 +02:00
aim-network staging: most: aim-network: fix interrupt unsafe spinlocks 2016-08-18 17:24:00 +02:00
aim-sound Staging: most: aim-sound: constify snd_pcm_ops structures 2016-09-27 13:06:55 +02:00
aim-v4l2 staging: most: replace MOST_CH_ISOC_AVP with MOST_CH_ISOC 2016-09-22 11:54:47 +02:00
Documentation staging: most: Documentation: update ABI description 2016-09-12 09:47:15 +02:00
hdm-dim2 staging: most: replace MOST_CH_ISOC_AVP with MOST_CH_ISOC 2016-09-22 11:54:47 +02:00
hdm-i2c staging: most: use preferred kernel types 2015-10-24 19:08:20 -07:00
hdm-usb staging: most: replace MOST_CH_ISOC_AVP with MOST_CH_ISOC 2016-09-22 11:54:47 +02:00
mostcore staging: most: replace MOST_CH_ISOC_AVP with MOST_CH_ISOC 2016-09-22 11:54:47 +02:00
Kconfig Staging: most: MOST and MOSTCORE should depend on HAS_DMA 2015-09-13 09:24:44 -07:00
Makefile
TODO