Thread (2 messages) flat view 2 messages, 2 authors, 2021-07-28
STALE1884d LANDED

Landed in mainline as 64cd4271ea8e on 2021-07-29.

[PATCH] usb: gadget: pxa25x_udc: Constify static struct pxa25x_ep_ops

From: Rikard Falkeborn <hidden>
Date: 2021-07-28 09:21:03
Also in: linux-arm-kernel, lkml
Subsystem: pxa2xx/pxa3xx support, the rest, usb subsystem · Maintainers: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Linus Torvalds, Greg Kroah-Hartman

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 <redacted>
---
 drivers/usb/gadget/udc/pxa25x_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
index 69ef1e669d0c..a09ec1d826b2 100644
--- a/drivers/usb/gadget/udc/pxa25x_udc.c
+++ b/drivers/usb/gadget/udc/pxa25x_udc.c
@@ -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,
 
-- 
2.32.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help