Index: uspace/drv/ohci/root_hub.c
===================================================================
--- uspace/drv/ohci/root_hub.c	(revision 361fcec468eeecd07b777f8b9ccd24b9e7edf14d)
+++ uspace/drv/ohci/root_hub.c	(revision 60b3beac1e486317bc00fc7c1b8c16bd12dcd1d9)
@@ -45,5 +45,5 @@
 
 /**
- *	standart device descriptor for ohci root hub
+ * standart device descriptor for ohci root hub
  */
 static const usb_standard_device_descriptor_t ohci_rh_device_descriptor = {
@@ -69,5 +69,4 @@
  */
 static const usb_standard_configuration_descriptor_t ohci_rh_conf_descriptor = {
-	/// \TODO some values are default or guessed
 	.attributes = 1 << 7,
 	.configuration_number = 1,
@@ -87,5 +86,4 @@
 	.endpoint_count = 1,
 	.interface_class = USB_CLASS_HUB,
-	/// \TODO is this correct?
 	.interface_number = 1,
 	.interface_protocol = 0,
@@ -107,27 +105,44 @@
 };
 
+/**
+ * bitmask of hub features that are valid to be cleared
+ */
 static const uint32_t hub_clear_feature_valid_mask =
-	(1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER) |
+    (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER) |
 (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
 
+/**
+ * bitmask of hub features that are cleared by writing 1 (and not 0)
+ */
 static const uint32_t hub_clear_feature_by_writing_one_mask =
-	1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER;
-
+    1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER;
+
+/**
+ * bitmask of hub features that are valid to be set
+ */
 static const uint32_t hub_set_feature_valid_mask =
-	(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) |
+    (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) |
 (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
 
-
+/**
+ * bitmask of hub features that are set by writing 1 and cleared by writing 0
+ */
 static const uint32_t hub_set_feature_direct_mask =
-	(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
-
+    (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
+
+/**
+ * bitmask of port features that are valid to be set
+ */
 static const uint32_t port_set_feature_valid_mask =
-	(1 << USB_HUB_FEATURE_PORT_ENABLE) |
+    (1 << USB_HUB_FEATURE_PORT_ENABLE) |
 (1 << USB_HUB_FEATURE_PORT_SUSPEND) |
 (1 << USB_HUB_FEATURE_PORT_RESET) |
 (1 << USB_HUB_FEATURE_PORT_POWER);
 
+/**
+ * bitmask of port features that can be cleared
+ */
 static const uint32_t port_clear_feature_valid_mask =
-	(1 << USB_HUB_FEATURE_PORT_CONNECTION) |
+    (1 << USB_HUB_FEATURE_PORT_CONNECTION) |
 (1 << USB_HUB_FEATURE_PORT_SUSPEND) |
 (1 << USB_HUB_FEATURE_PORT_OVER_CURRENT) |
@@ -141,10 +156,13 @@
 //USB_HUB_FEATURE_PORT_LOW_SPEED
 
+/**
+ * bitmask with port status changes
+ */
 static const uint32_t port_status_change_mask =
-(1<< USB_HUB_FEATURE_C_PORT_CONNECTION) |
-(1<< USB_HUB_FEATURE_C_PORT_ENABLE) |
-(1<< USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
-(1<< USB_HUB_FEATURE_C_PORT_RESET) |
-(1<< USB_HUB_FEATURE_C_PORT_SUSPEND);
+    (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
+(1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
+(1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
+(1 << USB_HUB_FEATURE_C_PORT_RESET) |
+(1 << USB_HUB_FEATURE_C_PORT_SUSPEND);
 
 
@@ -154,42 +172,42 @@
 
 static int process_get_port_status_request(rh_t *instance, uint16_t port,
-	usb_transfer_batch_t * request);
+    usb_transfer_batch_t * request);
 
 static int process_get_hub_status_request(rh_t *instance,
-	usb_transfer_batch_t * request);
+    usb_transfer_batch_t * request);
 
 static int process_get_status_request(rh_t *instance,
-	usb_transfer_batch_t * request);
+    usb_transfer_batch_t * request);
 
 static void create_interrupt_mask_in_instance(rh_t *instance);
 
 static int process_get_descriptor_request(rh_t *instance,
-	usb_transfer_batch_t *request);
+    usb_transfer_batch_t *request);
 
 static int process_get_configuration_request(rh_t *instance,
-	usb_transfer_batch_t *request);
+    usb_transfer_batch_t *request);
 
 static int process_hub_feature_set_request(rh_t *instance, uint16_t feature);
 
 static int process_hub_feature_clear_request(rh_t *instance,
-	uint16_t feature);
+    uint16_t feature);
 
 static int process_port_feature_set_request(rh_t *instance,
-	uint16_t feature, uint16_t port);
+    uint16_t feature, uint16_t port);
 
 static int process_port_feature_clear_request(rh_t *instance,
-	uint16_t feature, uint16_t port);
+    uint16_t feature, uint16_t port);
 
 static int process_address_set_request(rh_t *instance,
-	uint16_t address);
+    uint16_t address);
 
 static int process_request_with_output(rh_t *instance,
-	usb_transfer_batch_t *request);
+    usb_transfer_batch_t *request);
 
 static int process_request_with_input(rh_t *instance,
-	usb_transfer_batch_t *request);
+    usb_transfer_batch_t *request);
 
 static int process_request_without_data(rh_t *instance,
-	usb_transfer_batch_t *request);
+    usb_transfer_batch_t *request);
 
 static int process_ctrl_request(rh_t *instance, usb_transfer_batch_t *request);
