Index: uspace/drv/audio/sb16/dsp.c
===================================================================
--- uspace/drv/audio/sb16/dsp.c	(revision c188c62aa2ffa4dc0f6451547f7cdb1966d6eb8d)
+++ uspace/drv/audio/sb16/dsp.c	(revision 81b9d3ed6af6996e5039aa44755f6f7a9b396e2f)
@@ -75,5 +75,5 @@
 		[DSP_NO_BUFFER] = "NO BUFFER",
 	};
-	if (state < ARRAY_SIZE(state_names))
+	if ((size_t)state < ARRAY_SIZE(state_names))
 		return state_names[state];
 	return "UNKNOWN";
@@ -144,7 +144,9 @@
 {
 	dsp_write(dsp, SET_SAMPLING_RATE_OUTPUT);
-	dsp_write(dsp, rate >> 8);
-	dsp_write(dsp, rate & 0xff);
-	ddf_log_verbose("Sampling rate: %hhx:%hhx.", rate >> 8, rate & 0xff);
+	uint8_t rate_lo = rate & 0xff;
+	uint8_t rate_hi = rate >> 8;
+	dsp_write(dsp, rate_hi);
+	dsp_write(dsp, rate_lo);
+	ddf_log_verbose("Sampling rate: %hhx:%hhx.", rate_hi, rate_lo);
 }
 
@@ -202,9 +204,4 @@
 	
 	return ret;
-}
-
-static inline size_t sample_count(pcm_sample_format_t format, size_t byte_count)
-{
-	return byte_count / pcm_sample_format_size(format);
 }
 
Index: uspace/drv/bus/isa/i8237.c
===================================================================
--- uspace/drv/bus/isa/i8237.c	(revision c188c62aa2ffa4dc0f6451547f7cdb1966d6eb8d)
+++ uspace/drv/bus/isa/i8237.c	(revision 81b9d3ed6af6996e5039aa44755f6f7a9b396e2f)
@@ -371,5 +371,5 @@
 	
 	/* 16 bit transfers are a bit special */
