Index: uspace/lib/usbdev/src/dp.c
===================================================================
--- uspace/lib/usbdev/src/dp.c	(revision 160b75e098f96312d13cf8c93e26f0ee3e46c1a5)
+++ uspace/lib/usbdev/src/dp.c	(revision 7c95d6f581cca56abbce43deed7b2c4c3e46e2b2)
@@ -75,6 +75,6 @@
  * @return Whether @p ptr points inside <code>data->data</code> field.
  */
-static bool is_valid_descriptor_pointer(usb_dp_parser_data_t *data,
-    uint8_t *ptr)
+static bool is_valid_descriptor_pointer(const usb_dp_parser_data_t *data,
+    const uint8_t *ptr)
 {
 	if (ptr == NULL) {
@@ -100,11 +100,11 @@
  * @retval NULL Invalid input or no next descriptor.
  */
-static uint8_t *get_next_descriptor(usb_dp_parser_data_t *data,
-    uint8_t *current)
+static const uint8_t *get_next_descriptor(const usb_dp_parser_data_t *data,
+    const uint8_t *current)
 {
 	assert(is_valid_descriptor_pointer(data, current));
 
-	uint8_t current_length = *current;
-	uint8_t *next = current + current_length;
+	const uint8_t current_length = *current;
+	const uint8_t *next = current + current_length;
 
 	if (!is_valid_descriptor_pointer(data, next)) {
@@ -124,5 +124,5 @@
  * @retval -1 Invalid input.
  */
-static int get_descriptor_type(usb_dp_parser_data_t *data, uint8_t *start)
+static int get_descriptor_type(const usb_dp_parser_data_t *data, const uint8_t *start)
 {
 	if (start == NULL) {
@@ -145,8 +145,8 @@
  * @return Whether @p child could be child of @p parent.
  */
-static bool is_nested_descriptor_type(usb_dp_parser_t *parser,
+static bool is_nested_descriptor_type(const usb_dp_parser_t *parser,
     int child, int parent)
 {
-	usb_dp_descriptor_nesting_t *nesting = parser->nesting;
+	const usb_dp_descriptor_nesting_t *nesting = parser->nesting;
 	while ((nesting->child > 0) && (nesting->parent > 0)) {
 		if ((nesting->child == child) && (nesting->parent == parent)) {
@@ -166,6 +166,6 @@
  * @return Whether @p child could be child of @p parent.
  */
-static bool is_nested_descriptor(usb_dp_parser_t *parser,
-    usb_dp_parser_data_t *data, uint8_t *child, uint8_t *parent)
+static bool is_nested_descriptor(const usb_dp_parser_t *parser,
+    const usb_dp_parser_data_t *data, const uint8_t *child, const uint8_t *parent)
 {
 	return is_nested_descriptor_type(parser,
@@ -183,6 +183,6 @@
  * @retval NULL Invalid input.
  */
-uint8_t *usb_dp_get_nested_descriptor(usb_dp_parser_t *parser,
-    usb_dp_parser_data_t *data, uint8_t *parent)
+const uint8_t *usb_dp_get_nested_descriptor(const usb_dp_parser_t *parser,
+    const usb_dp_parser_data_t *data, const uint8_t *parent)
 {
 	if (!is_valid_descriptor_pointer(data, parent)) {
@@ -190,5 +190,5 @@
 	}
 
-	uint8_t *next = get_next_descriptor(data, parent);
+	const uint8_t *next = get_next_descriptor(data, parent);
 	if (next == NULL) {
 		return NULL;
@@ -211,12 +211,14 @@
  * @retval NULL Invalid input.
  */
-static uint8_t *skip_nested_descriptors(usb_dp_parser_t *parser,
-    usb_dp_parser_data_t *data, uint8_t *parent)
-{
-	uint8_t *child = usb_dp_get_nested_descriptor(parser, data, parent);
+static const uint8_t *skip_nested_descriptors(const usb_dp_parser_t *parser,
+    const usb_dp_parser_data_t *data, const uint8_t *parent)
+{
+	const uint8_t *child =
+	    usb_dp_get_nested_descriptor(parser, data, parent);
 	if (child == NULL) {
 		return get_next_descriptor(data, parent);
 	}
-	uint8_t *next_child = skip_nested_descriptors(parser, data, child);
+	const uint8_t *next_child =
+	    skip_nested_descriptors(parser, data, child);
 	while (is_nested_descriptor(parser, data, next_child, parent)) {
 		next_child = skip_nested_descriptors(parser, data, next_child);
@@ -236,6 +238,7 @@
  * @retval NULL Invalid input.
  */
-uint8_t *usb_dp_get_sibling_descriptor(usb_dp_parser_t *parser,
-    usb_dp_parser_data_t *data, uint8_t *parent, uint8_t *sibling)
+const uint8_t *usb_dp_get_sibling_descriptor(
+    const usb_dp_parser_t *parser, const usb_dp_parser_data_t *data,
+    const uint8_t *parent, const uint8_t *sibling)
 {
 	if (!is_valid_descriptor_pointer(data, parent)
@@ -244,5 +247,6 @@
 	}
 
-	uint8_t *possible_sibling = skip_nested_descriptors(parser, data, sibling);
+	const uint8_t *possible_sibling =
+	    skip_nested_descriptors(parser, data, sibling);
 	if (possible_sibling == NULL) {
 		return NULL;
@@ -269,7 +273,7 @@
  * @param arg Custom (user) argument.
  */
-static void usb_dp_browse_simple_internal(usb_dp_parser_t *parser,
-    usb_dp_parser_data_t *data, uint8_t *root, size_t depth,
-    void (*callback)(uint8_t *, size_t, void *), void *arg)
+static void usb_dp_browse_simple_internal(const usb_dp_parser_t *parser,
+    const usb_dp_parser_data_t *data, const uint8_t *root, size_t depth,
+    void (*callback)(const uint8_t *, size_t, void *), void *arg)
 {
 	if (root == NULL) {
@@ -277,5 +281,5 @@
 	}
 	callback(root, depth, arg);
-	uint8_t *child = usb_dp_get_nested_descriptor(parser, data, root);
+	const uint8_t *child = usb_dp_get_nested_descriptor(parser, data, root);
 	do {
 		usb_dp_browse_simple_internal(parser, data, child, depth + 1,
@@ -301,6 +305,6 @@
  */
 void usb_dp_walk_simple(uint8_t *descriptors, size_t descriptors_size,
-    usb_dp_descriptor_nesting_t *descriptor_nesting,
-    void (*callback)(uint8_t *, size_t, void *), void *arg)
+    const usb_dp_descriptor_nesting_t *descriptor_nesting,
+    walk_callback_t callback, void *arg)
 {
 	if ((descriptors == NULL) || (descriptors_size == 0)
@@ -309,5 +313,5 @@
 	}
 
-	usb_dp_parser_data_t data = {
+	const usb_dp_parser_data_t data = {
 		.data = descriptors,
 		.size = descriptors_size,
@@ -315,5 +319,5 @@
 	};
 
-	usb_dp_parser_t parser = {
+	const usb_dp_parser_t parser = {
 		.nesting = descriptor_nesting
 	};
