linux/drivers/usb/isp1760
Bhumika Goyal 3774e02c74 usb: isp1760: constify usb_gadget_ops structures
Declare usb_gadget_ops structures as const as they are only stored in
the ops field of a usb_gadget structure. This field is of type const, so
usb_gadget_ops structures having this property can be declared const
too.
Done using Coccinelle:

@r1 disable optional_qualifier@
identifier i;
position p;
@@
static struct usb_gadget_ops i@p={...};

@ok1@
identifier r1.i;
position p;
struct isp1760_udc udc;
@@
udc.gadget.ops=&i@p

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct usb_gadget_ops i;

File size before: drivers/usb/isp1760/isp1760-udc.o
   text	   data	    bss	    dec	    hex	filename
  12434	   4136	     16	  16586	   40ca	usb/isp1760/isp1760-udc.o

File size after: drivers/usb/isp1760/isp1760-udc.o
   text	   data	    bss	    dec	    hex	filename
  12530	   4048	     16	  16594	   40d2	usb/isp1760/isp1760-udc.o

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-19 10:34:45 +01:00
..
isp1760-core.c usb: isp1760: set IRQ flags properly 2015-03-09 10:46:15 -05:00
isp1760-core.h
isp1760-hcd.c usb: generic resume timeout for v4.1 2015-04-10 13:45:27 +02:00
isp1760-hcd.h
isp1760-if.c usb: Convert pr_warning to pr_warn 2016-10-24 14:36:25 +02:00
isp1760-regs.h
isp1760-udc.c usb: isp1760: constify usb_gadget_ops structures 2017-01-19 10:34:45 +01:00
isp1760-udc.h
Kconfig
Makefile