Index: uspace/lib/usbhid/src/hiddescriptor.c
===================================================================
--- uspace/lib/usbhid/src/hiddescriptor.c	(revision dc122622bc947e1d697ecaa0da3e88b197e31f5e)
+++ uspace/lib/usbhid/src/hiddescriptor.c	(revision 9abe2e5367e0d71b259840713b8cf79d80d97fc6)
@@ -737,19 +737,20 @@
  * @return Error code
  */
-int usb_hid_report_parse_local_tag(uint8_t tag, const uint8_t *data, 
-	size_t item_size, usb_hid_report_item_t *report_item, 
-	usb_hid_report_path_t *usage_path)
+int usb_hid_report_parse_local_tag(uint8_t tag, const uint8_t *data,
+    size_t item_size, usb_hid_report_item_t *report_item,
+    usb_hid_report_path_t *usage_path)
 {
 	int32_t extended_usage;
 	
-	switch(tag) {
+	switch (tag) {
 	case USB_HID_REPORT_TAG_USAGE:
-		switch(report_item->in_delimiter) {
+		switch (report_item->in_delimiter) {
 		case INSIDE_DELIMITER_SET:
-			/* nothing to do
-			 * we catch only the first one
+			/*
+			 * Nothing to do.
+			 * We catch only the first one
 			 */
 			break;
-	
+			
 		case START_DELIMITER_SET:
 			report_item->in_delimiter = INSIDE_DELIMITER_SET;
@@ -757,10 +758,10 @@
 		case OUTSIDE_DELIMITER_SET:
 			extended_usage = ((report_item->usage_page) << 16);
-			extended_usage += usb_hid_report_tag_data_uint32(
-				data,item_size);
-
-			report_item->usages[report_item->usages_count] = 
-				extended_usage;
-
+			extended_usage +=
+			    usb_hid_report_tag_data_uint32(data, item_size);
+			
+			report_item->usages[report_item->usages_count] =
+			    extended_usage;
+			
 			report_item->usages_count++;
 			break;
@@ -768,105 +769,99 @@
 		break;
 		
-	case USB_HID_REPORT_TAG_USAGE_MINIMUM:			
+	case USB_HID_REPORT_TAG_USAGE_MINIMUM:
 		if (item_size == 3) {
-			// usage extended usages
-			report_item->extended_usage_page = 
+			/* Usage extended usages */
+			report_item->extended_usage_page =
+			    USB_HID_EXTENDED_USAGE_PAGE(
+			    usb_hid_report_tag_data_uint32(data, item_size));
+			
+			
+			report_item->usage_minimum =
+			    USB_HID_EXTENDED_USAGE(
+			    usb_hid_report_tag_data_uint32(data, item_size));
+		} else {
+			report_item->usage_minimum =
+			    usb_hid_report_tag_data_uint32(data, item_size);
+		}
+		break;
+		
+	case USB_HID_REPORT_TAG_USAGE_MAXIMUM:
+		if (item_size == 3) {
+			if (report_item->extended_usage_page !=
+			    USB_HID_EXTENDED_USAGE_PAGE(
+			    usb_hid_report_tag_data_uint32(data, item_size))) {
+				return EINVAL;
+			}
+			
+			/* Usage extended usages */
+			report_item->extended_usage_page =
 			    USB_HID_EXTENDED_USAGE_PAGE(
 			    usb_hid_report_tag_data_uint32(data,item_size));
-			   
-
-			report_item->usage_minimum = 
+			
+			report_item->usage_maximum =
 			    USB_HID_EXTENDED_USAGE(
 			    usb_hid_report_tag_data_uint32(data,item_size));
-		}
-		else {
-			report_item->usage_minimum = 
+		} else {
+			report_item->usage_maximum =
 			    usb_hid_report_tag_data_uint32(data,item_size);
 		}
-		break;
-	
-	case USB_HID_REPORT_TAG_USAGE_MAXIMUM:
-		if (item_size == 3) {
-			if(report_item->extended_usage_page != 
-			    USB_HID_EXTENDED_USAGE_PAGE(	
-			    usb_hid_report_tag_data_uint32(data,item_size))) {
-				
-				return EINVAL;
-			}
-				
-			// usage extended usages
-			report_item->extended_usage_page = 
-				USB_HID_EXTENDED_USAGE_PAGE(
-				usb_hid_report_tag_data_uint32(data,item_size));
-
-			report_item->usage_maximum = 
-				USB_HID_EXTENDED_USAGE(
-				usb_hid_report_tag_data_uint32(data,item_size));
-		}
-		else {
-			report_item->usage_maximum = 
-				usb_hid_report_tag_data_uint32(data,item_size);
-		}
-
-		// vlozit zaznamy do pole usages
-		int32_t i;
-		for(i = report_item->usage_minimum; 
+		
+		/* Put the records into the usages array */
+		for (int32_t i = report_item->usage_minimum;
 		    i <= report_item->usage_maximum; i++) {
-
-			if(report_item->extended_usage_page) {
-			    report_item->usages[report_item->usages_count++] = 
-				(report_item->extended_usage_page << 16) + i;
-			}
-			else {			
-			    report_item->usages[report_item->usages_count++] = 
-				(report_item->usage_page << 16) + i;
+			
+			if (report_item->extended_usage_page) {
+				report_item->usages[report_item->usages_count++] =
+				    (report_item->extended_usage_page << 16) + i;
+			} else {
+				report_item->usages[report_item->usages_count++] =
+				    (report_item->usage_page << 16) + i;
 			}
 		}
 		report_item->extended_usage_page = 0;
-			
+		
 		break;
 		
 	case USB_HID_REPORT_TAG_DESIGNATOR_INDEX:
-		report_item->designator_index = 
-			usb_hid_report_tag_data_uint32(data,item_size);
+		report_item->designator_index =
+		    usb_hid_report_tag_data_uint32(data, item_size);
 		break;
 	
 	case USB_HID_REPORT_TAG_DESIGNATOR_MINIMUM:
-		report_item->designator_minimum = 
-			usb_hid_report_tag_data_uint32(data,item_size);
-		break;
-
+		report_item->designator_minimum =
+		    usb_hid_report_tag_data_uint32(data, item_size);
+		break;
+	
 	case USB_HID_REPORT_TAG_DESIGNATOR_MAXIMUM:
-		report_item->designator_maximum = 
-			usb_hid_report_tag_data_uint32(data,item_size);
-		break;
-
+		report_item->designator_maximum =
+		    usb_hid_report_tag_data_uint32(data, item_size);
+		break;
+	
 	case USB_HID_REPORT_TAG_STRING_INDEX:
-		report_item->string_index = 
-			usb_hid_report_tag_data_uint32(data,item_size);
-		break;
-
+		report_item->string_index =
+		    usb_hid_report_tag_data_uint32(data, item_size);
+		break;
+	
 	case USB_HID_REPORT_TAG_STRING_MINIMUM:
-		report_item->string_minimum = 
-			usb_hid_report_tag_data_uint32(data,item_size);
-		break;
-
+		report_item->string_minimum =
+		    usb_hid_report_tag_data_uint32(data, item_size);
+		break;
+	
 	case USB_HID_REPORT_TAG_STRING_MAXIMUM:
-		report_item->string_maximum = 
-			usb_hid_report_tag_data_uint32(data,item_size);
-		break;			
-
+		report_item->string_maximum =
+		    usb_hid_report_tag_data_uint32(data, item_size);
+		break;
+	
 	case USB_HID_REPORT_TAG_DELIMITER:
-		report_item->in_delimiter = 
-			usb_hid_report_tag_data_uint32(data,item_size);
-		break;
-
+		report_item->in_delimiter =
+		    usb_hid_report_tag_data_uint32(data, item_size);
+		break;
+	
 	default:
 		return USB_HID_NO_ACTION;
 	}
-
+	
 	return EOK;
 }
-
 
 /**
Index: uspace/lib/usbhid/src/hidpath.c
===================================================================
--- uspace/lib/usbhid/src/hidpath.c	(revision dc122622bc947e1d697ecaa0da3e88b197e31f5e)
+++ uspace/lib/usbhid/src/hidpath.c	(revision 9abe2e5367e0d71b259840713b8cf79d80d97fc6)
@@ -185,58 +185,54 @@
 }
 
-
-/**
- * Compares two usage paths structures
- *
- *
- * @param report_path usage path structure to compare with @path 
- * @param path usage patrh structure to compare
- * @param flags Flags determining the mode of comparison
+/** Compare two usage paths structures
+ *
+ * @param report_path Usage path structure to compare with @path
+ * @param path        Usage patrh structure to compare
+ * @param flags       Flags determining the mode of comparison
+ *
  * @return EOK if both paths are identical, non zero number otherwise
- */
-int usb_hid_report_compare_usage_path(usb_hid_report_path_t *report_path, 
-                                      usb_hid_report_path_t *path,
-                                      int flags)
+ *
+ */
+int usb_hid_report_compare_usage_path(usb_hid_report_path_t *report_path,
+    usb_hid_report_path_t *path, int flags)
 {
 	usb_hid_report_usage_path_t *report_item;
 	usb_hid_report_usage_path_t *path_item;
-
+	
 	link_t *report_link;
 	link_t *path_link;
-
+	
 	int only_page;
-
-	if(report_path->report_id != path->report_id) {
-		if(path->report_id != 0) {
+	
+	if (report_path->report_id != path->report_id) {
+		if (path->report_id != 0) {
 			return 1;
 		}
 	}
-
+	
 	// Empty path match all others
-	if(path->depth == 0){
+	if (path->depth == 0) {
 		return EOK;
 	}
-
-
-	if((only_page = flags & USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY) != 0){
+	
+	if ((only_page = flags & USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY) != 0) {
 		flags -= USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY;
 	}
 	
-	switch(flags){
-	/* path is somewhere in report_path */
+	switch (flags) {
+	/* Path is somewhere in report_path */
 	case USB_HID_PATH_COMPARE_ANYWHERE:
-		if(path->depth != 1){
+		if (path->depth != 1) {
 			return 1;
 		}
-
+		
 		path_link = list_first(&path->items);
 		path_item = list_get_instance(path_link,
-			usb_hid_report_usage_path_t, rpath_items_link);
-
+		    usb_hid_report_usage_path_t, rpath_items_link);
+		
 		list_foreach(report_path->items, rpath_items_link,
 		    usb_hid_report_usage_path_t, report_item) {
-
 			if (USB_HID_SAME_USAGE_PAGE(report_item->usage_page,
-				path_item->usage_page)) {
+			    path_item->usage_page)) {
 				
 				if (only_page == 0) {
@@ -244,24 +240,22 @@
 					    path_item->usage))
 						return EOK;
-				}
-				else {
+				} else {
 					return EOK;
 				}
 			}
 		}
-
+		
 		return 1;
 		break;
-
-	/* the paths must be identical */
+	
+	/* The paths must be identical */
 	case USB_HID_PATH_COMPARE_STRICT:
-		if(report_path->depth != path->depth){
+		if (report_path->depth != path->depth) {
 			return 1;
 		}
 		/* Fallthrough */
-
-	/* path is prefix of the report_path */
+	
+	/* Path is prefix of the report_path */
 	case USB_HID_PATH_COMPARE_BEGIN:
-
 		report_link = report_path->items.head.next;
 		path_link = path->items.head.next;
@@ -270,13 +264,13 @@
 		    (path_link != &path->items.head)) {
 			
-			report_item = list_get_instance(report_link, 
+			report_item = list_get_instance(report_link,
 			    usb_hid_report_usage_path_t, rpath_items_link);
 			
 			path_item = list_get_instance(path_link,
-       				usb_hid_report_usage_path_t, rpath_items_link);
-
-			if (!USB_HID_SAME_USAGE_PAGE(report_item->usage_page, 
-			    path_item->usage_page) || ((only_page == 0) && 
-			    !USB_HID_SAME_USAGE(report_item->usage, 
+			    usb_hid_report_usage_path_t, rpath_items_link);
+			
+			if (!USB_HID_SAME_USAGE_PAGE(report_item->usage_page,
+			    path_item->usage_page) || ((only_page == 0) &&
+			    !USB_HID_SAME_USAGE(report_item->usage,
 			    path_item->usage))) {
 				return 1;
@@ -286,8 +280,8 @@
 			}
 		}
-
-		if ((((flags & USB_HID_PATH_COMPARE_BEGIN) != 0) && 
-		    (path_link == &path->items.head)) || 
-		    ((report_link == &report_path->items.head) && 
+		
+		if ((((flags & USB_HID_PATH_COMPARE_BEGIN) != 0) &&
+		    (path_link == &path->items.head)) ||
+		    ((report_link == &report_path->items.head) &&
 		    (path_link == &path->items.head))) {
 			return EOK;
@@ -296,51 +290,44 @@
 		}
 		break;
-
-	/* path is suffix of report_path */
+	
+	/* Path is suffix of report_path */
 	case USB_HID_PATH_COMPARE_END:
-
 		report_link = report_path->items.head.prev;
 		path_link = path->items.head.prev;
-
-		if(list_empty(&path->items)){
+		
+		if (list_empty(&path->items)) {
 			return EOK;
 		}
+		
+		while ((report_link != &report_path->items.head) &&
+		      (path_link != &path->items.head)) {
+			report_item = list_get_instance(report_link,
+			    usb_hid_report_usage_path_t, rpath_items_link);
 			
-		while((report_link != &report_path->items.head) && 
-		      (path_link != &path->items.head)) {
-						  
-			report_item = list_get_instance(report_link,
-				usb_hid_report_usage_path_t, rpath_items_link);
-
-			path_item = list_get_instance(path_link, 
-				usb_hid_report_usage_path_t, rpath_items_link);
-						  
-			if(!USB_HID_SAME_USAGE_PAGE(report_item->usage_page, 
-				path_item->usage_page) || ((only_page == 0) && 
-			    !USB_HID_SAME_USAGE(report_item->usage, 
-				path_item->usage))) {
-						
-					return 1;
+			path_item = list_get_instance(path_link,
+			    usb_hid_report_usage_path_t, rpath_items_link);
+			
+			if (!USB_HID_SAME_USAGE_PAGE(report_item->usage_page,
+			    path_item->usage_page) || ((only_page == 0) &&
+			    !USB_HID_SAME_USAGE(report_item->usage,
+			    path_item->usage))) {
+				return 1;
 			} else {
 				report_link = report_link->prev;
-				path_link = path_link->prev;			
+				path_link = path_link->prev;
 			}
-
-		}
-
-		if(path_link == &path->items.head) {
+		}
+		
+		if (path_link == &path->items.head) {
 			return EOK;
-		}
-		else {
+		} else {
 			return 1;
-		}						
-			
+		}
 		break;
-
+	
 	default:
 		return EINVAL;
 	}
 }
-
 
 /**
