浏览代码

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>
Benjamin Herrenschmidt 7 年之前
父节点
当前提交
655016dc2d
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      drivers/usb/gadget/usbstring.c
  2. 1 1
      include/linux/usb/gadget.h

+ 1 - 1
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;

+ 1 - 1
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);
 
 /*-------------------------------------------------------------------------*/