Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb/gadget: Constify usb_gadget_get_string "table" argument

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>

authored by

Benjamin Herrenschmidt and committed by
Felipe Balbi
655016dc 5d1332a8

+2 -2
+1 -1
drivers/usb/gadget/usbstring.c
··· 33 33 * characters (which are also widely used in C strings). 34 34 */ 35 35 int 36 - usb_gadget_get_string (struct usb_gadget_strings *table, int id, u8 *buf) 36 + usb_gadget_get_string (const struct usb_gadget_strings *table, int id, u8 *buf) 37 37 { 38 38 struct usb_string *s; 39 39 int len;
+1 -1
include/linux/usb/gadget.h
··· 763 763 }; 764 764 765 765 /* put descriptor for string with that id into buf (buflen >= 256) */ 766 - int usb_gadget_get_string(struct usb_gadget_strings *table, int id, u8 *buf); 766 + int usb_gadget_get_string(const struct usb_gadget_strings *table, int id, u8 *buf); 767 767 768 768 /*-------------------------------------------------------------------------*/ 769 769