linux/drivers/usb/gadget
Bhumika Goyal 5954a5046b usb: gadget: 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 fotg210_udc fotg210;
@@
fotg210.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:
   text	   data	    bss	    dec	    hex	filename
   7559	    384	      8	   7951	   1f0f	usb/gadget/udc/fotg210-udc.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   7655	    288	      8	   7951	   1f0f	usb/gadget/udc/fotg210-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
..
function usb: gadget: Fix copy/pasted error message 2017-01-03 14:33:59 +02:00
legacy USB: gadgetfs: remove unnecessary assignment 2017-01-02 10:55:28 +02:00
udc usb: gadget: constify usb_gadget_ops structures 2017-01-19 10:34:45 +01:00
Kconfig usb: gadget: uvc: add V4L2 dependency 2016-09-13 09:29:08 +03:00
Makefile usb: gadget: use $(srctree) instead of $(PWD) for includes 2014-08-29 15:53:46 -05:00
composite.c usb: gadget: composite: Test get_alt() presence instead of set_alt() 2017-01-02 10:55:28 +02:00
config.c usb: Use (foo *) instead of (foo*). 2016-06-21 11:16:15 +03:00
configfs.c fs: configfs: don't return anything from drop_link 2016-12-01 10:50:49 +01:00
configfs.h usb: gadget: OS descriptors: provide interface directory names 2014-06-19 10:06:48 -05:00
epautoconf.c usb: gadget: epautoconf: add usb_ep_autoconfig_release() function 2015-09-27 10:54:31 -05:00
functions.c
u_f.c usb: gadget: remove useless parameter in alloc_ep_req() 2016-08-25 12:13:19 +03:00
u_f.h usb: gadget: remove useless parameter in alloc_ep_req() 2016-08-25 12:13:19 +03:00
u_os_desc.h usb: gadget: u_os_desc: helper functions for accessing ext prop buffer 2014-07-10 08:36:51 -05:00
usbstring.c usb: delete non-required instances of include <linux/init.h> 2014-01-08 15:01:39 -08:00