Index: uspace/drv/bus/usb/xhci/streams.c
===================================================================
--- uspace/drv/bus/usb/xhci/streams.c	(revision 998773d2ccfa124e237ab008ad97974ceb050320)
+++ uspace/drv/bus/usb/xhci/streams.c	(revision e7e1fd38e5e2b8703e15c6b4f74c5357ba1c2038)
@@ -39,5 +39,6 @@
 #include "streams.h"
 
-/** Finds stream data with given stream ID if it exists.
+/**
+ * Finds stream data with given stream ID if it exists.
  * Note that streams with ID 0, 65534 and 65535 are reserved.
  * Splits the ID into primary and secondary context ID and searches the structures.
@@ -52,6 +53,8 @@
 
 	/* See 4.12.2.1 for the calculation of the IDs and dividing the stream_id */
-	uint32_t primary_stream_id = (uint32_t) (stream_id & (ep->primary_stream_data_size - 1));
-	uint32_t secondary_stream_id = (uint32_t) ((stream_id / ep->primary_stream_data_size) & 0xFF);
+	uint32_t primary_stream_id =
+	    (uint32_t) (stream_id & (ep->primary_stream_data_size - 1));
+	uint32_t secondary_stream_id =
+	    (uint32_t) ((stream_id / ep->primary_stream_data_size) & 0xFF);
 
 	if (primary_stream_id >= ep->primary_stream_data_size) {
@@ -59,5 +62,6 @@
 	}
 
-	xhci_stream_data_t *primary_data = &ep->primary_stream_data_array[primary_stream_id];
+	xhci_stream_data_t *primary_data =
+	    &ep->primary_stream_data_array[primary_stream_id];
 	if (secondary_stream_id != 0 && !primary_data->secondary_size) {
 		return NULL;
@@ -76,5 +80,6 @@
 }
 
