From 7b75a32ca1ba4c187d33a6fcbba7d180c52be15a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 31 Aug 2016 08:16:12 -0600 Subject: [PATCH] Improve some comments --- drivers/usbhost/usbhost_composite.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/usbhost/usbhost_composite.c b/drivers/usbhost/usbhost_composite.c index d0b294d74c..67a2c42426 100644 --- a/drivers/usbhost/usbhost_composite.c +++ b/drivers/usbhost/usbhost_composite.c @@ -579,7 +579,7 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport, /* Check for IAD descriptors that will be used when it is * necessary to associate multiple interfaces with a single - * device. + * class driver. */ else if (desc->type == USB_DESC_TYPE_INTERFACEASSOCIATION) @@ -587,7 +587,7 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport, FAR struct usb_iaddesc_s *iad = (FAR struct usb_iaddesc_s *)desc; uint32_t mask; - /* Keep count of the number ofinterfaces that will be merged */ + /* Keep count of the number of interfaces that will be merged */ nmerged += (iad->nifs - 1); @@ -625,7 +625,7 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport, * number of interfaces merged via the IAD descriptor. */ - if (nintfs <= nmerged ) + if (nintfs <= nmerged) { /* Should not happen. Means a bug. */ @@ -743,8 +743,8 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport, DEBUGASSERT(i == nclasses); - /* Allocate a large buffer in which we can construct a custom configuration - * descriptor for each member class. + /* Allocate a temporary buffer in which we can construct a custom + * configuration descriptor for each member class. */ cfgbuffer = (FAR uint8_t *)malloc(CUSTOM_CONFIG_BUFSIZE); @@ -804,9 +804,8 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport, } /* Call the newly instantiated classes connect() method provide it - * with the information that it needs to initialize properly, that - * is the configuration escriptor and all of the interface descriptors - * needed by the member class. + * with the configuration information that it needs to initialize + * properly. */ ret = CLASS_CONNECT(member->usbclass, cfgbuffer, cfgsize); @@ -821,6 +820,8 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport, } } + /* Free the temporary buffer */ + kmm_free(cfgbuffer); /* Return our USB class structure */