Skip to content

Commit

Permalink
usb/gadget: Constify usb_gadget_get_string "table" argument
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ozbenh authored and Felipe Balbi committed May 15, 2018
1 parent 5d1332a commit 655016d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/usbstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion include/linux/usb/gadget.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*-------------------------------------------------------------------------*/

Expand Down

0 comments on commit 655016d

Please sign in to comment.