Index: uspace/lib/c/generic/io/input.c
===================================================================
--- uspace/lib/c/generic/io/input.c	(revision f6ab787eddabe2ded4f3ba4e6efa7457e948e5f2)
+++ uspace/lib/c/generic/io/input.c	(revision ce3efa072661e7cca5ddc305768f65fce320e41c)
@@ -83,8 +83,7 @@
 {
 	async_exch_t *exch = async_exchange_begin(input->sess);
-
 	int rc = async_req_0_0(exch, INPUT_YIELD);
 	async_exchange_end(exch);
-
+	
 	return rc;
 }
Index: uspace/srv/hid/compositor/compositor.c
===================================================================
--- uspace/srv/hid/compositor/compositor.c	(revision f6ab787eddabe2ded4f3ba4e6efa7457e948e5f2)
+++ uspace/srv/hid/compositor/compositor.c	(revision ce3efa072661e7cca5ddc305768f65fce320e41c)
@@ -230,5 +230,5 @@
 static void window_destroy(window_t *win)
 {
-	if (win && atomic_get(&win->ref_cnt) == 0) {
+	if ((win) && (atomic_get(&win->ref_cnt) == 0)) {
 		while (!list_empty(&win->queue.list)) {
 			window_event_t *event = (window_event_t *) list_first(&win->queue.list);
@@ -236,8 +236,8 @@
 			free(event);
 		}
-
-		if (win->surface) {
+		
+		if (win->surface)
 			surface_destroy(win->surface);
-		}
+		
 		free(win);
 	}
@@ -251,21 +251,21 @@
 	transform_invert(&win_trans);
 	transform_apply_affine(&win_trans, &x, &y);
-
-	/* Since client coordinate origin is (0, 0), it is necessary to check
+	
+	/*
+	 * Since client coordinate origin is (0, 0), it is necessary to check
 	 * coordinates to avoid underflow. Moreover, it is convenient to also
 	 * check against provided upper limits to determine whether the converted
-	 * coordinates are within the client window.  */
-	if (x < 0 || y < 0) {
+	 * coordinates are within the client window.
+	 */
+	if ((x < 0) || (y < 0))
 		return false;
-	} else {
-		(*x_out) = (sysarg_t) (x + 0.5);
-		(*y_out) = (sysarg_t) (y + 0.5);
-
-		if ((*x_out) >= x_lim || (*y_out) >= y_lim) {
-			return false;
-		} else {
-			return true;
-		}
-	}
+	
+	(*x_out) = (sysarg_t) (x + 0.5);
+	(*y_out) = (sysarg_t) (y + 0.5);
+	
+	if (((*x_out) >= x_lim) || ((*y_out) >= y_lim))
+		return false;
+	
+	return true;
 }
 
@@ -277,6 +277,8 @@
 	transform_apply_affine(&win_trans, &x, &y);
 	
-	/* It is assumed that compositor coordinate origin is chosen in such way,
-	 * that underflow/overflow here would be unlikely. */
+	/*
+	 * It is assumed that compositor coordinate origin is chosen in such way,
+	 * that underflow/overflow here would be unlikely.
+	 */
 	(*x_out) = (sysarg_t) (x + 0.5);
 	(*y_out) = (sysarg_t) (y + 0.5);
@@ -436,5 +438,5 @@
 					transform_translate(&transform, -pos.x, -pos.y);
 
-					source_set_transform(&source, transform);				
+					source_set_transform(&source, transform);
 					source_set_texture(&source, win->surface, false);
 					source_set_alpha(&source, PIXEL(win->opacity, 0, 0, 0));
@@ -572,5 +574,5 @@
 		    vp->sess, x_dmg_vp, y_dmg_vp, w_dmg_vp, h_dmg_vp, 0, 0);
 	}
-
+	
 	fibril_mutex_unlock(&viewport_list_mtx);
 }
@@ -588,4 +590,5 @@
 		return;
 	}
+	
 	int rc = async_data_read_finalize(callid, event, len);
 	if (rc != EOK) {
@@ -594,6 +597,6 @@
 		return;
 	}
+	
 	async_answer_0(iid, EOK);
-	
 	free(event);
 }
@@ -606,5 +609,5 @@
 	double height = IPC_GET_ARG4(*icall);
 
