Index: uspace/drv/bus/usb/usbhub/ports.c
===================================================================
--- uspace/drv/bus/usb/usbhub/ports.c	(revision d46b13dac28efb442c0b90728472392b4e445803)
+++ uspace/drv/bus/usb/usbhub/ports.c	(revision 983e13512e93a69fc24e03e23125081d7c872506)
@@ -95,6 +95,6 @@
  * @param port port number, starting from 1
  */
-void usb_hub_process_port_interrupt(usb_hub_info_t *hub,
-    uint16_t port) {
+void usb_hub_process_port_interrupt(usb_hub_info_t *hub, uint16_t port)
+{
 	usb_log_debug("Interrupt at port %zu\n", (size_t) port);
 	//determine type of change
Index: uspace/drv/bus/usb/usbhub/ports.h
===================================================================
--- uspace/drv/bus/usb/usbhub/ports.h	(revision d46b13dac28efb442c0b90728472392b4e445803)
+++ uspace/drv/bus/usb/usbhub/ports.h	(revision 983e13512e93a69fc24e03e23125081d7c872506)
@@ -70,6 +70,5 @@
 
 
-void usb_hub_process_port_interrupt(usb_hub_info_t *hub,
-	uint16_t port);
+void usb_hub_process_port_interrupt(usb_hub_info_t *hub, uint16_t port);
 
 
Index: uspace/drv/bus/usb/usbhub/usbhub.c
===================================================================
--- uspace/drv/bus/usb/usbhub/usbhub.c	(revision d46b13dac28efb442c0b90728472392b4e445803)
+++ uspace/drv/bus/usb/usbhub/usbhub.c	(revision 983e13512e93a69fc24e03e23125081d7c872506)
@@ -160,7 +160,8 @@
  */
 bool hub_port_changes_callback(usb_device_t *dev,
-    uint8_t *change_bitmap, size_t change_bitmap_size, void *arg) {
+    uint8_t *change_bitmap, size_t change_bitmap_size, void *arg)
+{
 	usb_log_debug("hub_port_changes_callback\n");
-	usb_hub_info_t *hub = (usb_hub_info_t *) arg;
+	usb_hub_info_t *hub = arg;
 
 	/* FIXME: check that we received enough bytes. */
@@ -169,13 +170,14 @@
 	}
 
-	bool change;
-	change = ((uint8_t*) change_bitmap)[0] & 1;
+	/* Lowest bit indicates global change */
+	const bool change = change_bitmap[0] & 1;
 	if (change) {
 		usb_hub_process_global_interrupt(hub);
 	}
 
-	size_t port;
-	for (port = 1; port < hub->port_count + 1; port++) {
-		bool change = (change_bitmap[port / 8] >> (port % 8)) % 2;
+	/* N + 1 bit indicates change on port N */
+	size_t port = 1;
+	for (; port < hub->port_count + 1; port++) {
+		const bool change = (change_bitmap[port / 8] >> (port % 8)) & 1;
 		if (change) {
 			usb_hub_process_port_interrupt(hub, port);
@@ -184,4 +186,5 @@
 leave:
 	/* FIXME: proper interval. */
+	// TODO Interval should be handled by USB HC scheduler not here
 	async_usleep(1000 * 250);
 
@@ -205,5 +208,6 @@
 static usb_hub_info_t * usb_hub_info_create(usb_device_t *usb_dev)
 {
-	usb_hub_info_t *result = malloc(sizeof (usb_hub_info_t));
+	assert(usb_dev);
+	usb_hub_info_t *result = malloc(sizeof(usb_hub_info_t));
 	if (!result)
 	    return NULL;
@@ -215,7 +219,6 @@
 
 	result->ports = NULL;
-	result->port_count = (size_t) - 1;
+	result->port_count = -1;
 	fibril_mutex_initialize(&result->port_mutex);
-
 	fibril_mutex_initialize(&result->pending_ops_mutex);
 	fibril_condvar_initialize(&result->pending_ops_cv);
@@ -315,10 +318,12 @@
  * @return error code
  */
-static int usb_hub_set_configuration(usb_hub_info_t *hub_info) {
+static int usb_hub_set_configuration(usb_hub_info_t *hub_info)
+{
 	//device descriptor
-	usb_standard_device_descriptor_t *std_descriptor
+	const usb_standard_device_descriptor_t *std_descriptor
 	    = &hub_info->usb_device->descriptors.device;
 	usb_log_debug("Hub has %d configurations\n",
 	    std_descriptor->configuration_count);
+
 	if (std_descriptor->configuration_count < 1) {
 		usb_log_error("There are no configurations available\n");
Index: uspace/drv/bus/usb/usbhub/usbhub.h
===================================================================
--- uspace/drv/bus/usb/usbhub/usbhub.h	(revision d46b13dac28efb442c0b90728472392b4e445803)
+++ uspace/drv/bus/usb/usbhub/usbhub.h	(revision 983e13512e93a69fc24e03e23125081d7c872506)
@@ -77,16 +77,16 @@
 	 * searched again and again for the 'right pipe'.
 	 */
-	usb_pipe_t * status_change_pipe;
+	usb_pipe_t *status_change_pipe;
 
-	/** convenience pointer to control pipe
+	/** Convenience pointer to control pipe
 	 *
 	 * Control pipe is initialized in usb_device structure. This is
-	 * pointer into this structure, so that it does not have to be
-	 * searched again and again for the 'right pipe'.
+	 * pointer into that structure, so that we don't not have to
+	 * search again and again for the 'right pipe'.
 	 */
-	usb_pipe_t * control_pipe;
+	usb_pipe_t *control_pipe;
 
-	/** generic usb device data*/
-	usb_device_t * usb_device;
+	/** Generic usb device data*/
+	usb_device_t *usb_device;
 
 	/** Number of pending operations on the mutex to prevent shooting
@@ -101,5 +101,4 @@
 	/** Condition variable for pending_ops_count. */
 	fibril_condvar_t pending_ops_cv;
-
 };
 
