Index: uspace/lib/usbhid/src/hidparser.c
===================================================================
--- uspace/lib/usbhid/src/hidparser.c	(revision 2cdf5204bbf5aec482525be8dc4342a78d54952a)
+++ uspace/lib/usbhid/src/hidparser.c	(revision dd19446847b88a7d55adaaa3e465bec939a3e4a9)
@@ -225,5 +225,5 @@
 	/* Than we take the higher bits from the LSB */
 	const unsigned bit_offset = item->offset % 8;
-	const int lsb_bits = min(bits, 8);
+	const int lsb_bits = min((unsigned)bits, 8 - bit_offset);
 
 	value |= (*data >> bit_offset) & BIT_RRANGE(uint8_t, lsb_bits);