-	if (width == 0 || height == 0) {
+	if ((width == 0) || (height == 0)) {
 		comp_damage(0, 0, UINT32_MAX, UINT32_MAX);
 	} else {
@@ -855,5 +858,4 @@
 
 	comp_damage(x, y, width, height);
-
 	async_answer_0(iid, EOK);
 }
@@ -861,5 +863,5 @@
 static void comp_window_close_request(window_t *win, ipc_callid_t iid, ipc_call_t *icall)
 {
-    window_event_t *event = (window_event_t *) malloc(sizeof(window_event_t));
+	window_event_t *event = (window_event_t *) malloc(sizeof(window_event_t));
 	if (event == NULL) {
 		async_answer_0(iid, ENOMEM);
@@ -1001,6 +1003,8 @@
 				break;
 			case WINDOW_CLOSE:
-				/* Postpone the closing until the phone is hung up to cover
-				 * the case when the client is killed abruptly. */
+				/*
+				 * Postpone the closing until the phone is hung up to cover
+				 * the case when the client is killed abruptly.
+				 */
 				async_answer_0(callid, EOK);
 				break;
@@ -1017,5 +1021,4 @@
 static void comp_mode_change(viewport_t *vp, ipc_callid_t iid, ipc_call_t *icall)
 {
-	int rc;
 	sysarg_t mode_idx = IPC_GET_ARG2(*icall);
 	fibril_mutex_lock(&viewport_list_mtx);
@@ -1023,5 +1026,5 @@
 	/* Retrieve the mode that shall be set. */
 	vslmode_t new_mode;
-	rc = visualizer_get_mode(vp->sess, &new_mode, mode_idx);
+	int rc = visualizer_get_mode(vp->sess, &new_mode, mode_idx);
 	if (rc != EOK) {
 		fibril_mutex_unlock(&viewport_list_mtx);
@@ -1041,5 +1044,5 @@
 	/* Try to set the mode and share out the surface. */
 	rc = visualizer_set_mode(vp->sess,
-		new_mode.index, new_mode.version, surface_direct_access(new_surface));
+	    new_mode.index, new_mode.version, surface_direct_access(new_surface));
 	if (rc != EOK) {
 		surface_destroy(new_surface);
@@ -1075,7 +1078,8 @@
 	/* Release viewport resources. */
 	fibril_mutex_lock(&viewport_list_mtx);
+	
 	list_remove(&vp->link);
 	viewport_destroy(vp);
-
+	
 	/* Terminate compositor if there are no more viewports. */
 	if (list_empty(&viewport_list)) {
@@ -1120,7 +1124,6 @@
 	fibril_mutex_unlock(&viewport_list_mtx);
 
-	if (!vp) {
+	if (!vp)
 		return;
-	}
 
 	/* Ignore parameters, the connection is already opened. */
@@ -1223,5 +1226,5 @@
 	/* Try to set the mode and share out the surface. */
 	rc = visualizer_set_mode(vp->sess,
-		vp->mode.index, vp->mode.version, surface_direct_access(vp->surface));
+	    vp->mode.index, vp->mode.version, surface_direct_access(vp->surface));
 	if (rc != EOK) {
 		printf("%s: Unable to set mode (%s)\n", NAME, str_error(rc));
@@ -1233,6 +1236,8 @@
 	if (claimed)
 		visualizer_yield(vp->sess);
+	
 	if (vp->sess != NULL)
 		async_hangup(vp->sess);
+	
 	free(vp);
 	free(vsl_name);
@@ -2196,4 +2201,5 @@
 	/* Register compositor server. */
 	async_set_client_connection(client_connection);
+	
 	int rc = loc_server_register(NAME);
 	if (rc != EOK) {
@@ -2229,5 +2235,5 @@
 		return -1;
 	}
-
+	
 	/* Establish input bidirectional connection. */
 	rc = input_connect(input_svc);
@@ -2236,5 +2242,5 @@
 		return rc;
 	}
-
+	
 	rc = loc_register_cat_change_cb(category_change_cb);
 	if (rc != EOK) {
@@ -2243,5 +2249,5 @@
 		return rc;
 	}	
-
+	
 	rc = discover_viewports();
 	if (rc != EOK) {
@@ -2255,8 +2261,7 @@
 		return -1;
 	}
-
+	
 	comp_restrict_pointers();
 	comp_damage(0, 0, UINT32_MAX, UINT32_MAX);
-	
 	
 	return EOK;
Index: uspace/srv/hid/console/console.c
===================================================================
--- uspace/srv/hid/console/console.c	(revision f6ab787eddabe2ded4f3ba4e6efa7457e948e5f2)
+++ uspace/srv/hid/console/console.c	(revision ce3efa072661e7cca5ddc305768f65fce320e41c)
@@ -377,5 +377,5 @@
 		}
 	}
-
+	
 	return size;
 }
@@ -388,4 +388,5 @@
 	while (off < size)
 		cons_write_char(cons, str_decode(data, &off, size));
+	
 	return size;
 }
@@ -498,4 +499,5 @@
 	event->type = CEV_KEY;
 	event->ev.key = *kevent;
+	
 	free(kevent);
 	return EOK;
@@ -526,5 +528,4 @@
 	con_conn(iid, icall, &cons->srvs);
 }