@@ -198,6 +216,4 @@
 
 static bool is_zeros(void * buffer, size_t size);
-
-
 
 /** Root hub initialization
@@ -210,5 +226,5 @@
 	    (instance->registers->rh_desc_a >> RHDA_NDS_SHIFT) & RHDA_NDS_MASK;
 	int opResult = rh_init_descriptors(instance);
-	if(opResult != EOK){
+	if (opResult != EOK) {
 		return opResult;
 	}
@@ -216,11 +232,12 @@
 	instance->registers->rh_desc_a |= RHDA_NPS_FLAG;
 	instance->unfinished_interrupt_transfer = NULL;
-	instance->interrupt_mask_size = (instance->port_count + 8)/8;
+	instance->interrupt_mask_size = (instance->port_count + 8) / 8;
 	instance->interrupt_buffer = malloc(instance->interrupt_mask_size);
-	if(!instance->interrupt_buffer)
+	if (!instance->interrupt_buffer)
 		return ENOMEM;
-	
-
-	usb_log_info("OHCI root hub with %d ports.\n", instance->port_count);
+
+	usb_log_info("OHCI root hub with %zu ports initialized.\n",
+	    instance->port_count);
+
 	return EOK;
 }
@@ -245,10 +262,10 @@
 		usb_log_info("Root hub got INTERRUPT packet\n");
 		create_interrupt_mask_in_instance(instance);
-		if(is_zeros(instance->interrupt_buffer,
-		    instance->interrupt_mask_size)){
+		if (is_zeros(instance->interrupt_buffer,
+		    instance->interrupt_mask_size)) {
 			usb_log_debug("no changes..\n");
 			instance->unfinished_interrupt_transfer = request;
 			//will be finished later
-		}else{
+		} else {
 			usb_log_debug("processing changes..\n");
 			process_interrupt_mask_in_instance(instance, request);
@@ -256,4 +273,5 @@
 		opResult = EOK;
 	} else {
+
 		opResult = EINVAL;
 		usb_transfer_batch_finish_error(request, opResult);
@@ -271,5 +289,5 @@
  */
 void rh_interrupt(rh_t *instance) {
-	if(!instance->unfinished_interrupt_transfer){
+	if (!instance->unfinished_interrupt_transfer) {
 		return;
 	}
@@ -292,8 +310,8 @@
 static int create_serialized_hub_descriptor(rh_t *instance) {
 	size_t size = 7 +
-	    ((instance->port_count +7 )/ 8) * 2;
-	size_t var_size = (instance->port_count +7 )/ 8;
+	    ((instance->port_count + 7) / 8) * 2;
+	size_t var_size = (instance->port_count + 7) / 8;
 	uint8_t * result = (uint8_t*) malloc(size);
-	if(!result) return ENOMEM;
+	if (!result) return ENOMEM;
 
 	bzero(result, size);
@@ -305,19 +323,19 @@
 	uint32_t hub_desc_reg = instance->registers->rh_desc_a;
 	result[3] =
-		((hub_desc_reg >> 8) % 2) +
-		(((hub_desc_reg >> 9) % 2) << 1) +
-		(((hub_desc_reg >> 10) % 2) << 2) +
-		(((hub_desc_reg >> 11) % 2) << 3) +
-		(((hub_desc_reg >> 12) % 2) << 4);
+	    ((hub_desc_reg >> 8) % 2) +
+	    (((hub_desc_reg >> 9) % 2) << 1) +
+	    (((hub_desc_reg >> 10) % 2) << 2) +
+	    (((hub_desc_reg >> 11) % 2) << 3) +
+	    (((hub_desc_reg >> 12) % 2) << 4);
 	result[4] = 0;
 	result[5] = /*descriptor->pwr_on_2_good_time*/ 50;
 	result[6] = 50;
 
-	int port;
+	size_t port;
 	for (port = 1; port <= instance->port_count; ++port) {
 		uint8_t is_non_removable =
-			instance->registers->rh_desc_b >> port % 2;
+		    instance->registers->rh_desc_b >> port % 2;
 		result[7 + port / 8] +=
-			is_non_removable << (port % 8);
+		    is_non_removable << (port % 8);
 	}
 	size_t i;
@@ -327,4 +345,5 @@
 	instance->hub_descriptor = result;
 	instance->descriptor_size = size;
+
 	return EOK;
 }
@@ -340,38 +359,39 @@
 static int rh_init_descriptors(rh_t *instance) {
 	memcpy(&instance->descriptors.device, &ohci_rh_device_descriptor,
-		sizeof (ohci_rh_device_descriptor)
-		);
+	    sizeof (ohci_rh_device_descriptor)
+	    );
 	usb_standard_configuration_descriptor_t descriptor;
 	memcpy(&descriptor, &ohci_rh_conf_descriptor,
-		sizeof (ohci_rh_conf_descriptor));
+	    sizeof (ohci_rh_conf_descriptor));
 
 	int opResult = create_serialized_hub_descriptor(instance);
-	if(opResult != EOK){
+	if (opResult != EOK) {
 		return opResult;
 	}
 	descriptor.total_length =
-		sizeof (usb_standard_configuration_descriptor_t) +
-		sizeof (usb_standard_endpoint_descriptor_t) +
-		sizeof (usb_standard_interface_descriptor_t) +
-		instance->descriptor_size;
+	    sizeof (usb_standard_configuration_descriptor_t) +
+	    sizeof (usb_standard_endpoint_descriptor_t) +
+	    sizeof (usb_standard_interface_descriptor_t) +
+	    instance->descriptor_size;
 
 	uint8_t * full_config_descriptor =
-		(uint8_t*) malloc(descriptor.total_length);
-	if(!full_config_descriptor){
+	    (uint8_t*) malloc(descriptor.total_length);
+	if (!full_config_descriptor) {
 		return ENOMEM;
 	}
 	memcpy(full_config_descriptor, &descriptor, sizeof (descriptor));
 	memcpy(full_config_descriptor + sizeof (descriptor),
-		&ohci_rh_iface_descriptor, sizeof (ohci_rh_iface_descriptor));
+	    &ohci_rh_iface_descriptor, sizeof (ohci_rh_iface_descriptor));
 	memcpy(full_config_descriptor + sizeof (descriptor) +
-		sizeof (ohci_rh_iface_descriptor),
-		&ohci_rh_ep_descriptor, sizeof (ohci_rh_ep_descriptor));
+	    sizeof (ohci_rh_iface_descriptor),
+	    &ohci_rh_ep_descriptor, sizeof (ohci_rh_ep_descriptor));
 	memcpy(full_config_descriptor + sizeof (descriptor) +
-		sizeof (ohci_rh_iface_descriptor) +
-		sizeof (ohci_rh_ep_descriptor),
-		instance->hub_descriptor, instance->descriptor_size);
-	
+	    sizeof (ohci_rh_iface_descriptor) +
+	    sizeof (ohci_rh_ep_descriptor),
+	    instance->hub_descriptor, instance->descriptor_size);
+
 	instance->descriptors.configuration = full_config_descriptor;
 	instance->descriptors.configuration_size = descriptor.total_length;
