usb: gadget: pxa25x_udc: Constify static struct pxa25x_ep_ops
Subsystems (2)
PATCH 1/1 usb: gadget: pxa25x_udc: Constify static struct pxa25x_ep_ops
The struct pxa25x_ep_ops is only assigned to the ops field in the usb_ep struct, which is a pointer to const struct usb_ep_ops. Make it const to allow the compiler to put it in read-only memory.
Signed-off-by Rikard Falkeborn <[email protected]>
--- drivers/usb/gadget/udc/pxa25x_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/pxa25x_udc.c +1 -1
@@ -1093,7 +1093,7 @@ static void pxa25x_ep_fifo_flush(struct usb_ep *_ep) } -static struct usb_ep_ops pxa25x_ep_ops = { +static const struct usb_ep_ops pxa25x_ep_ops = { .enable = pxa25x_ep_enable, .disable = pxa25x_ep_disable,
Signature · 1 line
2.32.0
Quoted 5 lines · Rikard Falkeborn
The struct
pxa25x_ep_opsis only assigned to the ops field in theusb_epstruct, which is a pointer to const structusb_ep_ops. Make it const to allow the compiler to put it in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>
Acked-by Felipe Balbi <[email protected]>
Signature · 1 line
balbi