linux/drivers/vhost
Bhumika Goyal 1d822a40b8 vhost: scsi: constify target_core_fabric_ops structures
Declare target_core_fabric_ops strucrues as const as they are only
passed as an argument to the functions target_register_template and
target_unregister_template. The arguments are of type const struct
target_core_fabric_ops *, so target_core_fabric_ops structures having
this property can be declared const.
Done using Coccinelle:

@r disable optional_qualifier@
identifier i;
position p;
@@
static struct target_core_fabric_ops i@p={...};

@ok@
position p;
identifier r.i;
@@
(
target_register_template(&i@p)
|
target_unregister_template(&i@p)
)
@bad@
position p!={r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
+const
struct target_core_fabric_ops i;

File size before: drivers/vhost/scsi.o
   text	   data	    bss	    dec	    hex	filename
  18063	   2985	     40	  21088	   5260	drivers/vhost/scsi.o

File size after: drivers/vhost/scsi.o
   text	   data	    bss	    dec	    hex	filename
  18479	   2601	     40	  21120	   5280	drivers/vhost/scsi.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
2017-01-19 23:46:29 +02:00
..
Kconfig vhost: split out vringh Kconfig 2016-08-02 16:54:28 +03:00
Kconfig.vringh vhost: split out vringh Kconfig 2016-08-02 16:54:28 +03:00
Makefile VSOCK: Add Makefile and Kconfig 2016-08-02 02:57:30 +03:00
net.c locking/core: Remove cpu_relax_lowlatency() users 2016-11-16 10:15:10 +01:00
scsi.c vhost: scsi: constify target_core_fabric_ops structures 2017-01-19 23:46:29 +02:00
test.c Merge 4.8-rc5 into char-misc-next 2016-09-05 08:04:07 +02:00
test.h vhost test module 2010-12-09 16:00:21 +02:00
vhost.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-12-16 10:24:44 -08:00
vhost.h vhost: cache used event for better performance 2016-12-16 00:12:50 +02:00
vringh.c vringh: kill off ACCESS_ONCE() 2016-12-16 00:13:36 +02:00
vsock.c vsock: lookup and setup guest_cid inside vhost_vsock_lock 2016-12-16 00:12:49 +02:00