+
 	return EOK;
 }
@@ -389,5 +409,5 @@
  */
 static int process_get_port_status_request(rh_t *instance, uint16_t port,
-	usb_transfer_batch_t * request) {
+    usb_transfer_batch_t * request) {
 	if (port < 1 || port > instance->port_count)
 		return EINVAL;
@@ -398,7 +418,8 @@
 	int i;
 	for (i = 0; i < instance->port_count; ++i) {
+
 		usb_log_debug("port status %d,x%x\n",
-			instance->registers->rh_port_status[i],
-			instance->registers->rh_port_status[i]);
+		    instance->registers->rh_port_status[i],
+		    instance->registers->rh_port_status[i]);
 	}
 #endif
@@ -417,5 +438,5 @@
  */
 static int process_get_hub_status_request(rh_t *instance,
-	usb_transfer_batch_t * request) {
+    usb_transfer_batch_t * request) {
 	uint32_t * uint32_buffer = (uint32_t*) request->data_buffer;
 	request->transfered_size = 4;
@@ -423,4 +444,5 @@
 	uint32_t mask = 1 | (1 << 1) | (1 << 16) | (1 << 17);
 	uint32_buffer[0] = mask & instance->registers->rh_status;
+
 	return EOK;
 }
@@ -437,9 +459,9 @@
  */
 static int process_get_status_request(rh_t *instance,
-	usb_transfer_batch_t * request) {
+    usb_transfer_batch_t * request) {
 	size_t buffer_size = request->buffer_size;
 	usb_device_request_setup_packet_t * request_packet =
-		(usb_device_request_setup_packet_t*)
-		request->setup_buffer;
+	    (usb_device_request_setup_packet_t*)
+	    request->setup_buffer;
 
 	usb_hub_bm_request_type_t request_type = request_packet->request_type;
@@ -453,6 +475,7 @@
 	if (request_type == USB_HUB_REQ_TYPE_GET_PORT_STATUS)
 		return process_get_port_status_request(instance,
-		request_packet->index,
-		request);
+	    request_packet->index,
+	    request);
+
 	return ENOTSUP;
 }