-
 
 static int input_connect(const char *svc)
@@ -583,8 +584,6 @@
 static bool console_srv_init(char *input_svc, char *output_svc)
 {
-	int rc;
-	
 	/* Connect to input service */
-	rc = input_connect(input_svc);
+	int rc = input_connect(input_svc);
 	if (rc != EOK)
 		return false;
Index: uspace/srv/hid/input/input.c
===================================================================
--- uspace/srv/hid/input/input.c	(revision f6ab787eddabe2ded4f3ba4e6efa7457e948e5f2)
+++ uspace/srv/hid/input/input.c	(revision ce3efa072661e7cca5ddc305768f65fce320e41c)
@@ -103,11 +103,24 @@
 	
 	switch (key) {
-	case KC_LCTRL: mod_mask = KM_LCTRL; break;
-	case KC_RCTRL: mod_mask = KM_RCTRL; break;
-	case KC_LSHIFT: mod_mask = KM_LSHIFT; break;
-	case KC_RSHIFT: mod_mask = KM_RSHIFT; break;
-	case KC_LALT: mod_mask = KM_LALT; break;
-	case KC_RALT: mod_mask = KM_RALT; break;
-	default: mod_mask = 0; break;
+	case KC_LCTRL:
+		mod_mask = KM_LCTRL;
+		break;
+	case KC_RCTRL:
+		mod_mask = KM_RCTRL;
+		break;
+	case KC_LSHIFT:
+		mod_mask = KM_LSHIFT;
+		break;
+	case KC_RSHIFT:
+		mod_mask = KM_RSHIFT;
+		break;
+	case KC_LALT:
+		mod_mask = KM_LALT;
+		break;
+	case KC_RALT:
+		mod_mask = KM_RALT;
+		break;
+	default:
+		mod_mask = 0;
 	}
 	
@@ -120,8 +133,15 @@
 	
 	switch (key) {
-	case KC_CAPS_LOCK: mod_mask = KM_CAPS_LOCK; break;
-	case KC_NUM_LOCK: mod_mask = KM_NUM_LOCK; break;
-	case KC_SCROLL_LOCK: mod_mask = KM_SCROLL_LOCK; break;
-	default: mod_mask = 0; break;
+	case KC_CAPS_LOCK:
+		mod_mask = KM_CAPS_LOCK;
+		break;
+	case KC_NUM_LOCK:
+		mod_mask = KM_NUM_LOCK;
+		break;
+	case KC_SCROLL_LOCK:
+		mod_mask = KM_SCROLL_LOCK;
+		break;
+	default:
+		mod_mask = 0;
 	}
 	
@@ -143,6 +163,8 @@
 	}
 	
-	if (type == KEY_PRESS && (kdev->mods & KM_LCTRL) &&
-	    key == KC_F1) {
+	// TODO: More elegant layout switching
+	
+	if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL) &&
+	    (key == KC_F1)) {
 		layout_destroy(kdev->active_layout);
 		kdev->active_layout = layout_create(layout[0]);
@@ -150,6 +172,6 @@
 	}
 	
