* [PATCH] usb: gadget: pxa25x_udc: Constify static struct pxa25x_ep_ops
@ 2021-07-28 9:20 Rikard Falkeborn
2021-07-28 9:25 ` Felipe Balbi
0 siblings, 1 reply; 2+ messages in thread
From: Rikard Falkeborn @ 2021-07-28 9:20 UTC (permalink / raw)
To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Felipe Balbi,
Greg Kroah-Hartman
Cc: linux-arm-kernel, linux-usb, linux-kernel, Rikard Falkeborn
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 <rikard.falkeborn@gmail.com>
---
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: gadget: pxa25x_udc: Constify static struct pxa25x_ep_ops
2021-07-28 9:20 [PATCH] usb: gadget: pxa25x_udc: Constify static struct pxa25x_ep_ops Rikard Falkeborn
@ 2021-07-28 9:25 ` Felipe Balbi
0 siblings, 0 replies; 2+ messages in thread
From: Felipe Balbi @ 2021-07-28 9:25 UTC (permalink / raw)
To: Rikard Falkeborn
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Greg Kroah-Hartman,
linux-arm-kernel, linux-usb, linux-kernel
Rikard Falkeborn <rikard.falkeborn@gmail.com> writes:
> 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 <rikard.falkeborn@gmail.com>
Acked-by: Felipe Balbi <balbi@kernel.org>
--
balbi
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-07-28 9:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-28 9:20 [PATCH] usb: gadget: pxa25x_udc: Constify static struct pxa25x_ep_ops Rikard Falkeborn
2021-07-28 9:25 ` Felipe Balbi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).