@@ -472,13 +495,14 @@
 	uint8_t * bitmap = (uint8_t*) (instance->interrupt_buffer);
 	uint32_t mask = (1 << (USB_HUB_FEATURE_C_HUB_LOCAL_POWER + 16))
-		| (1 << (USB_HUB_FEATURE_C_HUB_OVER_CURRENT + 16));
+	    | (1 << (USB_HUB_FEATURE_C_HUB_OVER_CURRENT + 16));
 	bzero(bitmap, instance->interrupt_mask_size);
 	if (instance->registers->rh_status & mask) {
 		bitmap[0] = 1;
 	}
-	int port;
+	size_t port;
 	mask = port_status_change_mask;
 	for (port = 1; port <= instance->port_count; ++port) {
 		if (mask & instance->registers->rh_port_status[port - 1]) {
+
 			bitmap[(port) / 8] += 1 << (port % 8);
 		}
@@ -497,7 +521,7 @@
  */
 static int process_get_descriptor_request(rh_t *instance,
-	usb_transfer_batch_t *request) {
+    usb_transfer_batch_t *request) {
 	usb_device_request_setup_packet_t * setup_request =
-		(usb_device_request_setup_packet_t*) request->setup_buffer;
+	    (usb_device_request_setup_packet_t*) request->setup_buffer;
 	size_t size;
 	const void * result_descriptor = NULL;
@@ -543,13 +567,13 @@
 		{
 			usb_log_debug("USB_DESCTYPE_EINVAL %d \n",
-				setup_request->value);
+			    setup_request->value);
 			usb_log_debug("\ttype %d\n\trequest %d\n\tvalue "
-				"%d\n\tindex %d\n\tlen %d\n ",
-				setup_request->request_type,
-				setup_request->request,
-				setup_request_value,
-				setup_request->index,
-				setup_request->length
-				);
+			    "%d\n\tindex %d\n\tlen %d\n ",
+			    setup_request->request_type,
+			    setup_request->request,
+			    setup_request_value,
+			    setup_request->index,
+			    setup_request->length
+			    );
 			return EINVAL;
 		}
