Index: uspace/lib/usbhid/src/hidparser.c
===================================================================
--- uspace/lib/usbhid/src/hidparser.c	(revision 1432fcf3e2fbefc36bfc27c464a5340af1e4de9d)
+++ uspace/lib/usbhid/src/hidparser.c	(revision 8242dd868e321ab0632a17f9540e87e29a674c9e)
@@ -153,5 +153,7 @@
 
 
-	report_des = usb_hid_report_find_description(report, *report_id, type);
+	report_des = usb_hid_report_find_description(report, *report_id, 
+		type);
+
 	if(report_des == NULL) {
 		return EINVAL;
@@ -167,5 +169,5 @@
 		if(USB_HID_ITEM_FLAG_CONSTANT(item->item_flags) == 0) {
 			
-			if(USB_HID_ITEM_FLAG_VARIABLE(item->item_flags) == 0) {
+			if(USB_HID_ITEM_FLAG_VARIABLE(item->item_flags) == 0){
 
 				// array
@@ -174,13 +176,19 @@
 		
 				item->usage = USB_HID_EXTENDED_USAGE(
-				    item->usages[item->value - item->physical_minimum]);
-
-				item->usage_page = USB_HID_EXTENDED_USAGE_PAGE(
-				    item->usages[item->value - item->physical_minimum]);
-
-				usb_hid_report_set_last_item (item->collection_path, 
-				    USB_HID_TAG_CLASS_GLOBAL, item->usage_page);
-
-				usb_hid_report_set_last_item (item->collection_path, 
+				    item->usages[
+				    item->value - item->physical_minimum]);
+
+				item->usage_page = 
+				    USB_HID_EXTENDED_USAGE_PAGE(
+				    item->usages[
+				    item->value - item->physical_minimum]);
+
+				usb_hid_report_set_last_item (
+				    item->collection_path, 
+				    USB_HID_TAG_CLASS_GLOBAL, 
+				    item->usage_page);
+
+				usb_hid_report_set_last_item (
+				    item->collection_path, 
 				    USB_HID_TAG_CLASS_LOCAL, item->usage);
 				
@@ -188,5 +196,6 @@
 			else {
 				// variable item
-				item->value = usb_hid_translate_data(item, data);				
+				item->value = usb_hid_translate_data(item, 
+				    data);				
 			}				
 		}
@@ -213,6 +222,6 @@
 	
 	int32_t value=0;
-	int32_t mask;
-	const uint8_t *foo;
+	int32_t mask=0;
+	const uint8_t *foo=0;
 
 	// now only shot tags are allowed
@@ -240,5 +249,5 @@
 	if((size_t)(offset/8) != (size_t)((offset+item->size-1)/8)) {
 		
-		part_size = ((offset+item->size)%8);
+		part_size = 0;
 
 		size_t i=0;
@@ -246,4 +255,5 @@
 			if(i == (size_t)(offset/8)) {
 				// the higher one
+				part_size = 8 - (offset % 8);
 				foo = data + i;
 				mask =  ((1 << (item->size-part_size))-1);
@@ -259,4 +269,5 @@
 				value = value << 8;
 				value += *(data + 1);
+				part_size += 8;
 			}
 		}