-	if (type == KEY_PRESS && (kdev->mods & KM_LCTRL) &&
-	    key == KC_F2) {
+	if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL) &&
+	    (key == KC_F2)) {
 		layout_destroy(kdev->active_layout);
 		kdev->active_layout = layout_create(layout[1]);
@@ -157,6 +179,6 @@
 	}
 	
-	if (type == KEY_PRESS && (kdev->mods & KM_LCTRL) &&
-	    key == KC_F3) {
+	if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL) &&
+	    (key == KC_F3)) {
 		layout_destroy(kdev->active_layout);
 		kdev->active_layout = layout_create(layout[2]);
@@ -164,6 +186,6 @@
 	}
 	
-	if (type == KEY_PRESS && (kdev->mods & KM_LCTRL) &&
-	    key == KC_F4) {
+	if ((type == KEY_PRESS) && (kdev->mods & KM_LCTRL) &&
+	    (key == KC_F4)) {
 		layout_destroy(kdev->active_layout);
 		kdev->active_layout = layout_create(layout[3]);
@@ -620,7 +642,5 @@
 static int input_start_dev_discovery(void)
 {
-	int rc;
-
-	rc = loc_register_cat_change_cb(cat_change_cb);
+	int rc = loc_register_cat_change_cb(cat_change_cb);
 	if (rc != EOK) {
 		printf("%s: Failed registering callback for device discovery. "
@@ -628,5 +648,5 @@
 		return rc;
 	}
-
+	
 	return dev_check_new();
 }
@@ -668,4 +688,5 @@
 	/* Register driver */
 	async_set_client_connection(client_connection);
+	
 	int rc = loc_server_register(NAME);
 	if (rc != EOK) {
Index: uspace/srv/hid/input/port/niagara.c
===================================================================
--- uspace/srv/hid/input/port/niagara.c	(revision f6ab787eddabe2ded4f3ba4e6efa7457e948e5f2)
+++ uspace/srv/hid/input/port/niagara.c	(revision ce3efa072661e7cca5ddc305768f65fce320e41c)
@@ -127,5 +127,5 @@
 /**
  * Called regularly by the polling thread. Reads codes of all the
- * pressed keys from the buffer. 
+ * pressed keys from the buffer.
  */
 static void niagara_key_pressed(void)
Index: uspace/srv/hid/input/port/ski.c
===================================================================
--- uspace/srv/hid/input/port/ski.c	(revision f6ab787eddabe2ded4f3ba4e6efa7457e948e5f2)
+++ uspace/srv/hid/input/port/ski.c	(revision ce3efa072661e7cca5ddc305768f65fce320e41c)
@@ -109,4 +109,5 @@
 			if (c == 0)
 				break;
+			
 			kbd_push_data(kbd_dev, c);
 		}
Index: uspace/srv/hid/output/output.c
===================================================================
--- uspace/srv/hid/output/output.c	(revision f6ab787eddabe2ded4f3ba4e6efa7457e948e5f2)
+++ uspace/srv/hid/output/output.c	(revision ce3efa072661e7cca5ddc305768f65fce320e41c)
@@ -432,5 +432,4 @@
 				srv_set_rgb_color(callid, &call);
 				break;
-			
 			case OUTPUT_UPDATE:
 				srv_update(callid, &call);
Index: uspace/srv/hid/remcons/remcons.c
===================================================================
--- uspace/srv/hid/remcons/remcons.c	(revision f6ab787eddabe2ded4f3ba4e6efa7457e948e5f2)
+++ uspace/srv/hid/remcons/remcons.c	(revision ce3efa072661e7cca5ddc305768f65fce320e41c)
@@ -225,11 +225,10 @@
 {
 	telnet_user_t *user = arg;
-	int rc;
-
+	
 	char term[LOC_NAME_MAXLEN];
 	snprintf(term, LOC_NAME_MAXLEN, "%s/%s", "/loc", user->service_name);
-
+	
 	task_id_t task;
-	rc = task_spawnl(&task, APP_GETTERM, APP_GETTERM, "-w", term, APP_SHELL, NULL);
+	int rc = task_spawnl(&task, APP_GETTERM, APP_GETTERM, "-w", term, APP_SHELL, NULL);
 	if (rc != EOK) {
 		telnet_user_error(user, "Spawning `%s -w %s %s' failed: %s.",