@@ -560,4 +584,5 @@
 	request->transfered_size = size;
 	memcpy(request->data_buffer, result_descriptor, size);
+
 	return EOK;
 }
@@ -573,5 +598,5 @@
  */
 static int process_get_configuration_request(rh_t *instance,
-	usb_transfer_batch_t *request) {
+    usb_transfer_batch_t *request) {
 	//set and get configuration requests do not have any meaning, only dummy
 	//values are returned
@@ -580,4 +605,5 @@
 	request->data_buffer[0] = 1;
 	request->transfered_size = 1;
+
 	return EOK;
 }
@@ -592,12 +618,13 @@
  */
 static int process_hub_feature_set_request(rh_t *instance,
-	uint16_t feature) {
+    uint16_t feature) {
 	if (!((1 << feature) & hub_set_feature_valid_mask))
 		return EINVAL;
-	if(feature == USB_HUB_FEATURE_C_HUB_LOCAL_POWER)
+	if (feature == USB_HUB_FEATURE_C_HUB_LOCAL_POWER)
 		feature = USB_HUB_FEATURE_C_HUB_LOCAL_POWER << 16;
 	instance->registers->rh_status =
-		(instance->registers->rh_status | (1 << feature))
-		& (~hub_clear_feature_by_writing_one_mask);
+	    (instance->registers->rh_status | (1 << feature))
+	    & (~hub_clear_feature_by_writing_one_mask);
+
 	return EOK;
 }
