Index: uspace/drv/uhci-hcd/hc.c
===================================================================
--- uspace/drv/uhci-hcd/hc.c	(revision 895351428f9eb52101cbee925fdef97430311f38)
+++ uspace/drv/uhci-hcd/hc.c	(revision e247d83f26c1f9fc072e178ccded2ab08a6893c0)
@@ -85,5 +85,5 @@
 	/* allow access to hc control registers */
 	regs_t *io;
-	ret = pio_enable(regs, reg_size, (void**)&io);
+	ret = pio_enable(regs, reg_size, (void **)&io);
 	CHECK_RET_RETURN(ret,
 	    "Failed(%d) to gain access to registers at %p: %s.\n",
@@ -143,5 +143,5 @@
 	}
 
-	uint16_t status = pio_read_16(&registers->usbcmd);
+	const uint16_t status = pio_read_16(&registers->usbcmd);
 	if (status != 0)
 		usb_log_warning("Previous command value: %x.\n", status);
@@ -212,5 +212,5 @@
 	/* Init USB frame list page*/
 	instance->frame_list = get_page();
-	ret = instance ? EOK : ENOMEM;
+	ret = instance->frame_list ? EOK : ENOMEM;
 	CHECK_RET_RETURN(ret, "Failed to get frame list page.\n");
 	usb_log_debug("Initialized frame list at %p.\n", instance->frame_list);
@@ -277,5 +277,6 @@
 		&instance->transfers_control_slow);
 
-	/*FSBR*/
+	/*FSBR, This feature is not needed (adds no benefit) and is supposedly
+	 * buggy on certain hw, enable at your own risk. */
 #ifdef FSBR
 	transfer_list_set_next(&instance->transfers_bulk_full,
@@ -428,5 +429,5 @@
 		}
 