-/** Initializes primary stream data structures in endpoint.
+/**
+ * Initializes primary stream data structures in endpoint.
  * @param[in] xhci_ep Used XHCI bulk endpoint.
  * @param[in] count Amount of primary streams.
@@ -82,8 +87,9 @@
 static int initialize_primary_structures(xhci_endpoint_t *xhci_ep, unsigned count)
 {
-	usb_log_debug("Allocating primary stream context array of size %u for endpoint " XHCI_EP_FMT,
-		count, XHCI_EP_ARGS(*xhci_ep));
-
-	if ((dma_buffer_alloc(&xhci_ep->primary_stream_ctx_dma, count * sizeof(xhci_stream_ctx_t)))) {
+	usb_log_debug("Allocating primary stream context array of size %u "
+		"for endpoint " XHCI_EP_FMT, count, XHCI_EP_ARGS(*xhci_ep));
+
+	if ((dma_buffer_alloc(&xhci_ep->primary_stream_ctx_dma,
+		count * sizeof(xhci_stream_ctx_t)))) {
 		return ENOMEM;
 	}
@@ -101,10 +107,8 @@
 }
 
-/**
- *
- */
 static void clear_primary_structures(xhci_endpoint_t *xhci_ep)
 {
-	usb_log_debug("Deallocating primary stream structures for endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
+	usb_log_debug("Deallocating primary stream structures for "
+		"endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
 
 	dma_buffer_free(&xhci_ep->primary_stream_ctx_dma);
@@ -133,5 +137,6 @@
 void xhci_stream_free_ds(xhci_endpoint_t *xhci_ep)
 {
-	usb_log_debug("Freeing stream rings and context arrays of endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
+	usb_log_debug("Freeing stream rings and context arrays of endpoint "
+		XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
 
 	for (size_t index = 0; index < xhci_ep->primary_stream_data_size; ++index) {
@@ -141,10 +146,13 @@
 }
 
-/** Initialize a single primary stream structure with given index.
+/**
+ * Initialize a single primary stream structure with given index.
  * @param[in] hc Host controller of the endpoint.
  * @param[in] xhci_ep XHCI bulk endpoint to use.
  * @param[in] index index of the initialized stream structure.
  */
-static int initialize_primary_stream(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep, unsigned index) {
+static int initialize_primary_stream(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,
+    unsigned index)
+{
 	xhci_stream_ctx_t *ctx = &xhci_ep->primary_stream_ctx_array[index];
 	xhci_stream_data_t *data = &xhci_ep->primary_stream_data_array[index];
@@ -165,5 +173,6 @@
 }
 
-/** Initialize primary streams of XHCI bulk endpoint.
+/**
+ * Initialize primary streams of XHCI bulk endpoint.
  * @param[in] hc Host controller of the endpoint.
  * @param[in] xhci_ep XHCI bulk endpoint to use.
@@ -189,5 +198,6 @@
 }
 
-/** Initialize secondary streams of XHCI bulk endpoint.
+/**
+ * Initialize secondary streams of XHCI bulk endpoint.
  * @param[in] hc Host controller of the endpoint.
  * @param[in] xhci_epi XHCI bulk endpoint to use.
@@ -195,13 +205,18 @@
  * @param[in] count Number of secondary streams to initialize.
  */
-static int initialize_secondary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep, unsigned idx, unsigned count)
+static int initialize_secondary_streams(xhci_hc_t *hc, xhci_endpoint_t *xhci_ep,
+    unsigned idx, unsigned count)
 {
 	if (count == 0) {
-		/* The primary stream context can still point to a single ring, not a secondary. */
+		/*
+		 * The primary stream context can still point to a single ring, not
+		 * a secondary.
+		 */
 		return initialize_primary_stream(hc, xhci_ep, idx);
 	}
 
 	if ((count & (count - 1)) != 0 || count < 8 || count > 256) {
-		usb_log_error("The secondary stream array size must be a power of 2 between 8 and 256.");
+		usb_log_error("The secondary stream array size must be a power of 2 "
+			"between 8 and 256.");
 		return EINVAL;
 	}
@@ -217,5 +232,6 @@
 	}
 
-	if ((dma_buffer_alloc(&data->secondary_stream_ctx_dma, count * sizeof(xhci_stream_ctx_t)))) {
+	if ((dma_buffer_alloc(&data->secondary_stream_ctx_dma,
+		count * sizeof(xhci_stream_ctx_t)))) {
 		free(data->secondary_data);
 		return ENOMEM;
@@ -251,5 +267,6 @@
 }
 
-/** Configure XHCI bulk endpoint's stream context.
+/**
+ * Configure XHCI bulk endpoint's stream context.
  * @param[in] xhci_ep Associated XHCI bulk endpoint.
  * @param[in] ctx Endpoint context to configure.
@@ -257,5 +274,6 @@
  * @param[in] lsa Specifies if the stream IDs point to primary stream array.
  */
-static void setup_stream_context(xhci_endpoint_t *xhci_ep, xhci_ep_ctx_t *ctx, unsigned pstreams, unsigned lsa)
+static void setup_stream_context(xhci_endpoint_t *xhci_ep, xhci_ep_ctx_t *ctx,
+    unsigned pstreams, unsigned lsa)
 {
 	XHCI_EP_TYPE_SET(*ctx, xhci_endpoint_type(xhci_ep));
@@ -269,5 +287,6 @@
 }
 
-/** Verifies if all the common preconditions are satisfied.
+/**
+ * Verifies if all the common preconditions are satisfied.
  * @param[in] hc Host controller of the endpoint.
  * @param[in] dev Used device.
@@ -285,5 +304,6 @@
 
 	if (xhci_ep->max_streams <= 1) {
-		usb_log_error("Streams are not supported by endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
+		usb_log_error("Streams are not supported by endpoint "
+		    XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));
 		return EINVAL;
 	}
@@ -294,8 +314,12 @@
 	}
 
-	/* The maximum amount of primary streams is 2 ^ (MaxPSA + 1) (See table 26 of XHCI specification) */
+	/*
+	 * The maximum amount of primary streams is 2 ^ (MaxPSA + 1)
+	 * See table 26 of XHCI specification.
+	 */
 	uint8_t max_psa_size = 1 << (XHCI_REG_RD(hc->cap_regs, XHCI_CAP_MAX_PSA_SIZE) + 1);
 	if (count > max_psa_size) {
-		usb_log_error("Host controller only supports %u primary streams.", max_psa_size);
+		usb_log_error("Host controller only supports "
+			"%u primary streams.", max_psa_size);
 		return EINVAL;
 	}
@@ -315,10 +339,12 @@
 }
 
-/** Cancels streams and reconfigures endpoint back to single ring no stream endpoint.
+/**
+ * Cancels streams and reconfigures endpoint back to single ring no stream endpoint.
  * @param[in] hc Host controller of the endpoint.
  * @param[in] dev Used device.
  * @param[in] xhci_ep Associated XHCI bulk endpoint.
  */
-int xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev, xhci_endpoint_t *xhci_ep)
+int xhci_endpoint_remove_streams(xhci_hc_t *hc, xhci_device_t *dev,
+    xhci_endpoint_t *xhci_ep)
 {
 	if (!xhci_ep->primary_stream_data_size) {
@@ -340,5 +366,6 @@
 }
 
-/** Initialize, setup and register primary streams.
+/**
+ * Initialize, setup and register primary streams.
  * @param[in] hc Host controller of the endpoint.
  * @param[in] dev Used device.
@@ -374,5 +401,8 @@
 
 	xhci_ep_ctx_t ep_ctx;
-	/* Allowed values are 1-15, where 2 ^ pstreams is the actual amount of streams. */
+	/*
+	 * Allowed values are 1-15, where 2 ^ pstreams is the actual amount of
+	 * streams.
+	 */
 	const size_t pstreams = fnzb32(count) - 1;
 	setup_stream_context(xhci_ep, &ep_ctx, pstreams, 1);
@@ -381,11 +411,12 @@
 }
 
-/** Initialize, setup and register secondary streams.
+/**
+ * Initialize, setup and register secondary streams.
  * @param[in] hc Host controller of the endpoint.
  * @param[in] dev Used device.
  * @param[in] xhci_ep Associated XHCI bulk endpoint.
- * @param[in] sizes Amount of secondary streams in each primary stream.
- 					This array should have exactly count elements.
-					If the size is 0, then a primary ring is created with that index.
+ * @param[in] sizes Amount of secondary streams in each of the primary streams.
+ *                  This array should have exactly count elements. If the size
+ *                  is 0, then a primary ring is created with that index.
  * @param[in] count Amount of primary streams requested.
  */
