Skip to contentSkip to conversation

drivers/usb/gadget/config.c: make a function static

PATCH In review Adrian Bunk 2 participants 2 messages Mar 1, 2005 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/usb/gadget/config.c: make a function static

This patch makes a needlessly global function static.

---

 drivers/usb/gadget/config.c |    2 +-
 include/linux/usb_gadget.h  |    6 ------
 2 files changed, 1 insertion(+), 7 deletions(-)
include/linux/usb_gadget.h renamed from include/linux/usb_gadget.h.old +0 -6
@@ -854,12 +854,6 @@
 
 /*-------------------------------------------------------------------------*/
 
-/* utility to simplify managing config descriptors */
-
-/* write vector of descriptors into buffer */
-int usb_descriptor_fillbuf(void *, unsigned,
-		const struct usb_descriptor_header **);
-
 /* build config descriptor from single descriptor vector */
 int usb_gadget_config_buf(const struct usb_config_descriptor *config,
 	void *buf, unsigned buflen, const struct usb_descriptor_header **desc);
drivers/usb/gadget/config.c renamed from drivers/usb/gadget/config.c.old +1 -1
@@ -39,7 +39,7 @@
  * as part of configuring a composite device; or in other cases where
  * sets of descriptors need to be marshaled.
  */
-int
+static int
 usb_descriptor_fillbuf(void *buf, unsigned buflen,
 		const struct usb_descriptor_header **src)
 {
#1 lore raw
Quoted 1 line · Adrian Bunk

This patch makes a needlessly global function static.

You sent this before, and time hasn't improved it. This function is exported to support composite (multi-function) devices, which need to assemble config descriptors in chunks (config + N* function) instead of all-at-once (config + single function).

Quoted 38 lines

---

 drivers/usb/gadget/config.c |    2 +-
 include/linux/usb_gadget.h  |    6 ------
 2 files changed, 1 insertion(+), 7 deletions(-)
include/linux/usb_gadget.h renamed from include/linux/usb_gadget.h.old +0 -6
@@ -854,12 +854,6 @@
 
 /*-------------------------------------------------------------------------*/
 
-/* utility to simplify managing config descriptors */
-
-/* write vector of descriptors into buffer */
-int usb_descriptor_fillbuf(void *, unsigned,
-		const struct usb_descriptor_header **);
-
 /* build config descriptor from single descriptor vector */
 int usb_gadget_config_buf(const struct usb_config_descriptor *config,
 	void *buf, unsigned buflen, const struct usb_descriptor_header **desc);
drivers/usb/gadget/config.c renamed from drivers/usb/gadget/config.c.old +1 -1
@@ -39,7 +39,7 @@
  * as part of configuring a composite device; or in other cases where
  * sets of descriptors need to be marshaled.
  */
-int
+static int
 usb_descriptor_fillbuf(void *buf, unsigned buflen,
 		const struct usb_descriptor_header **src)
 {