]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb/gadget: Constify usb_gadget_get_string "table" argument
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 3 May 2018 20:59:42 +0000 (06:59 +1000)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 15 May 2018 07:06:49 +0000 (10:06 +0300)
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>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/usbstring.c
include/linux/usb/gadget.h

index 566ab261e8b79bb0770215339e08ec5ccccec359..7c24d1ce10889aaf77fa16d43d2c8e625d514e49 100644 (file)
@@ -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;
index 847f423ad9b3481bc60a811b2e16439f10b764ed..e5cd84a0f84ad78a41da7d406884c33886f09d07 100644 (file)
@@ -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);
 
 /*-------------------------------------------------------------------------*/