-	ddf_msg(LVL_DEBUG, "Unspoiled address %#" PRIx32 " (size %" PRIu16 ")",
+	ddf_msg(LVL_DEBUG, "Unspoiled address %#" PRIx32 " (size %" PRIu32 ")",
 	    pa, size);
 	if (is_dma16(channel)) {
@@ -388,5 +388,5 @@
 	
 	ddf_msg(LVL_DEBUG, "Setting channel %u to address %#" PRIx32 " "
-	    "(size %" PRIu16 "), mode %hhx.", channel, pa, size, mode);
+	    "(size %" PRIu32 "), mode %hhx.", channel, pa, size, mode);
 	
 	/* Mask DMA request */
Index: uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.c
===================================================================
--- uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.c	(revision c188c62aa2ffa4dc0f6451547f7cdb1966d6eb8d)
+++ uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.c	(revision 81b9d3ed6af6996e5039aa44755f6f7a9b396e2f)
@@ -78,5 +78,5 @@
 
 	/* Allow less data on input. */
-	if (dir == USB_DIRECTION_IN) {
+	if (direction == USB_DIRECTION_IN) {
 		OHCI_MEM32_SET(instance->status, TD_STATUS_ROUND_FLAG);
 	}
Index: uspace/drv/bus/usb/ohci/ohci_rh.c
===================================================================
--- uspace/drv/bus/usb/ohci/ohci_rh.c	(revision c188c62aa2ffa4dc0f6451547f7cdb1966d6eb8d)
+++ uspace/drv/bus/usb/ohci/ohci_rh.c	(revision 81b9d3ed6af6996e5039aa44755f6f7a9b396e2f)
@@ -367,5 +367,5 @@
 	case USB_HUB_FEATURE_C_PORT_RESET:        /*20*/
 		usb_log_debug2("Clearing port C_CONNECTION, C_ENABLE, "
-		    "C_SUSPEND, C_OC or C_RESET on port %"PRIu16".\n", port);
+		    "C_SUSPEND, C_OC or C_RESET on port %u.\n", port);
 		/* Bit offsets correspond to the feature number */
 		OHCI_WR(hub->registers->rh_port_status[port],
@@ -416,5 +416,5 @@
 	case USB_HUB_FEATURE_PORT_RESET:   /*4*/
 		usb_log_debug2("Setting port POWER, ENABLE, SUSPEND or RESET "
-		    "on port %"PRIu16".\n", port);
+		    "on port %u.\n", port);
 		/* Bit offsets correspond to the feature number */
 		OHCI_WR(hub->registers->rh_port_status[port], 1 << feature);
Index: uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c
===================================================================
--- uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c	(revision c188c62aa2ffa4dc0f6451547f7cdb1966d6eb8d)
+++ uspace/drv/fb/amdm37x_dispc/amdm37x_dispc.c	(revision 81b9d3ed6af6996e5039aa44755f6f7a9b396e2f)
@@ -267,5 +267,5 @@
 	amdm37x_dispc_t *dispc = vis->dev_ctx;
 	const visual_t visual = mode.cell_visual.pixel_visual;
-	assert(visual < sizeof(pixel2visual_table) / sizeof(pixel2visual_table[0]));
+	assert((size_t)visual < sizeof(pixel2visual_table) / sizeof(pixel2visual_table[0]));
 	const unsigned bpp = pixel2visual_table[visual].bpp;
 	pixel2visual_t p2v = pixel2visual_table[visual].func;
Index: uspace/drv/fb/kfb/port.c
===================================================================
--- uspace/drv/fb/kfb/port.c	(revision c188c62aa2ffa4dc0f6451547f7cdb1966d6eb8d)
+++ uspace/drv/fb/kfb/port.c	(revision 81b9d3ed6af6996e5039aa44755f6f7a9b396e2f)
@@ -66,4 +66,5 @@
 
 typedef struct {
+	sysarg_t paddr;
 	sysarg_t width;
 	sysarg_t height;
@@ -85,71 +86,24 @@
 static vslmode_list_element_t pixel_mode;
 
-static pixel_t color_table[16] = {
-	[COLOR_BLACK]       = 0x000000,
-	[COLOR_BLUE]        = 0x0000f0,
-	[COLOR_GREEN]       = 0x00f000,
-	[COLOR_CYAN]        = 0x00f0f0,
-	[COLOR_RED]         = 0xf00000,
-	[COLOR_MAGENTA]     = 0xf000f0,
-	[COLOR_YELLOW]      = 0xf0f000,
-	[COLOR_WHITE]       = 0xf0f0f0,
-
-	[COLOR_BLACK + 8]   = 0x000000,
-	[COLOR_BLUE + 8]    = 0x0000ff,
-	[COLOR_GREEN + 8]   = 0x00ff00,
-	[COLOR_CYAN + 8]    = 0x00ffff,
-	[COLOR_RED + 8]     = 0xff0000,
-	[COLOR_MAGENTA + 8] = 0xff00ff,
-	[COLOR_YELLOW + 8]  = 0xffff00,
-	[COLOR_WHITE + 8]   = 0xffffff,
-};
-
-static inline void attrs_rgb(char_attrs_t attrs, pixel_t *bgcolor, pixel_t *fgcolor)
-{
-	switch (attrs.type) {
-	case CHAR_ATTR_STYLE:
-		switch (attrs.val.style) {
-		case STYLE_NORMAL:
-			*bgcolor = color_table[COLOR_WHITE];
-			*fgcolor = color_table[COLOR_BLACK];
-			break;
-		case STYLE_EMPHASIS:
-			*bgcolor = color_table[COLOR_WHITE];
-			*fgcolor = color_table[COLOR_RED];
-			break;
-		case STYLE_INVERTED:
-			*bgcolor = color_table[COLOR_BLACK];
-			*fgcolor = color_table[COLOR_WHITE];
-			break;
-		case STYLE_SELECTED:
-			*bgcolor = color_table[COLOR_RED];
-			*fgcolor = color_table[COLOR_WHITE];
-			break;
-		}
-		break;
-	case CHAR_ATTR_INDEX:
-		*bgcolor = color_table[(attrs.val.index.bgcolor & 7) |
-		    ((attrs.val.index.attr & CATTR_BRIGHT) ? 8 : 0)];
-		*fgcolor = color_table[(attrs.val.index.fgcolor & 7) |
-		    ((attrs.val.index.attr & CATTR_BRIGHT) ? 8 : 0)];
-		break;
-	case CHAR_ATTR_RGB:
-		*bgcolor = attrs.val.rgb.bgcolor;
-		*fgcolor = attrs.val.rgb.fgcolor;
-		break;
-	}
-}
-
 static int kfb_claim(visualizer_t *vs)
 {
-	return EOK;
+	return physmem_map(kfb.paddr + kfb.offset,
+	    ALIGN_UP(kfb.size, PAGE_SIZE) >> PAGE_WIDTH,
+	    AS_AREA_READ | AS_AREA_WRITE, (void *) &kfb.addr);
 }
 
 static int kfb_yield(visualizer_t *vs)
 {
+	int rc;
+
 	if (vs->mode_set) {
 		vs->ops.handle_damage = NULL;
 	}
 
+	rc = physmem_unmap(kfb.addr);
+	if (rc != EOK)
+		return rc;
+
+	kfb.addr = NULL;
 	return EOK;
 }
@@ -211,7 +165,14 @@
 {
 	visualizer_t *vsl;
+	int rc;
 
 	vsl = (visualizer_t *) ddf_fun_data_get((ddf_fun_t *)arg);
 	graph_visualizer_connection(vsl, iid, icall, NULL);
+
+	if (kfb.addr != NULL) {
+		rc = physmem_unmap(kfb.addr);
+		if (rc == EOK)
+			kfb.addr = NULL;
+	}
 }
 
@@ -266,4 +227,5 @@
 	kfb.width = width;
 	kfb.height = height;
+	kfb.paddr = paddr;
 	kfb.offset = offset;
 	kfb.scanline = scanline;
@@ -343,10 +305,4 @@
 	kfb.size = scanline * height;
 	kfb.addr = AS_AREA_ANY;
-	
-	rc = physmem_map(paddr + offset,
-	    ALIGN_UP(kfb.size, PAGE_SIZE) >> PAGE_WIDTH,
-	    AS_AREA_READ | AS_AREA_WRITE, (void *) &kfb.addr);
-	if (rc != EOK)
-		return rc;
 	
 	ddf_fun_t *fun_vs = ddf_fun_create(dev, fun_exposed, "vsl0");
Index: uspace/drv/nic/e1k/e1k.c
===================================================================
--- uspace/drv/nic/e1k/e1k.c	(revision c188c62aa2ffa4dc0f6451547f7cdb1966d6eb8d)
+++ uspace/drv/nic/e1k/e1k.c	(revision 81b9d3ed6af6996e5039aa44755f6f7a9b396e2f)
@@ -365,13 +365,16 @@
 	if (ctrl & CTRL_SLU) {
 		ctrl &= ~(CTRL_SLU);
+		E1000_REG_WRITE(e1000, E1000_CTRL, ctrl);
 		fibril_mutex_unlock(&e1000->ctrl_lock);
+		
 		thread_usleep(10);
+		
 		fibril_mutex_lock(&e1000->ctrl_lock);
+		ctrl = E1000_REG_READ(e1000, E1000_CTRL);
 		ctrl |= CTRL_SLU;
+		E1000_REG_WRITE(e1000, E1000_CTRL, ctrl);
 	}
 	
 	fibril_mutex_unlock(&e1000->ctrl_lock);
-	
-	e1000_link_restart(e1000);
 }
 
Index: uspace/drv/nic/rtl8139/driver.c
===================================================================
--- uspace/drv/nic/rtl8139/driver.c	(revision c188c62aa2ffa4dc0f6451547f7cdb1966d6eb8d)
+++ uspace/drv/nic/rtl8139/driver.c	(revision 81b9d3ed6af6996e5039aa44755f6f7a9b396e2f)
@@ -125,17 +125,9 @@
 
 
-/** Disable interrupts on controller
+/** Set interrupts on controller
  *
  *  @param rtl8139  The card private structure
  */
-inline static void rtl8139_hw_int_disable(rtl8139_t *rtl8139)
-{
-	pio_write_16(rtl8139->io_port + IMR, 0x0);
-}
-/** Enable interrupts on controller
- *
- *  @param rtl8139  The card private structure
- */
-inline static void rtl8139_hw_int_enable(rtl8139_t *rtl8139)
+inline static void rtl8139_hw_int_set(rtl8139_t *rtl8139)
 {
 	pio_write_16(rtl8139->io_port + IMR, rtl8139->int_mask);
@@ -274,18 +266,4 @@
 }
 
-/**  Provide OR in the 32bit register (set selected bits to 1)
- *
- *   @param rtl8139     The rtl8139 structure
- *   @param reg_offset  Register offset in the device IO space
- *   @param bits_add    The value to or
- */
-inline static void rtl8139_hw_reg_add_32(rtl8139_t * rtl8139, size_t reg_offset,
-    uint32_t bits_add)
-{
-	uint32_t value = pio_read_32(rtl8139->io_port + reg_offset);
-	value |= bits_add;
-	pio_write_32(rtl8139->io_port + reg_offset, value);
-}
-
 /**  Unset selected bits in 8bit register
  *
@@ -301,19 +279,4 @@
 	pio_write_8(rtl8139->io_port + reg_offset, value);
 }
-
-/**  Unset selected bits in 32bit register
- *
- *   @param rtl8139     The rtl8139 structure
- *   @param reg_offset  Register offset in the device IO space
- *   @param bits_add    The mask of bits to remove
- */
-inline static void rtl8139_hw_reg_rem_32(rtl8139_t * rtl8139, size_t reg_offset,
-    uint32_t bits_add)
-{
-	uint32_t value = pio_read_32(rtl8139->io_port + reg_offset);
-	value &= ~bits_add;
-	pio_write_32(rtl8139->io_port + reg_offset, value);
-}
-
 
 static int rtl8139_set_addr(ddf_fun_t *fun, const nic_address_t *);
@@ -871,5 +834,5 @@
 
 	/* Turn the interrupts on again */
-	rtl8139_hw_int_enable(rtl8139);
+	rtl8139_hw_int_set(rtl8139);
 };
 
@@ -955,5 +918,5 @@
 
 	rtl8139->int_mask = RTL_DEFAULT_INTERRUPTS;
-	rtl8139_hw_int_enable(rtl8139);
+	rtl8139_hw_int_set(rtl8139);
 
 	int rc = irc_enable_interrupt(rtl8139->irq);
@@ -2120,5 +2083,5 @@
 		/* Disable timer interrupts while working with timer-related data */
 		rtl8139->int_mask = 0;
-		rtl8139_hw_int_enable(rtl8139);
+		rtl8139_hw_int_set(rtl8139);
 
 		rtl8139->poll_timer = new_timer;
@@ -2143,5 +2106,5 @@
 	}
 
-	rtl8139_hw_int_enable(rtl8139);
+	rtl8139_hw_int_set(rtl8139);
 
 	fibril_mutex_unlock(&rtl8139->rx_lock);
