usb: gadget: tegra-xudc: Constify static structs
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Thu, 13 May 2021 20:09:08 +0000 (22:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 May 2021 12:05:21 +0000 (14:05 +0200)
Constify a couple of ops-structs that are never modified, to let the
compiler put them in read-only memory.

Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210513200908.448351-1-rikard.falkeborn@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/tegra-xudc.c

index 2319c97..66b19db 100644 (file)
@@ -1907,7 +1907,7 @@ static void tegra_xudc_ep_free_request(struct usb_ep *usb_ep,
        kfree(req);
 }
 
-static struct usb_ep_ops tegra_xudc_ep_ops = {
+static const struct usb_ep_ops tegra_xudc_ep_ops = {
        .enable = tegra_xudc_ep_enable,
        .disable = tegra_xudc_ep_disable,
        .alloc_request = tegra_xudc_ep_alloc_request,
@@ -1928,7 +1928,7 @@ static int tegra_xudc_ep0_disable(struct usb_ep *usb_ep)
        return -EBUSY;
 }
 
-static struct usb_ep_ops tegra_xudc_ep0_ops = {
+static const struct usb_ep_ops tegra_xudc_ep0_ops = {
        .enable = tegra_xudc_ep0_enable,
        .disable = tegra_xudc_ep0_disable,
        .alloc_request = tegra_xudc_ep_alloc_request,
@@ -2168,7 +2168,7 @@ static int tegra_xudc_set_selfpowered(struct usb_gadget *gadget, int is_on)
        return 0;
 }
 
-static struct usb_gadget_ops tegra_xudc_gadget_ops = {
+static const struct usb_gadget_ops tegra_xudc_gadget_ops = {
        .get_frame = tegra_xudc_gadget_get_frame,
        .wakeup = tegra_xudc_gadget_wakeup,
        .pullup = tegra_xudc_gadget_pullup,