diff options
author | Bhumika Goyal <bhumirks@gmail.com> | 2016-10-09 13:26:28 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-16 10:25:08 +0200 |
commit | 03f705d285ea7cc582f3f86e8a1c73fbd2f261d4 (patch) | |
tree | 3b54a626458590f636590812adfe5c35d3521232 /drivers/staging/emxx_udc | |
parent | 15fb2af604d602373cd4dafb88143adb03463001 (diff) |
Staging: emxx_udc: constify usb_ep_ops structure
Declare the structure usb_ep_ops as constant as it is only stored in the
ops field of a usb_ep structure which is a field of a nbu2ss_ep structure.
The ops field is of type const struct usb_ep_ops *, so usb_ep_ops
structures having this property can be decalared as const.
Done using coccinelle:
@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct usb_ep_ops i@p = {...};
@ok1@
identifier r1.i;
position p;
struct nbu2ss_ep s;
@@
s.ep.ops=&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 usb_ep_ops i={...};
@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct usb_ep_ops i;
File size before:
text data bss dec hex filename
16007 376 3720 20103 4e87
drivers/staging/emxx_udc/emxx_udc.o
File size after:
text data bss dec hex filename
16095 280 3720 20095 4e7f
drivers/staging/emxx_udc/emxx_udc.o
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/emxx_udc')
-rw-r--r-- | drivers/staging/emxx_udc/emxx_udc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index 5d7dc00713f5..abe2aafc8bd4 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -2938,7 +2938,7 @@ static void nbu2ss_ep_fifo_flush(struct usb_ep *_ep) } /*-------------------------------------------------------------------------*/ -static struct usb_ep_ops nbu2ss_ep_ops = { +static const struct usb_ep_ops nbu2ss_ep_ops = { .enable = nbu2ss_ep_enable, .disable = nbu2ss_ep_disable, |