-		uintptr_t frame_list =
+		const uintptr_t frame_list =
 		    pio_read_32(&instance->registers->flbaseadd) & ~0xfff;
 		if (frame_list != addr_to_phys(instance->frame_list)) {
Index: uspace/drv/uhci-hcd/hc.h
===================================================================
--- uspace/drv/uhci-hcd/hc.h	(revision 895351428f9eb52101cbee925fdef97430311f38)
+++ uspace/drv/uhci-hcd/hc.h	(revision e247d83f26c1f9fc072e178ccded2ab08a6893c0)
@@ -154,5 +154,8 @@
  */
 static inline hc_t * fun_to_hc(ddf_fun_t *fun)
-	{ return (hc_t*)fun->driver_data; }
+{
+	assert(fun);
+	return fun->driver_data;
+}
 #endif
 /**
Index: uspace/drv/uhci-hcd/pci.c
===================================================================
--- uspace/drv/uhci-hcd/pci.c	(revision 895351428f9eb52101cbee925fdef97430311f38)
+++ uspace/drv/uhci-hcd/pci.c	(revision e247d83f26c1f9fc072e178ccded2ab08a6893c0)
@@ -52,8 +52,11 @@
  * @return Error code.
  */
-int pci_get_my_registers(ddf_dev_t *dev,
+int pci_get_my_registers(const ddf_dev_t *dev,
     uintptr_t *io_reg_address, size_t *io_reg_size, int *irq_no)
 {
-	assert(dev != NULL);
+	assert(dev);
+	assert(io_reg_address);
+	assert(io_reg_size);
+	assert(irq_no);
 
 	int parent_phone =
@@ -66,5 +69,6 @@
 	int rc = hw_res_get_resource_list(parent_phone, &hw_resources);
 	if (rc != EOK) {
-		goto leave;
+		async_hangup(parent_phone);
+		return rc;
 	}
 
@@ -78,5 +82,5 @@
 	size_t i;
 	for (i = 0; i < hw_resources.count; i++) {
-		hw_resource_t *res = &hw_resources.resources[i];
+		const hw_resource_t *res = &hw_resources.resources[i];
 		switch (res->type)
 		{
@@ -99,9 +103,8 @@
 		}
 	}
+	async_hangup(parent_phone);
 
-	if (!io_found || !irq_found) {
-		rc = ENOENT;
-		goto leave;
-	}
+	if (!io_found || !irq_found)
+		return ENOENT;
 
 	*io_reg_address = io_address;
@@ -109,8 +112,5 @@
 	*irq_no = irq;
 
-	rc = EOK;
-leave:
-	async_hangup(parent_phone);
-	return rc;
+	return EOK;
 }
 /*----------------------------------------------------------------------------*/
@@ -120,9 +120,12 @@
  * @return Error code.
  */
-int pci_enable_interrupts(ddf_dev_t *device)
+int pci_enable_interrupts(const ddf_dev_t *device)
 {
-	int parent_phone = devman_parent_device_connect(device->handle,
-	    IPC_FLAG_BLOCKING);
-	bool enabled = hw_res_enable_interrupt(parent_phone);
+	const int parent_phone =
+	    devman_parent_device_connect(device->handle, IPC_FLAG_BLOCKING);
+	if (parent_phone < 0) {
+		return parent_phone;
+	}
+	const bool enabled = hw_res_enable_interrupt(parent_phone);
 	async_hangup(parent_phone);
 	return enabled ? EOK : EIO;
@@ -134,8 +137,8 @@
  * @return Error code.
  */
-int pci_disable_legacy(ddf_dev_t *device)
+int pci_disable_legacy(const ddf_dev_t *device)
 {
 	assert(device);
-	int parent_phone =
+	const int parent_phone =
 	    devman_parent_device_connect(device->handle, IPC_FLAG_BLOCKING);
 	if (parent_phone < 0) {
@@ -145,8 +148,8 @@
 	/* See UHCI design guide for these values p.45,
 	 * write all WC bits in USB legacy register */
-	sysarg_t address = 0xc0;
-	sysarg_t value = 0xaf00;
+	const sysarg_t address = 0xc0;
+	const sysarg_t value = 0xaf00;
 
-	int rc = async_req_3_0(parent_phone, DEV_IFACE_ID(PCI_DEV_IFACE),
+	const int rc = async_req_3_0(parent_phone, DEV_IFACE_ID(PCI_DEV_IFACE),
 	    IPC_M_CONFIG_SPACE_WRITE_16, address, value);
 	async_hangup(parent_phone);
Index: uspace/drv/uhci-hcd/pci.h
===================================================================
--- uspace/drv/uhci-hcd/pci.h	(revision 895351428f9eb52101cbee925fdef97430311f38)
+++ uspace/drv/uhci-hcd/pci.h	(revision e247d83f26c1f9fc072e178ccded2ab08a6893c0)
@@ -38,7 +38,7 @@
 #include <ddf/driver.h>
 
-int pci_get_my_registers(ddf_dev_t *, uintptr_t *, size_t *, int *);
-int pci_enable_interrupts(ddf_dev_t *);
-int pci_disable_legacy(ddf_dev_t *);
+int pci_get_my_registers(const ddf_dev_t *, uintptr_t *, size_t *, int *);
+int pci_enable_interrupts(const ddf_dev_t *);
+int pci_disable_legacy(const ddf_dev_t *);
 
 #endif
Index: uspace/drv/uhci-hcd/root_hub.c
===================================================================
--- uspace/drv/uhci-hcd/root_hub.c	(revision 895351428f9eb52101cbee925fdef97430311f38)
+++ uspace/drv/uhci-hcd/root_hub.c	(revision e247d83f26c1f9fc072e178ccded2ab08a6893c0)
@@ -60,4 +60,5 @@
 		return ret;
 	}
+	assert(match_str);
 
 	ret = ddf_fun_add_match_id(fun, match_str, 100);
Index: uspace/drv/uhci-hcd/transfer_list.c
===================================================================
--- uspace/drv/uhci-hcd/transfer_list.c	(revision 895351428f9eb52101cbee925fdef97430311f38)
+++ uspace/drv/uhci-hcd/transfer_list.c	(revision e247d83f26c1f9fc072e178ccded2ab08a6893c0)
@@ -58,5 +58,5 @@
 		return ENOMEM;
 	}
-	uint32_t queue_head_pa = addr_to_phys(instance->queue_head);
+	const uint32_t queue_head_pa = addr_to_phys(instance->queue_head);
 	usb_log_debug2("Transfer list %s setup with QH: %p (%#" PRIx32" ).\n",
 	    name, instance->queue_head, queue_head_pa);
@@ -90,7 +90,6 @@
 {
 	assert(instance);
+	assert(instance->queue_head);
 	assert(next);
-	if (!instance->queue_head)
-		return;
 	/* Set queue_head.next to point to the follower */
 	qh_set_next_qh(instance->queue_head, next->queue_head);
@@ -137,5 +136,5 @@
 	write_barrier();
 
-	/* Add to the driver list */
+	/* Add to the driver's list */
 	list_append(&batch->link, &instance->batch_list);
 
@@ -160,5 +159,5 @@
 	link_t *current = instance->batch_list.next;
 	while (current != &instance->batch_list) {
-		link_t *next = current->next;
+		link_t * const next = current->next;
 		usb_transfer_batch_t *batch =
 		    usb_transfer_batch_from_link(current);
@@ -182,5 +181,5 @@
 	fibril_mutex_lock(&instance->guard);
 	while (!list_empty(&instance->batch_list)) {
-		link_t *current = instance->batch_list.next;
+		link_t * const current = instance->batch_list.next;
 		usb_transfer_batch_t *batch =
 		    usb_transfer_batch_from_link(current);
Index: uspace/drv/uhci-hcd/uhci.c
===================================================================
--- uspace/drv/uhci-hcd/uhci.c	(revision 895351428f9eb52101cbee925fdef97430311f38)
+++ uspace/drv/uhci-hcd/uhci.c	(revision e247d83f26c1f9fc072e178ccded2ab08a6893c0)
@@ -77,5 +77,7 @@
 {
 	assert(dev);
-	hc_t *hc = &((uhci_t*)dev->driver_data)->hc;
+	uhci_t *uhci = dev->driver_data;
+	assert(uhci);
+	hc_t *hc = &uhci->hc;
 	uint16_t status = IPC_GET_ARG1(*call);
 	assert(hc);
@@ -144,5 +146,7 @@
 {
 	assert(fun);
-	return &((rh_t*)fun->driver_data)->resource_list;
+	rh_t *rh = fun->driver_data;
+	assert(rh);
+	return &rh->resource_list;
 }
 /*----------------------------------------------------------------------------*/
Index: uspace/drv/uhci-hcd/uhci.h
===================================================================
--- uspace/drv/uhci-hcd/uhci.h	(revision 895351428f9eb52101cbee925fdef97430311f38)
+++ uspace/drv/uhci-hcd/uhci.h	(revision e247d83f26c1f9fc072e178ccded2ab08a6893c0)
@@ -35,5 +35,4 @@
 #ifndef DRV_UHCI_UHCI_H
 #define DRV_UHCI_UHCI_H
-#include <ddi.h>
 #include <ddf/driver.h>
 
Index: uspace/drv/uhci-rhd/port.c
===================================================================
--- uspace/drv/uhci-rhd/port.c	(revision 895351428f9eb52101cbee925fdef97430311f38)
+++ uspace/drv/uhci-rhd/port.c	(revision e247d83f26c1f9fc072e178ccded2ab08a6893c0)
@@ -209,5 +209,5 @@
 int uhci_port_reset_enable(int portno, void *arg)
 {
-	uhci_port_t *port = (uhci_port_t *) arg;
+	uhci_port_t *port = arg;
 
 	usb_log_debug2("%s: new_device_enable_port.\n", port->id_string);
