* [v8,1/2] usb/gadget: Constify usb_gadget_get_string "table" argument
@ 2018-03-29 2:56 Benjamin Herrenschmidt
0 siblings, 0 replies; only message in thread
From: Benjamin Herrenschmidt @ 2018-03-29 2:56 UTC (permalink / raw)
To: linux-usb
Cc: Felipe Balbi, Greg KH, Joel Stanley, Andrew Jeffery,
Benjamin Herrenschmidt
The table is never modified by the function. This allows us
to use it on a statically defined table that is marked const.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
drivers/usb/gadget/usbstring.c | 2 +-
include/linux/usb/gadget.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c
index 566ab261e8b7..7c24d1ce1088 100644
--- a/drivers/usb/gadget/usbstring.c
+++ b/drivers/usb/gadget/usbstring.c
@@ -33,7 +33,7 @@
* characters (which are also widely used in C strings).
*/
int
-usb_gadget_get_string (struct usb_gadget_strings *table, int id, u8 *buf)
+usb_gadget_get_string (const struct usb_gadget_strings *table, int id, u8 *buf)
{
struct usb_string *s;
int len;
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index e3424234b23a..64e7c159d534 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -763,7 +763,7 @@ struct usb_gadget_string_container {
};
/* put descriptor for string with that id into buf (buflen >= 256) */
-int usb_gadget_get_string(struct usb_gadget_strings *table, int id, u8 *buf);
+int usb_gadget_get_string(const struct usb_gadget_strings *table, int id, u8 *buf);
/*-------------------------------------------------------------------------*/
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-03-29 2:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-29 2:56 [v8,1/2] usb/gadget: Constify usb_gadget_get_string "table" argument Benjamin Herrenschmidt
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).