@@ -612,5 +639,5 @@
  */
 static int process_hub_feature_clear_request(rh_t *instance,
-	uint16_t feature) {
+    uint16_t feature) {
 	if (!((1 << feature) & hub_clear_feature_valid_mask))
 		return EINVAL;
@@ -618,11 +645,12 @@
 	if ((1 << feature) & hub_set_feature_direct_mask) {
 		instance->registers->rh_status =
-			(instance->registers->rh_status & (~(1 << feature)))
-			& (~hub_clear_feature_by_writing_one_mask);
+		    (instance->registers->rh_status & (~(1 << feature)))
+		    & (~hub_clear_feature_by_writing_one_mask);
 	} else {//the feature is cleared by writing '1'
+
 		instance->registers->rh_status =
-			(instance->registers->rh_status
-			& (~hub_clear_feature_by_writing_one_mask))
-			| (1 << feature);
+		    (instance->registers->rh_status
+		    & (~hub_clear_feature_by_writing_one_mask))
+		    | (1 << feature);
 	}
 	return EOK;
@@ -640,5 +668,5 @@
  */
 static int process_port_feature_set_request(rh_t *instance,
-	uint16_t feature, uint16_t port) {
+    uint16_t feature, uint16_t port) {
 	if (!((1 << feature) & port_set_feature_valid_mask))
 		return EINVAL;
@@ -646,7 +674,8 @@
 		return EINVAL;
 	instance->registers->rh_port_status[port - 1] =
-		(instance->registers->rh_port_status[port - 1] | (1 << feature))
-		& (~port_clear_feature_valid_mask);
+	    (instance->registers->rh_port_status[port - 1] | (1 << feature))
+	    & (~port_clear_feature_valid_mask);
 	/// \TODO any error?
+
 	return EOK;
 }
@@ -663,5 +692,5 @@
  */
 static int process_port_feature_clear_request(rh_t *instance,
-	uint16_t feature, uint16_t port) {
+    uint16_t feature, uint16_t port) {
 	if (!((1 << feature) & port_clear_feature_valid_mask))
 		return EINVAL;
@@ -673,8 +702,9 @@
 		feature = USB_HUB_FEATURE_PORT_OVER_CURRENT;
 	instance->registers->rh_port_status[port - 1] =
-		(instance->registers->rh_port_status[port - 1]
-		& (~port_clear_feature_valid_mask))
-		| (1 << feature);
+	    (instance->registers->rh_port_status[port - 1]
+	    & (~port_clear_feature_valid_mask))
+	    | (1 << feature);
 	/// \TODO any error?
+
 	return EOK;
 }
@@ -689,6 +719,7 @@
  */
 static int process_address_set_request(rh_t *instance,
-	uint16_t address) {
+    uint16_t address) {
 	instance->address = address;
+
 	return EOK;
 }
@@ -705,7 +736,7 @@
  */
 static int process_request_with_output(rh_t *instance,
-	usb_transfer_batch_t *request) {
+    usb_transfer_batch_t *request) {
 	usb_device_request_setup_packet_t * setup_request =
-		(usb_device_request_setup_packet_t*) request->setup_buffer;
+	    (usb_device_request_setup_packet_t*) request->setup_buffer;
 	if (setup_request->request == USB_DEVREQ_GET_STATUS) {
 		usb_log_debug("USB_DEVREQ_GET_STATUS\n");
@@ -718,4 +749,5 @@
 	if (setup_request->request == USB_DEVREQ_GET_CONFIGURATION) {
 		usb_log_debug("USB_DEVREQ_GET_CONFIGURATION\n");
+
 		return process_get_configuration_request(instance, request);
 	}
@@ -734,7 +766,7 @@
  */
 static int process_request_with_input(rh_t *instance,
-	usb_transfer_batch_t *request) {
+    usb_transfer_batch_t *request) {
 	usb_device_request_setup_packet_t * setup_request =
-		(usb_device_request_setup_packet_t*) request->setup_buffer;
+	    (usb_device_request_setup_packet_t*) request->setup_buffer;
 	request->transfered_size = 0;
 	if (setup_request->request == USB_DEVREQ_SET_DESCRIPTOR) {
@@ -744,4 +776,5 @@
 		//set and get configuration requests do not have any meaning,
 		//only dummy values are returned
+
 		return EOK;
 	}
@@ -760,7 +793,7 @@
  */
 static int process_request_without_data(rh_t *instance,
-	usb_transfer_batch_t *request) {
+    usb_transfer_batch_t *request) {
 	usb_device_request_setup_packet_t * setup_request =
-		(usb_device_request_setup_packet_t*) request->setup_buffer;
+	    (usb_device_request_setup_packet_t*) request->setup_buffer;
 	request->transfered_size = 0;
 	if (setup_request->request == USB_DEVREQ_CLEAR_FEATURE) {
@@ -768,14 +801,14 @@
 			usb_log_debug("USB_HUB_REQ_TYPE_SET_HUB_FEATURE\n");
 			return process_hub_feature_clear_request(instance,
-				setup_request->value);
+			    setup_request->value);
 		}
 		if (setup_request->request_type == USB_HUB_REQ_TYPE_SET_PORT_FEATURE) {
 			usb_log_debug("USB_HUB_REQ_TYPE_SET_PORT_FEATURE\n");
 			return process_port_feature_clear_request(instance,
-				setup_request->value,
-				setup_request->index);
+			    setup_request->value,
+			    setup_request->index);
 		}
 		usb_log_debug("USB_HUB_REQ_TYPE_INVALID %d\n",
-			setup_request->request_type);
+		    setup_request->request_type);
 		return EINVAL;
 	}
@@ -784,14 +817,14 @@
 			usb_log_debug("USB_HUB_REQ_TYPE_SET_HUB_FEATURE\n");
 			return process_hub_feature_set_request(instance,
-				setup_request->value);
+			    setup_request->value);
 		}
 		if (setup_request->request_type == USB_HUB_REQ_TYPE_SET_PORT_FEATURE) {
 			usb_log_debug("USB_HUB_REQ_TYPE_SET_PORT_FEATURE\n");
 			return process_port_feature_set_request(instance,
-				setup_request->value,
-				setup_request->index);
+			    setup_request->value,
+			    setup_request->index);
 		}
 		usb_log_debug("USB_HUB_REQ_TYPE_INVALID %d\n",
-			setup_request->request_type);
+		    setup_request->request_type);
 		return EINVAL;
 	}
@@ -799,8 +832,9 @@
 		usb_log_debug("USB_DEVREQ_SET_ADDRESS\n");
 		return process_address_set_request(instance,
-			setup_request->value);
+		    setup_request->value);
 	}
 	usb_log_debug("USB_DEVREQ_SET_ENOTSUP %d\n",
-		setup_request->request_type);
+	    setup_request->request_type);
+
 	return ENOTSUP;
 }
@@ -836,9 +870,9 @@
 	}
 	usb_log_info("CTRL packet: %s.\n",
-		usb_debug_str_buffer(
-		(const uint8_t *) request->setup_buffer, 8, 8));
+	    usb_debug_str_buffer(
+	    (const uint8_t *) request->setup_buffer, 8, 8));
 	usb_device_request_setup_packet_t * setup_request =
-		(usb_device_request_setup_packet_t*)
-		request->setup_buffer;
+	    (usb_device_request_setup_packet_t*)
+	    request->setup_buffer;
 	switch (setup_request->request) {
 		case USB_DEVREQ_GET_STATUS:
@@ -847,5 +881,5 @@
 			usb_log_debug("processing request with output\n");
 			opResult = process_request_with_output(
-				instance, request);
+			    instance, request);
 			break;
 		case USB_DEVREQ_CLEAR_FEATURE:
@@ -853,20 +887,21 @@
 		case USB_DEVREQ_SET_ADDRESS:
 			usb_log_debug("processing request without "
-				"additional data\n");
+			    "additional data\n");
 			opResult = process_request_without_data(
-				instance, request);
+			    instance, request);
 			break;
 		case USB_DEVREQ_SET_DESCRIPTOR:
 		case USB_DEVREQ_SET_CONFIGURATION:
 			usb_log_debug("processing request with "
-				"input\n");
+			    "input\n");
 			opResult = process_request_with_input(
-				instance, request);
+			    instance, request);
+
 			break;
 		default:
 			usb_log_warning("received unsuported request: "
-				"%d\n",
-				setup_request->request
-				);
+			    "%d\n",
+			    setup_request->request
+			    );
 			opResult = ENOTSUP;
 	}
@@ -888,5 +923,5 @@
  * @return
  */
-static int process_interrupt_mask_in_instance(rh_t *instance, usb_transfer_batch_t * request){
+static int process_interrupt_mask_in_instance(rh_t *instance, usb_transfer_batch_t * request) {
 	memcpy(request->data_buffer, instance->interrupt_buffer,
 	    instance->interrupt_mask_size);
@@ -894,4 +929,5 @@
 	instance->unfinished_interrupt_transfer = NULL;
 	usb_transfer_batch_finish_error(request, EOK);
+
 	return EOK;
 }
@@ -907,10 +943,10 @@
  * @return
  */
-static bool is_zeros(void * buffer, size_t size){
-	if(!buffer) return true;
-	if(!size) return true;
+static bool is_zeros(void * buffer, size_t size) {
+	if (!buffer) return true;
+	if (!size) return true;
 	size_t i;
-	for(i=0;i<size;++i){
-		if(((char*)buffer)[i])
+	for (i = 0; i < size; ++i) {
+		if (((char*) buffer)[i])
 			return false;
 	}
