Index: uspace/app/bdsh/cmds/builtins/batch/batch.c
===================================================================
--- uspace/app/bdsh/cmds/builtins/batch/batch.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/bdsh/cmds/builtins/batch/batch.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -85,5 +85,5 @@
 	}
 
-	int rc = 0;
+	int rc = EOK;
 	FILE *batch = fopen(argv[1], "r");
 	if (batch == NULL) {
@@ -104,5 +104,5 @@
 				if (cur == fusr.line) {
 					/* skip empty line */
-					rc = 0;
+					rc = EOK;
 					free(cur);
 				} else {
Index: uspace/app/bdsh/cmds/builtins/cd/cd.c
===================================================================
--- uspace/app/bdsh/cmds/builtins/cd/cd.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/bdsh/cmds/builtins/cd/cd.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -85,5 +85,6 @@
 int cmd_cd(char **argv, cliuser_t *usr)
 {
-	int argc, rc = 0;
+	int argc;
+	int rc = EOK;
 
 	argc = cli_count_args(argv);
Index: uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mkdir/mkdir.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/bdsh/cmds/modules/mkdir/mkdir.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -94,10 +94,11 @@
 
 	int ret = 0;
+	int rc;
 
 	if (!create_parents) {
-		ret = vfs_link_path(path, KIND_DIRECTORY, NULL);
-		if (ret != EOK) {
+		rc = vfs_link_path(path, KIND_DIRECTORY, NULL);
+		if (rc != EOK) {
 			cli_error(CL_EFAIL, "%s: could not create %s (%s)",
-			    cmdname, path, str_error(ret));
+			    cmdname, path, str_error(rc));
 			ret = 1;
 		}
@@ -135,8 +136,8 @@
 			path[prev_off] = 0;
 
-			ret = vfs_link_path(path, KIND_DIRECTORY, NULL);
-			if (ret != EOK && ret != EEXIST) {
+			rc = vfs_link_path(path, KIND_DIRECTORY, NULL);
+			if (rc != EOK && rc != EEXIST) {
 				cli_error(CL_EFAIL, "%s: could not create %s (%s)",
-				    cmdname, path, str_error(ret));
+				    cmdname, path, str_error(rc));
 				ret = 1;
 				goto leave;
@@ -146,8 +147,8 @@
 		}
 		/* Create the final directory. */
-		ret = vfs_link_path(path, KIND_DIRECTORY, NULL);
-		if (ret != EOK) {
+		rc = vfs_link_path(path, KIND_DIRECTORY, NULL);
+		if (rc != EOK) {
 			cli_error(CL_EFAIL, "%s: could not create %s (%s)",
-			    cmdname, path, str_error(ret));
+			    cmdname, path, str_error(rc));
 			ret = 1;
 		}
Index: uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mkfile/mkfile.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/bdsh/cmds/modules/mkfile/mkfile.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -202,5 +202,5 @@
 	free(buffer);
 
-	if (vfs_put(fd) < 0)
+	if (vfs_put(fd) != EOK)
 		goto error;
 
Index: uspace/app/bdsh/cmds/modules/mount/mount.c
===================================================================
--- uspace/app/bdsh/cmds/modules/mount/mount.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/bdsh/cmds/modules/mount/mount.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -132,5 +132,6 @@
 	const char *mopts = "";
 	const char *dev = "";
-	int rc, c, opt_ind;
+	int rc;
+	int c, opt_ind;
 	unsigned int instance = 0;
 	bool instance_set = false;
Index: uspace/app/bdsh/cmds/modules/rm/rm.c
===================================================================
--- uspace/app/bdsh/cmds/modules/rm/rm.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/bdsh/cmds/modules/rm/rm.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -209,5 +209,5 @@
 	rc = vfs_unlink_path(path);
 	if (rc == EOK)
-		return EOK;
+		return 0;
 
 	cli_error(CL_ENOTSUP, "Can not remove %s", path);
Index: uspace/app/bdsh/exec.c
===================================================================
--- uspace/app/bdsh/exec.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/bdsh/exec.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -98,5 +98,6 @@
 	task_exit_t texit;
 	char *tmp;
-	int rc, retval, i;
+	int rc;
+	int retval, i;
 	int file_handles[3] = { -1, -1, -1 };
 	FILE *files[3];
Index: uspace/app/bdsh/test/toktest.c
===================================================================
--- uspace/app/bdsh/test/toktest.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/bdsh/test/toktest.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -47,9 +47,9 @@
 
 	int rc = tok_init(&tokenizer, input_buffer, tokens, MAX_TOKENS);
-	PCUT_ASSERT_INT_EQUALS(EOK, rc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
 	size_t token_count;
 	rc = tok_tokenize(&tokenizer, &token_count);
-	PCUT_ASSERT_INT_EQUALS(EOK, rc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
 
Index: uspace/app/blkdump/blkdump.c
===================================================================
--- uspace/app/blkdump/blkdump.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/blkdump/blkdump.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -161,12 +161,13 @@
 	printf("Device %s has %" PRIuOFF64 " blocks, %" PRIuOFF64 " bytes each\n", dev_path, dev_nblocks, (aoff64_t) block_size);
 
+	int ret;
 	if (toc)
-		rc = print_toc();
+		ret = print_toc();
 	else
-		rc = print_blocks(block_offset, block_count, block_size);
+		ret = print_blocks(block_offset, block_count, block_size);
 
 	block_fini(service_id);
 
-	return rc;
+	return ret;
 }
 
Index: uspace/app/date/date.c
===================================================================
--- uspace/app/date/date.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/date/date.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -51,5 +51,6 @@
 main(int argc, char **argv)
 {
-	int rc, c;
+	int rc;
+	int c;
 	category_id_t cat_id;
 	size_t        svc_cnt;
Index: uspace/app/download/main.c
===================================================================
--- uspace/app/download/main.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/download/main.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -74,4 +74,5 @@
 	http_t *http = NULL;
 	int rc;
+	int ret;
 
 	if (argc < 2) {
@@ -155,6 +156,6 @@
 		}
 	} else {
-		rc = asprintf(&server_path, "%s?%s", path, uri->query);
-		if (rc < 0) {
+		ret = asprintf(&server_path, "%s?%s", path, uri->query);
+		if (ret < 0) {
 			fprintf(stderr, "Failed allocating path\n");
 			rc = ENOMEM;
Index: uspace/app/edit/edit.c
===================================================================
--- uspace/app/edit/edit.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/edit/edit.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -761,5 +761,5 @@
 	} while (!spt_equal(&bep, epos));
 
-	if (fclose(f) != EOK)
+	if (fclose(f) < 0)
 		return EIO;
 
Index: uspace/app/fdisk/fdisk.c
===================================================================
--- uspace/app/fdisk/fdisk.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/fdisk/fdisk.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -210,6 +210,6 @@
 		}
 
-		rc = asprintf(&dtext, "%s (%s)", svcname, scap);
-		if (rc < 0) {
+		int ret = asprintf(&dtext, "%s (%s)", svcname, scap);
+		if (ret < 0) {
 			rc = ENOMEM;
 			printf("Out of memory.\n");
@@ -615,7 +615,7 @@
 				label = "(No name)";
 
-			rc = asprintf(&sdesc, "%s %s, %s, %s", label,
+			int ret = asprintf(&sdesc, "%s %s, %s, %s", label,
 			    scap, spkind, sfstype);
-			if (rc < 0) {
+			if (ret < 0) {
 				rc = ENOMEM;
 				goto error;
@@ -623,6 +623,6 @@
 
 		} else {
-			rc = asprintf(&sdesc, "%s, %s", scap, spkind);
-			if (rc < 0) {
+			int ret = asprintf(&sdesc, "%s, %s", scap, spkind);
+			if (ret < 0) {
 				rc = ENOMEM;
 				goto error;
Index: uspace/app/gunzip/gunzip.c
===================================================================
--- uspace/app/gunzip/gunzip.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/gunzip/gunzip.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -58,6 +58,5 @@
 	}
 
-	rc = fseek(f, 0, SEEK_END);
-	if (rc != 0) {
+	if (fseek(f, 0, SEEK_END) < 0) {
 		printf("Error determining size of '%s'\n", argv[1]);
 		fclose(f);
@@ -72,6 +71,5 @@
 	}
 
-	rc = fseek(f, 0, SEEK_SET);
-	if (rc != 0) {
+	if (fseek(f, 0, SEEK_SET) < 0) {
 		printf ("Error rewinding '%s'\n", argv[1]);
 		fclose(f);
Index: uspace/app/mkexfat/mkexfat.c
===================================================================
--- uspace/app/mkexfat/mkexfat.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/mkexfat/mkexfat.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -351,5 +351,6 @@
 {
 	uint32_t *ebs = calloc(cfg->sector_size, sizeof(uint8_t));
-	int i, rc;
+	int i;
+	int rc;
 
 	if (!ebs)
@@ -757,5 +758,6 @@
 	char *dev_path;
 	service_id_t service_id;
-	int rc, c, opt_ind;
+	int rc;
+	int c, opt_ind;
 	aoff64_t user_fs_size = 0;
 
Index: uspace/app/mkmfs/mkmfs.c
===================================================================
--- uspace/app/mkmfs/mkmfs.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/mkmfs/mkmfs.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -109,5 +109,6 @@
 int main (int argc, char **argv)
 {
-	int rc, c, opt_ind;
+	int rc;
+	int c, opt_ind;
 	char *device_name;
 	size_t devblock_size;
Index: uspace/app/ping/ping.c
===================================================================
--- uspace/app/ping/ping.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/ping/ping.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -290,6 +290,5 @@
 	}
 	
-	rc = asprintf(&sdest, "%s (%s)", host, adest);
-	if (rc < 0) {
+	if (asprintf(&sdest, "%s (%s)", host, adest) < 0) {
 		printf("Out of memory.\n");
 		goto error;
Index: uspace/app/pkg/pkg.c
===================================================================
--- uspace/app/pkg/pkg.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/pkg/pkg.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -107,4 +107,5 @@
 	char *fnunpack;
 	int rc;
+	int ret;
 
 	if (argc != 3) {
@@ -115,22 +116,22 @@
 	pkg_name = argv[2];
 
-	rc = asprintf(&src_uri, "http://ci.helenos.org/latest/" STRING(UARCH)
+	ret = asprintf(&src_uri, "http://ci.helenos.org/latest/" STRING(UARCH)
 	    "/%s-for-helenos-" STRING(UARCH) ".tar.gz",
 	    pkg_name);
-	if (rc < 0) {
+	if (ret < 0) {
 		printf("Out of memory.\n");
 		return ENOMEM;
 	}
 
-	rc = asprintf(&fname, "/tmp/%s-for-helenos-" STRING(UARCH)
+	ret = asprintf(&fname, "/tmp/%s-for-helenos-" STRING(UARCH)
 	    ".tar.gz", pkg_name);
-	if (rc < 0) {
+	if (ret < 0) {
 		printf("Out of memory.\n");
 		return ENOMEM;
 	}
 
-	rc = asprintf(&fnunpack, "/tmp/%s-for-helenos-" STRING(UARCH) ".tar",
+	ret = asprintf(&fnunpack, "/tmp/%s-for-helenos-" STRING(UARCH) ".tar",
 	    pkg_name);
-	if (rc < 0) {
+	if (ret < 0) {
 		printf("Out of memory.\n");
 		return ENOMEM;
Index: uspace/app/sbi/src/os/helenos.c
===================================================================
--- uspace/app/sbi/src/os/helenos.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/sbi/src/os/helenos.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -252,5 +252,6 @@
 	task_wait_t twait;
 	task_exit_t texit;
-	int rc, retval;
+	int rc;
+	int retval;
 
 	rc = task_spawnv(&tid, &twait, cmd[0], (char const * const *) cmd);
Index: uspace/app/sysinst/sysinst.c
===================================================================
--- uspace/app/sysinst/sysinst.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/sysinst/sysinst.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -142,6 +142,5 @@
 
 	/* XXX libfdisk should give us the service name */
-	rc = asprintf(pdev, "%sp1", dev);
-	if (rc < 0)
+	if (asprintf(pdev, "%sp1", dev) < 0)
 		return ENOMEM;
 
Index: uspace/app/taskdump/elf_core.c
===================================================================
--- uspace/app/taskdump/elf_core.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/taskdump/elf_core.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -307,5 +307,5 @@
 		to_copy = min(area->size - total, BUFFER_SIZE);
 		rc = udebug_mem_read(sess, buffer, addr, to_copy);
-		if (rc < 0) {
+		if (rc != EOK) {
 			printf("Failed reading task memory.\n");
 			return EIO;
Index: uspace/app/taskdump/taskdump.c
===================================================================
--- uspace/app/taskdump/taskdump.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/taskdump/taskdump.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -92,5 +92,5 @@
 
 	rc = connect_task(task_id);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("Failed connecting to task %" PRIu64 ".\n", task_id);
 		return 1;
@@ -105,13 +105,13 @@
 
 	rc = threads_dump();
-	if (rc < 0)
+	if (rc != EOK)
 		printf("Failed dumping threads.\n");
 
 	rc = areas_dump();
-	if (rc < 0)
+	if (rc != EOK)
 		printf("Failed dumping address space areas.\n");
 
 	rc = fibrils_dump(app_symtab, sess);
-	if (rc < 0)
+	if (rc != EOK)
 		printf("Failed dumping fibrils.\n");
 
@@ -141,5 +141,5 @@
 	
 	int rc = udebug_begin(ksess);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("udebug_begin() -> %s\n", str_error_name(rc));
 		return rc;
@@ -223,5 +223,5 @@
 	/* TODO: See why NULL does not work. */
 	rc = udebug_thread_read(sess, &dummy_buf, 0, &copied, &needed);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("udebug_thread_read() -> %s\n", str_error_name(rc));
 		return rc;
@@ -237,5 +237,5 @@
 
 	rc = udebug_thread_read(sess, thash_buf, buf_size, &copied, &needed);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("udebug_thread_read() -> %s\n", str_error_name(rc));
 		return rc;
@@ -272,5 +272,5 @@
 
 	rc = udebug_areas_read(sess, &dummy_buf, 0, &copied, &needed);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("udebug_areas_read() -> %s\n", str_error_name(rc));
 		return rc;
@@ -281,5 +281,5 @@
 
 	rc = udebug_areas_read(sess, ainfo_buf, buf_size, &copied, &needed);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("udebug_areas_read() -> %s\n", str_error_name(rc));
 		return rc;
@@ -357,5 +357,5 @@
 
 	rc = udebug_regs_read(sess, thash, &istate);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("Failed reading registers: %s.\n", str_error_name(rc));
 		return EIO;
@@ -386,5 +386,5 @@
 
 	rc = udebug_mem_read(sess, &data, addr, sizeof(data));
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("Warning: udebug_mem_read() failed.\n");
 		return rc;
@@ -400,10 +400,11 @@
 	char *file_name;
 	int rc;
+	int ret;
 
 	assert(app_name != NULL);
 	assert(app_symtab == NULL);
 
-	rc = asprintf(&file_name, "/app/%s", app_name);
-	if (rc < 0) {
+	ret = asprintf(&file_name, "/app/%s", app_name);
+	if (ret < 0) {
 		printf("Memory allocation failure.\n");
 		exit(1);
@@ -419,6 +420,6 @@
 	free(file_name);
 
-	rc = asprintf(&file_name, "/srv/%s", app_name);
-	if (rc < 0) {
+	ret = asprintf(&file_name, "/srv/%s", app_name);
+	if (ret < 0) {
 		printf("Memory allocation failure.\n");
 		exit(1);
@@ -432,6 +433,6 @@
 	}
 
-	rc = asprintf(&file_name, "/drv/%s/%s", app_name, app_name);
-	if (rc < 0) {
+	ret = asprintf(&file_name, "/drv/%s/%s", app_name, app_name);
+	if (ret < 0) {
 		printf("Memory allocation failure.\n");
 		exit(1);
@@ -457,5 +458,5 @@
 
 	rc = udebug_name_read(sess, &dummy_buf, 0, &copied, &needed);
-	if (rc < 0)
+	if (rc != EOK)
 		return NULL;
 
@@ -463,5 +464,5 @@
 	name = malloc(name_size + 1);
 	rc = udebug_name_read(sess, name, name_size, &copied, &needed);
-	if (rc < 0) {
+	if (rc != EOK) {
 		free(name);
 		return NULL;
@@ -488,4 +489,5 @@
 	size_t offs;
 	int rc;
+	int ret;
 	char *str;
 
@@ -497,10 +499,10 @@
 
 	if (rc == EOK) {
-		rc = asprintf(&str, "%p (%s+%zu)", (void *) addr, name, offs);
+		ret = asprintf(&str, "%p (%s+%zu)", (void *) addr, name, offs);
 	} else {
-		rc = asprintf(&str, "%p", (void *) addr);
-	}
-
-	if (rc < 0) {
+		ret = asprintf(&str, "%p", (void *) addr);
+	}
+
+	if (ret < 0) {
 		printf("Memory allocation error.\n");
 		exit(1);
Index: uspace/app/tester/float/float1.c
===================================================================
--- uspace/app/tester/float/float1.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/tester/float/float1.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -28,4 +28,5 @@
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -75,5 +76,5 @@
 	TPRINTF("Creating threads");
 	for (unsigned int i = 0; i < THREADS; i++) {
-		if (thread_create(e, NULL, "e", NULL) < 0) {
+		if (thread_create(e, NULL, "e", NULL) != EOK) {
 			TPRINTF("\nCould not create thread %u\n", i);
 			break;
Index: uspace/app/tester/thread/thread1.c
===================================================================
--- uspace/app/tester/thread/thread1.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/tester/thread/thread1.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -32,4 +32,5 @@
 
 #include <atomic.h>
+#include <errno.h>
 #include <thread.h>
 #include <stdio.h>
@@ -61,5 +62,5 @@
 	TPRINTF("Creating threads");
 	for (i = 0; i < THREADS; i++) {
-		if (thread_create(threadtest, NULL, "threadtest", NULL) < 0) {
+		if (thread_create(threadtest, NULL, "threadtest", NULL) != EOK) {
 			TPRINTF("\nCould not create thread %u\n", i);
 			break;
Index: uspace/app/trace/trace.c
===================================================================
--- uspace/app/trace/trace.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/trace/trace.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -162,5 +162,5 @@
 	
 	int rc = udebug_begin(ksess);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("udebug_begin() -> %s\n", str_error_name(rc));
 		return rc;
@@ -168,5 +168,5 @@
 	
 	rc = udebug_set_evmask(ksess, UDEBUG_EM_ALL);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("udebug_set_evmask(0x%x) -> %s\n ", UDEBUG_EM_ALL, str_error_name(rc));
 		return rc;
@@ -186,5 +186,5 @@
 	rc = udebug_thread_read(sess, thread_hash_buf,
 		THBUF_SIZE*sizeof(unsigned), &tb_copied, &tb_needed);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("udebug_thread_read() -> %s\n", str_error_name(rc));
 		return rc;
@@ -325,5 +325,5 @@
 	rc = udebug_mem_read(sess, &call, sc_args[0], sizeof(call));
 	
-	if (rc >= 0)
+	if (rc == EOK)
 		ipcp_call_in(&call, sc_rc);
 }
@@ -338,5 +338,5 @@
 	rc = udebug_args_read(sess, thread_hash, sc_args);
 
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("error\n");
 		return;
@@ -368,5 +368,5 @@
 //	printf("[%d] ", thread_id);
 
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("error\n");
 		return;
@@ -445,5 +445,5 @@
 		}
 
-		if (rc >= 0) {
+		if (rc == EOK) {
 			switch (ev_type) {
 			case UDEBUG_EVENT_SYSCALL_B:
@@ -603,5 +603,5 @@
 
 	rc = get_thread_list();
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("Failed to get thread list (%s)\n", str_error(rc));
 		return;
@@ -859,5 +859,5 @@
 
 	rc = connect_task(task_id);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("Failed connecting to task %" PRIu64 ".\n", task_id);
 		return 1;
Index: uspace/app/wavplay/dplay.c
===================================================================
--- uspace/app/wavplay/dplay.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/wavplay/dplay.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -329,5 +329,5 @@
  * @param device The device.
  * @param file The file.
- * @return Error code.
+ * @return 0 on success, non-zero on failure.
  */
 int dplay(const char *device, const char *file)
Index: uspace/app/wavplay/drec.c
===================================================================
--- uspace/app/wavplay/drec.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/wavplay/drec.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -170,5 +170,5 @@
  * @param device The device.
  * @param file The file.
- * @return Error code.
+ * @return 0 on succes, non-zero on failure.
  */
 int drecord(const char *device, const char *file)
Index: uspace/app/websrv/websrv.c
===================================================================
--- uspace/app/websrv/websrv.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/app/websrv/websrv.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -259,6 +259,5 @@
 		uri = "/index.html";
 	
-	rc = asprintf(&fname, "%s%s", WEB_ROOT, uri);
-	if (rc < 0) {
+	if (asprintf(&fname, "%s%s", WEB_ROOT, uri) < 0) {
 		rc = ENOMEM;
 		goto out;
Index: uspace/drv/audio/hdaudio/pcm_iface.c
===================================================================
--- uspace/drv/audio/hdaudio/pcm_iface.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/drv/audio/hdaudio/pcm_iface.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -120,5 +120,5 @@
 		return 16384;
 	default:
-		return ENOTSUP;
+		return -1;
 	}
 }
Index: uspace/drv/audio/sb16/dsp.c
===================================================================
--- uspace/drv/audio/sb16/dsp.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/drv/audio/sb16/dsp.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -290,5 +290,5 @@
 		return 16535;
 	default:
-		return ENOTSUP;
+		return -1;
 	}
 }
Index: uspace/drv/block/ata_bd/ata_bd.c
===================================================================
--- uspace/drv/block/ata_bd/ata_bd.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/drv/block/ata_bd/ata_bd.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -145,5 +145,6 @@
 int ata_ctrl_init(ata_ctrl_t *ctrl, ata_base_t *res)
 {
-	int i, rc;
+	int i;
+	int rc;
 	int n_disks;
 
@@ -210,5 +211,6 @@
 int ata_ctrl_remove(ata_ctrl_t *ctrl)
 {
-	int i, rc;
+	int i;
+	int rc;
 
 	ddf_msg(LVL_DEBUG, ": ata_ctrl_remove()");
@@ -234,5 +236,6 @@
 int ata_ctrl_gone(ata_ctrl_t *ctrl)
 {
-	int i, rc;
+	int i;
+	int rc;
 
 	ddf_msg(LVL_DEBUG, "ata_ctrl_gone()");
Index: uspace/drv/block/usbmast/bo_trans.c
===================================================================
--- uspace/drv/block/usbmast/bo_trans.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/drv/block/usbmast/bo_trans.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -228,5 +228,5 @@
  *
  * @param mfun		Mass storage function
- * @return		Error code of maximum LUN (index, not count)
+ * @return		Maximum LUN (index, not count), or -1
  */
 int usb_massstor_get_max_lun(usbmast_dev_t *mdev)
@@ -240,10 +240,10 @@
 	    &data_recv_len);
 	if (rc != EOK) {
-		return rc;
+		return -1;
 	}
 	if (data_recv_len != 1) {
-		return EEMPTY;
-	}
-	return (int) max_lun;
+		return -1;
+	}
+	return max_lun;
 }
 
Index: uspace/drv/bus/pci/pciintel/pci.c
===================================================================
--- uspace/drv/bus/pci/pciintel/pci.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/drv/bus/pci/pciintel/pci.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -99,5 +99,5 @@
 }
 
-static int pciintel_fun_owns_interrupt(pci_fun_t *fun, int irq)
+static bool pciintel_fun_owns_interrupt(pci_fun_t *fun, int irq)
 {
 	size_t i;
@@ -383,12 +383,12 @@
 {
 	int rc;
+	int ret;
 	char match_id_str[ID_MAX_STR_LEN];
 
 	/* Vendor ID & Device ID, length(incl \0) 22 */
-	rc = snprintf(match_id_str, ID_MAX_STR_LEN, "pci/ven=%04"
+	ret = snprintf(match_id_str, ID_MAX_STR_LEN, "pci/ven=%04"
 	    PRIx16 "&dev=%04" PRIx16, fun->vendor_id, fun->device_id);
-	if (rc < 0) {
-		ddf_msg(LVL_ERROR, "Failed creating match ID str: %s",
-		    str_error(rc));
+	if (ret < 0) {
+		ddf_msg(LVL_ERROR, "Failed creating match ID str");
 	}
 
@@ -399,10 +399,9 @@
 
 	/* Class, subclass, prog IF, revision, length(incl \0) 47 */
-	rc = snprintf(match_id_str, ID_MAX_STR_LEN,
+	ret = snprintf(match_id_str, ID_MAX_STR_LEN,
 	    "pci/class=%02x&subclass=%02x&progif=%02x&revision=%02x",
 	    fun->class_code, fun->subclass_code, fun->prog_if, fun->revision);
-	if (rc < 0) {
-		ddf_msg(LVL_ERROR, "Failed creating match ID str: %s",
-		    str_error(rc));
+	if (ret < 0) {
+		ddf_msg(LVL_ERROR, "Failed creating match ID str");
 	}
 
@@ -413,10 +412,9 @@
 
 	/* Class, subclass, prog IF, length(incl \0) 35 */
-	rc = snprintf(match_id_str, ID_MAX_STR_LEN,
+	ret = snprintf(match_id_str, ID_MAX_STR_LEN,
 	    "pci/class=%02x&subclass=%02x&progif=%02x",
 	    fun->class_code, fun->subclass_code, fun->prog_if);
-	if (rc < 0) {
-		ddf_msg(LVL_ERROR, "Failed creating match ID str: %s",
-		    str_error(rc));
+	if (ret < 0) {
+		ddf_msg(LVL_ERROR, "Failed creating match ID str");
 	}
 
@@ -427,10 +425,9 @@
 
 	/* Class, subclass, length(incl \0) 25 */
-	rc = snprintf(match_id_str, ID_MAX_STR_LEN,
+	ret = snprintf(match_id_str, ID_MAX_STR_LEN,
 	    "pci/class=%02x&subclass=%02x",
 	    fun->class_code, fun->subclass_code);
-	if (rc < 0) {
-		ddf_msg(LVL_ERROR, "Failed creating match ID str: %s",
-		    str_error(rc));
+	if (ret < 0) {
+		ddf_msg(LVL_ERROR, "Failed creating match ID str");
 	}
 
@@ -441,9 +438,8 @@
 
 	/* Class, length(incl \0) 13 */
-	rc = snprintf(match_id_str, ID_MAX_STR_LEN, "pci/class=%02x",
+	ret = snprintf(match_id_str, ID_MAX_STR_LEN, "pci/class=%02x",
 	    fun->class_code);
-	if (rc < 0) {
-		ddf_msg(LVL_ERROR, "Failed creating match ID str: %s",
-		    str_error(rc));
+	if (ret < 0) {
+		ddf_msg(LVL_ERROR, "Failed creating match ID str");
 	}
 
Index: uspace/drv/bus/usb/ohci/hw_struct/completion_codes.h
===================================================================
--- uspace/drv/bus/usb/ohci/hw_struct/completion_codes.h	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/drv/bus/usb/ohci/hw_struct/completion_codes.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -54,5 +54,5 @@
 };
 
-inline static unsigned int cc_to_rc(unsigned int cc)
+inline static int cc_to_rc(unsigned int cc)
 {
 	switch (cc) {
Index: uspace/drv/bus/usb/usbmid/usbmid.c
===================================================================
--- uspace/drv/bus/usb/usbmid/usbmid.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/drv/bus/usb/usbmid/usbmid.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -117,8 +117,8 @@
 	 * class name something humanly understandable.
 	 */
-	rc = asprintf(&child_name, "%s%hhu",
+	int ret = asprintf(&child_name, "%s%hhu",
 	    usb_str_class(interface_descriptor->interface_class),
 	    interface_descriptor->interface_number);
-	if (rc < 0) {
+	if (ret < 0) {
 		return ENOMEM;
 	}
Index: uspace/drv/test/test3/test3.c
===================================================================
--- uspace/drv/test/test3/test3.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/drv/test/test3/test3.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -71,7 +71,7 @@
 	char *fun_name = NULL;
 	
-	rc = asprintf(&fun_name, "%s%zu", base_name, index);
-	if (rc < 0) {
-		ddf_msg(LVL_ERROR, "Failed to format string: %s", str_error(rc));
+	if (asprintf(&fun_name, "%s%zu", base_name, index) < 0) {
+		ddf_msg(LVL_ERROR, "Failed to format string: No memory");
+		rc = ENOMEM;
 		goto leave;
 	}
@@ -161,7 +161,6 @@
 
 	for (i = 0; i < NUM_FUNCS; i++) {
-		rc = asprintf(&fun_name, "test3_%zu", i);
-		if (rc < 0) {
-			ddf_msg(LVL_ERROR, "Failed to format string: %s", str_error(rc));
+		if (asprintf(&fun_name, "test3_%zu", i) < 0) {
+			ddf_msg(LVL_ERROR, "Failed to format string: No memory");
 			return ENOMEM;
 		}
Index: uspace/lib/c/generic/as.c
===================================================================
--- uspace/lib/c/generic/as.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/as.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -76,5 +76,5 @@
 int as_area_resize(void *address, size_t size, unsigned int flags)
 {
-	return __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t) address,
+	return (int) __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t) address,
 	    (sysarg_t) size, (sysarg_t) flags);
 }
@@ -90,5 +90,5 @@
 int as_area_destroy(void *address)
 {
-	return __SYSCALL1(SYS_AS_AREA_DESTROY, (sysarg_t) address);
+	return (int) __SYSCALL1(SYS_AS_AREA_DESTROY, (sysarg_t) address);
 }
 
@@ -104,5 +104,5 @@
 int as_area_change_flags(void *address, unsigned int flags)
 {
-	return __SYSCALL2(SYS_AS_AREA_CHANGE_FLAGS, (sysarg_t) address,
+	return (int) __SYSCALL2(SYS_AS_AREA_CHANGE_FLAGS, (sysarg_t) address,
 	    (sysarg_t) flags);
 }
Index: uspace/lib/c/generic/async.c
===================================================================
--- uspace/lib/c/generic/async.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/async.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -763,5 +763,5 @@
 	
 	free(fibril_connection);
-	return 0;
+	return EOK;
 }
 
Index: uspace/lib/c/generic/cap.c
===================================================================
--- uspace/lib/c/generic/cap.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/cap.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -178,4 +178,5 @@
 {
 	int rc;
+	int ret;
 	const char *sunit;
 	uint64_t ipart;
@@ -196,10 +197,10 @@
 	sunit = cu_str[cap->cunit];
 	if (cap->dp > 0) {
-		rc = asprintf(rstr, "%" PRIu64 ".%0*" PRIu64 " %s", ipart,
+		ret = asprintf(rstr, "%" PRIu64 ".%0*" PRIu64 " %s", ipart,
 		    (int)cap->dp, fpart, sunit);
 	} else {
-		rc = asprintf(rstr, "%" PRIu64 " %s", ipart, sunit);
-	}
-	if (rc < 0)
+		ret = asprintf(rstr, "%" PRIu64 " %s", ipart, sunit);
+	}
+	if (ret < 0)
 		return ENOMEM;
 
Index: uspace/lib/c/generic/ddi.c
===================================================================
--- uspace/lib/c/generic/ddi.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/ddi.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -71,5 +71,5 @@
 int physmem_map(uintptr_t phys, size_t pages, unsigned int flags, void **virt)
 {
-	return __SYSCALL5(SYS_PHYSMEM_MAP, (sysarg_t) phys,
+	return (int) __SYSCALL5(SYS_PHYSMEM_MAP, (sysarg_t) phys,
 	    pages, flags, (sysarg_t) virt, (sysarg_t) __entry);
 }
@@ -87,5 +87,5 @@
 int physmem_unmap(void *virt)
 {
-	return __SYSCALL1(SYS_PHYSMEM_UNMAP, (sysarg_t) virt);
+	return (int) __SYSCALL1(SYS_PHYSMEM_UNMAP, (sysarg_t) virt);
 }
 
@@ -150,10 +150,10 @@
 int dmamem_unmap(void *virt, size_t size)
 {
-	return __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, (sysarg_t) size, 0);
+	return (int) __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, (sysarg_t) size, 0);
 }
 
 int dmamem_unmap_anonymous(void *virt)
 {
-	return __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, 0,
+	return (int) __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, 0,
 	    DMAMEM_FLAGS_ANONYMOUS);
 }
@@ -181,5 +181,5 @@
 	};
 	
-	return __SYSCALL1(SYS_IOSPACE_ENABLE, (sysarg_t) &arg);
+	return (int) __SYSCALL1(SYS_IOSPACE_ENABLE, (sysarg_t) &arg);
 }
 
@@ -205,5 +205,5 @@
 	};
 	
-	return __SYSCALL1(SYS_IOSPACE_DISABLE, (sysarg_t) &arg);
+	return (int) __SYSCALL1(SYS_IOSPACE_DISABLE, (sysarg_t) &arg);
 }
 
Index: uspace/lib/c/generic/event.c
===================================================================
--- uspace/lib/c/generic/event.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/event.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -45,10 +45,10 @@
  * @param imethod Use this interface and method for notifying me.
  *
- * @return Value returned by the kernel.
+ * @return Error code returned by the kernel.
  *
  */
 int ipc_event_subscribe(event_type_t evno, sysarg_t imethod)
 {
-	return __SYSCALL2(SYS_IPC_EVENT_SUBSCRIBE, (sysarg_t) evno,
+	return (int) __SYSCALL2(SYS_IPC_EVENT_SUBSCRIBE, (sysarg_t) evno,
 	    (sysarg_t) imethod);
 }
@@ -59,10 +59,10 @@
  * @param imethod Use this interface and method for notifying me.
  *
- * @return Value returned by the kernel.
+ * @return Error code returned by the kernel.
  *
  */
 int ipc_event_task_subscribe(event_task_type_t evno, sysarg_t imethod)
 {
-	return __SYSCALL2(SYS_IPC_EVENT_SUBSCRIBE, (sysarg_t) evno,
+	return (int) __SYSCALL2(SYS_IPC_EVENT_SUBSCRIBE, (sysarg_t) evno,
 	    (sysarg_t) imethod);
 }
@@ -72,10 +72,10 @@
  * @param evno    Event type to unsubscribe.
  *
- * @return Value returned by the kernel.
+ * @return Error code returned by the kernel.
  *
  */
 int ipc_event_unsubscribe(event_type_t evno)
 {
-	return __SYSCALL1(SYS_IPC_EVENT_UNSUBSCRIBE, (sysarg_t) evno);
+	return (int) __SYSCALL1(SYS_IPC_EVENT_UNSUBSCRIBE, (sysarg_t) evno);
 }
 
@@ -84,10 +84,10 @@
  * @param evno    Event type to unsubscribe.
  *
- * @return Value returned by the kernel.
+ * @return Error code returned by the kernel.
  *
  */
 int ipc_event_task_unsubscribe(event_task_type_t evno)
 {
-	return __SYSCALL1(SYS_IPC_EVENT_UNSUBSCRIBE, (sysarg_t) evno);
+	return (int) __SYSCALL1(SYS_IPC_EVENT_UNSUBSCRIBE, (sysarg_t) evno);
 }
 
@@ -96,10 +96,10 @@
  * @param evno Event type to unmask.
  *
- * @return Value returned by the kernel.
+ * @return Error code returned by the kernel.
  *
  */
 int ipc_event_unmask(event_type_t evno)
 {
-	return __SYSCALL1(SYS_IPC_EVENT_UNMASK, (sysarg_t) evno);
+	return (int) __SYSCALL1(SYS_IPC_EVENT_UNMASK, (sysarg_t) evno);
 }
 
@@ -108,10 +108,10 @@
  * @param evno Event type to unmask.
  *
- * @return Value returned by the kernel.
+ * @return Error code returned by the kernel.
  *
  */
 int ipc_event_task_unmask(event_task_type_t evno)
 {
-	return __SYSCALL1(SYS_IPC_EVENT_UNMASK, (sysarg_t) evno);
+	return (int) __SYSCALL1(SYS_IPC_EVENT_UNMASK, (sysarg_t) evno);
 }
 
Index: uspace/lib/c/generic/inet/addr.c
===================================================================
--- uspace/lib/c/generic/inet/addr.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/inet/addr.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -584,4 +584,5 @@
 {
 	int rc;
+	int ret;
 
 	rc = ENOTSUP;
@@ -589,6 +590,6 @@
 	switch (addr->version) {
 	case ip_any:
-		rc = asprintf(bufp, "none");
-		if (rc < 0)
+		ret = asprintf(bufp, "none");
+		if (ret < 0)
 			return ENOMEM;
 		rc = EOK;
@@ -618,4 +619,5 @@
 {
 	int rc;
+	int ret;
 	char *astr;
 
@@ -624,6 +626,6 @@
 	switch (naddr->version) {
 	case ip_any:
-		rc = asprintf(bufp, "none");
-		if (rc < 0)
+		ret = asprintf(bufp, "none");
+		if (ret < 0)
 			return ENOMEM;
 		rc = EOK;
@@ -634,6 +636,6 @@
 			return ENOMEM;
 
-		rc = asprintf(bufp, "%s/%" PRIu8, astr, naddr->prefix);
-		if (rc < 0) {
+		ret = asprintf(bufp, "%s/%" PRIu8, astr, naddr->prefix);
+		if (ret < 0) {
 			free(astr);
 			return ENOMEM;
@@ -647,6 +649,6 @@
 			return ENOMEM;
 
-		rc = asprintf(bufp, "%s/%" PRIu8, astr, naddr->prefix);
-		if (rc < 0) {
+		ret = asprintf(bufp, "%s/%" PRIu8, astr, naddr->prefix);
+		if (ret < 0) {
 			free(astr);
 			return ENOMEM;
Index: uspace/lib/c/generic/inet/hostport.c
===================================================================
--- uspace/lib/c/generic/inet/hostport.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/inet/hostport.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -140,4 +140,5 @@
 {
 	int rc;
+	int ret;
 	char *astr, *str;
 	char *hstr = NULL;
@@ -154,6 +155,6 @@
 			hstr = astr;
 		} else {
-			rc = asprintf(&hstr, "[%s]", astr);
-			if (rc < 0) {
+			ret = asprintf(&hstr, "[%s]", astr);
+			if (ret < 0) {
 				free(astr);
 				return ENOMEM;
@@ -171,6 +172,6 @@
 	}
 
-	rc = asprintf(&str, "%s:%u", hstr, hp->port);
-	if (rc < 0)
+	ret = asprintf(&str, "%s:%u", hstr, hp->port);
+	if (ret < 0)
 		return ENOMEM;
 
Index: uspace/lib/c/generic/io/chardev.c
===================================================================
--- uspace/lib/c/generic/io/chardev.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/io/chardev.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -124,5 +124,5 @@
 	*nread = IPC_GET_ARG2(answer);
 	/* In case of partial success, ARG1 contains the error code */
-	return IPC_GET_ARG1(answer);
+	return (int) IPC_GET_ARG1(answer);
 
 }
@@ -175,5 +175,5 @@
 	*nwritten = IPC_GET_ARG2(answer);
 	/* In case of partial success, ARG1 contains the error code */
-	return IPC_GET_ARG1(answer);
+	return (int) IPC_GET_ARG1(answer);
 }
 
Index: uspace/lib/c/generic/io/chardev_srv.c
===================================================================
--- uspace/lib/c/generic/io/chardev_srv.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/io/chardev_srv.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -82,5 +82,5 @@
 
 	free(buf);
-	async_answer_2(callid, EOK, rc, nread);
+	async_answer_2(callid, EOK, (sysarg_t) rc, nread);
 }
 
@@ -111,5 +111,5 @@
 	}
 
-	async_answer_2(callid, EOK, rc, nwr);
+	async_answer_2(callid, EOK, (sysarg_t) rc, nwr);
 }
 
Index: uspace/lib/c/generic/io/table.c
===================================================================
--- uspace/lib/c/generic/io/table.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/io/table.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -478,4 +478,5 @@
 	va_list args;
 	int rc;
+	int ret;
 	char *str;
 	char *sp, *ep;
@@ -486,8 +487,8 @@
 
 	va_start(args, fmt);
-	rc = vasprintf(&str, fmt, args);
+	ret = vasprintf(&str, fmt, args);
 	va_end(args);
 
-	if (rc < 0) {
+	if (ret < 0) {
 		table->error = ENOMEM;
 		return table->error;
Index: uspace/lib/c/generic/ipc.c
===================================================================
--- uspace/lib/c/generic/ipc.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/ipc.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -136,5 +136,5 @@
 		return;
 	
-	int rc = __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phandle, imethod, arg1,
+	int rc = (int) __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phandle, imethod, arg1,
 	    arg2, arg3, (sysarg_t) call);
 	
@@ -175,5 +175,5 @@
 	IPC_SET_ARG5(call->msg.data, arg5);
 	
-	int rc = __SYSCALL3(SYS_IPC_CALL_ASYNC_SLOW, phandle,
+	int rc = (int) __SYSCALL3(SYS_IPC_CALL_ASYNC_SLOW, phandle,
 	    (sysarg_t) &call->msg.data, (sysarg_t) call);
 	
@@ -200,5 +200,5 @@
     sysarg_t arg2, sysarg_t arg3, sysarg_t arg4)
 {
-	return __SYSCALL6(SYS_IPC_ANSWER_FAST, chandle, retval, arg1, arg2,
+	return (int) __SYSCALL6(SYS_IPC_ANSWER_FAST, chandle, (sysarg_t) retval, arg1, arg2,
 	    arg3, arg4);
 }
@@ -230,5 +230,5 @@
 	IPC_SET_ARG5(data, arg5);
 	
-	return __SYSCALL2(SYS_IPC_ANSWER_SLOW, chandle, (sysarg_t) &data);
+	return (int) __SYSCALL2(SYS_IPC_ANSWER_SLOW, chandle, (sysarg_t) &data);
 }
 
@@ -260,5 +260,5 @@
 int ipc_wait_cycle(ipc_call_t *call, sysarg_t usec, unsigned int flags)
 {
-	int rc = __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, usec, flags);
+	int rc = (int) __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, usec, flags);
 	
 	/* Handle received answers */
@@ -330,5 +330,5 @@
 int ipc_hangup(cap_handle_t phandle)
 {
-	return __SYSCALL1(SYS_IPC_HANGUP, phandle);
+	return (int) __SYSCALL1(SYS_IPC_HANGUP, phandle);
 }
 
@@ -353,5 +353,5 @@
     sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, unsigned int mode)
 {
-	return __SYSCALL6(SYS_IPC_FORWARD_FAST, chandle, phandle, imethod, arg1,
+	return (int) __SYSCALL6(SYS_IPC_FORWARD_FAST, chandle, phandle, imethod, arg1,
 	    arg2, mode);
 }
@@ -370,5 +370,5 @@
 	IPC_SET_ARG5(data, arg5);
 	
-	return __SYSCALL4(SYS_IPC_FORWARD_SLOW, chandle, phandle,
+	return (int) __SYSCALL4(SYS_IPC_FORWARD_SLOW, chandle, phandle,
 	    (sysarg_t) &data, mode);
 }
@@ -379,5 +379,5 @@
 int ipc_connect_kbox(task_id_t id, cap_handle_t *phone)
 {
-	return __SYSCALL2(SYS_IPC_CONNECT_KBOX, (sysarg_t) &id, (sysarg_t) phone);
+	return (int) __SYSCALL2(SYS_IPC_CONNECT_KBOX, (sysarg_t) &id, (sysarg_t) phone);
 }
 
Index: uspace/lib/c/generic/irq.c
===================================================================
--- uspace/lib/c/generic/irq.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/irq.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -69,5 +69,5 @@
 		ucode = &default_ucode;
 	
-	return __SYSCALL4(SYS_IPC_IRQ_SUBSCRIBE, inr, method, (sysarg_t) ucode,
+	return (int) __SYSCALL4(SYS_IPC_IRQ_SUBSCRIBE, inr, method, (sysarg_t) ucode,
 	    (sysarg_t) out_handle);
 }
@@ -82,5 +82,5 @@
 int ipc_irq_unsubscribe(cap_handle_t cap)
 {
-	return __SYSCALL1(SYS_IPC_IRQ_UNSUBSCRIBE, cap);
+	return (int) __SYSCALL1(SYS_IPC_IRQ_UNSUBSCRIBE, cap);
 }
 
Index: uspace/lib/c/generic/loader.c
===================================================================
--- uspace/lib/c/generic/loader.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/loader.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -56,5 +56,5 @@
 int loader_spawn(const char *name)
 {
-	return __SYSCALL2(SYS_PROGRAM_SPAWN_LOADER,
+	return (int) __SYSCALL2(SYS_PROGRAM_SPAWN_LOADER,
 	    (sysarg_t) name, str_size(name));
 }
Index: uspace/lib/c/generic/loc.c
===================================================================
--- uspace/lib/c/generic/loc.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/loc.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -574,4 +574,7 @@
 }
 
+/**
+ * @return ID of a new NULL device, or -1 if failed.
+ */
 int loc_null_create(void)
 {
Index: uspace/lib/c/generic/perm.c
===================================================================
--- uspace/lib/c/generic/perm.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/perm.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -52,9 +52,9 @@
 #ifdef __32_BITS__
 	sysarg64_t arg = (sysarg64_t) id;
-	return __SYSCALL2(SYS_PERM_GRANT, (sysarg_t) &arg, (sysarg_t) perms);
+	return (int) __SYSCALL2(SYS_PERM_GRANT, (sysarg_t) &arg, (sysarg_t) perms);
 #endif
 	
 #ifdef __64_BITS__
-	return __SYSCALL2(SYS_PERM_GRANT, (sysarg_t) id, (sysarg_t) perms);
+	return (int) __SYSCALL2(SYS_PERM_GRANT, (sysarg_t) id, (sysarg_t) perms);
 #endif
 }
@@ -72,9 +72,9 @@
 #ifdef __32_BITS__
 	sysarg64_t arg = (sysarg64_t) id;
-	return __SYSCALL2(SYS_PERM_REVOKE, (sysarg_t) &arg, (sysarg_t) perms);
+	return (int) __SYSCALL2(SYS_PERM_REVOKE, (sysarg_t) &arg, (sysarg_t) perms);
 #endif
 	
 #ifdef __64_BITS__
-	return __SYSCALL2(SYS_PERM_REVOKE, (sysarg_t) id, (sysarg_t) perms);
+	return (int) __SYSCALL2(SYS_PERM_REVOKE, (sysarg_t) id, (sysarg_t) perms);
 #endif
 }
Index: uspace/lib/c/generic/smc.c
===================================================================
--- uspace/lib/c/generic/smc.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/smc.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -39,5 +39,5 @@
 int smc_coherence(void *address, size_t size)
 {
-	return __SYSCALL2(SYS_SMC_COHERENCE, (sysarg_t) address,
+	return (int) __SYSCALL2(SYS_SMC_COHERENCE, (sysarg_t) address,
 	    (sysarg_t) size);
 }
Index: uspace/lib/c/generic/sysinfo.c
===================================================================
--- uspace/lib/c/generic/sysinfo.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/sysinfo.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -92,5 +92,5 @@
 	/* Get the data */
 	size_t sz;
-	ret = __SYSCALL5(SYS_SYSINFO_GET_KEYS, (sysarg_t) path,
+	ret = (int) __SYSCALL5(SYS_SYSINFO_GET_KEYS, (sysarg_t) path,
 	    (sysarg_t) str_size(path), (sysarg_t) data, (sysarg_t) *size,
 	    (sysarg_t) &sz);
@@ -186,5 +186,5 @@
 	/* Get the data */
 	size_t sz;
-	ret = __SYSCALL5(SYS_SYSINFO_GET_DATA, (sysarg_t) path,
+	ret = (int) __SYSCALL5(SYS_SYSINFO_GET_DATA, (sysarg_t) path,
 	    (sysarg_t) str_size(path), (sysarg_t) data, (sysarg_t) *size,
 	    (sysarg_t) &sz);
Index: uspace/lib/c/generic/task.c
===================================================================
--- uspace/lib/c/generic/task.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/task.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -75,5 +75,5 @@
 	assert(name);
 	
-	return __SYSCALL2(SYS_TASK_SET_NAME, (sysarg_t) name, str_size(name));
+	return (int) __SYSCALL2(SYS_TASK_SET_NAME, (sysarg_t) name, str_size(name));
 }
 
Index: uspace/lib/c/generic/thread.c
===================================================================
--- uspace/lib/c/generic/thread.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/thread.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -132,5 +132,5 @@
 	uarg->uspace_uarg = uarg;
 	
-	int rc = __SYSCALL4(SYS_THREAD_CREATE, (sysarg_t) uarg,
+	int rc = (int) __SYSCALL4(SYS_THREAD_CREATE, (sysarg_t) uarg,
 	    (sysarg_t) name, (sysarg_t) str_size(name), (sysarg_t) tid);
 	
Index: uspace/lib/c/generic/vfs/mtab.c
===================================================================
--- uspace/lib/c/generic/vfs/mtab.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/generic/vfs/mtab.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -76,9 +76,10 @@
 		struct stat st;
 		int rc;
+		int ret;
 
-		rc = asprintf(&child, "%s/%s", path, dirent->d_name);
-		if (rc < 0) {
+		ret = asprintf(&child, "%s/%s", path, dirent->d_name);
+		if (ret < 0) {
 			closedir(dir);
-			return rc;
+			return ENOMEM;
 		}
 
Index: uspace/lib/c/include/async.h
===================================================================
--- uspace/lib/c/include/async.h	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/include/async.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -170,5 +170,5 @@
 extern int async_irq_subscribe(int, async_notification_handler_t, void *,
     const irq_code_t *, cap_handle_t *);
-extern int async_irq_unsubscribe(int);
+extern int async_irq_unsubscribe(cap_handle_t);
 
 extern int async_event_subscribe(event_type_t, async_notification_handler_t,
Index: uspace/lib/c/include/futex.h
===================================================================
--- uspace/lib/c/include/futex.h	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/include/futex.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -108,9 +108,9 @@
  * @param futex Futex.
  *
- * @return Non-zero if the futex was acquired.
- * @return Zero if the futex was not acquired.
+ * @return true if the futex was acquired.
+ * @return false if the futex was not acquired.
  *
  */
-static inline int futex_trydown(futex_t *futex)
+static inline bool futex_trydown(futex_t *futex)
 {
 	return cas(&futex->val, 1, 0);
@@ -129,5 +129,5 @@
 {
 	if ((atomic_signed_t) atomic_predec(&futex->val) < 0)
-		return __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->val.count);
+		return (int) __SYSCALL1(SYS_FUTEX_SLEEP, (sysarg_t) &futex->val.count);
 	
 	return EOK;
@@ -146,5 +146,5 @@
 {
 	if ((atomic_signed_t) atomic_postinc(&futex->val) < 0)
-		return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->val.count);
+		return (int) __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->val.count);
 	
 	return EOK;
Index: uspace/lib/c/include/io/table.h
===================================================================
--- uspace/lib/c/include/io/table.h	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/c/include/io/table.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -40,4 +40,5 @@
 #include <stddef.h>
 #include <stdio.h>
+#include <errno.h>
 
 /** Table metrics */
Index: uspace/lib/clui/nchoice.c
===================================================================
--- uspace/lib/clui/nchoice.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/clui/nchoice.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -131,4 +131,5 @@
 	int i;
 	int rc;
+	int ret;
 	char *str;
 	unsigned long c;
@@ -151,6 +152,6 @@
 
 	if (def_i > 0) {
-		rc = asprintf(&istr, "%d", def_i);
-		if (rc < 0)
+		ret = asprintf(&istr, "%d", def_i);
+		if (ret < 0)
 			return ENOMEM;
 	} else {
Index: uspace/lib/compress/inflate.c
===================================================================
--- uspace/lib/compress/inflate.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/compress/inflate.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -637,5 +637,5 @@
 	
 	uint16_t last;
-	int ret = 0;
+	int ret = EOK;
 	
 	do {
Index: uspace/lib/draw/font/pcf.c
===================================================================
--- uspace/lib/draw/font/pcf.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/draw/font/pcf.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -268,6 +268,5 @@
 	    (glyph_id * sizeof(uint32_t));
 	
-	rc = fseek(data->file, offset, SEEK_SET);
-	if (rc != 0)
+	if (fseek(data->file, offset, SEEK_SET) < 0)
 		return errno;
 	
@@ -284,6 +283,5 @@
 	    + bitmap_offset;
 	
-	rc = fseek(data->file, offset, SEEK_SET);
-	if (rc != 0)
+	if (fseek(data->file, offset, SEEK_SET) < 0)
 		return errno;
 	
Index: uspace/lib/drv/generic/interrupt.c
===================================================================
--- uspace/lib/drv/generic/interrupt.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/drv/generic/interrupt.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -51,5 +51,5 @@
 }
 
-int unregister_interrupt_handler(ddf_dev_t *dev, int cap)
+int unregister_interrupt_handler(ddf_dev_t *dev, cap_handle_t cap)
 {
 	return async_irq_unsubscribe(cap);
Index: uspace/lib/drv/generic/remote_nic.c
===================================================================
--- uspace/lib/drv/generic/remote_nic.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/drv/generic/remote_nic.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -216,5 +216,5 @@
 		return rc;
 	
-	return (int) res;
+	return res;
 }
 
@@ -243,5 +243,5 @@
 		return rc;
 	
-	return (int) res;
+	return res;
 }
 
@@ -301,5 +301,5 @@
 		return rc;
 	
-	return (int) res;
+	return res;
 }
 
@@ -635,5 +635,5 @@
 		return rc;
 	
-	return (int) res;
+	return res;
 }
 
@@ -723,5 +723,5 @@
 		return rc;
 	
-	return (int) res;
+	return res;
 }
 
@@ -884,5 +884,5 @@
 		return rc;
 	
-	return (int) res;
+	return res;
 }
 
@@ -944,5 +944,5 @@
 		return rc;
 	
-	return (int) res;
+	return res;
 }
 
@@ -1011,5 +1011,5 @@
 	
 	*id = IPC_GET_ARG1(result);
-	return (int) res;
+	return res;
 }
 
@@ -1317,5 +1317,5 @@
 		return rc;
 	
-	return (int) res;
+	return res;
 }
 
Index: uspace/lib/drv/include/ddf/interrupt.h
===================================================================
--- uspace/lib/drv/include/ddf/interrupt.h	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/drv/include/ddf/interrupt.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -52,5 +52,5 @@
 extern int register_interrupt_handler(ddf_dev_t *, int, interrupt_handler_t *,
     const irq_code_t *, cap_handle_t *);
-extern int unregister_interrupt_handler(ddf_dev_t *, int);
+extern int unregister_interrupt_handler(ddf_dev_t *, cap_handle_t);
 
 #endif
Index: uspace/lib/http/src/response.c
===================================================================
--- uspace/lib/http/src/response.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/http/src/response.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -54,5 +54,5 @@
 	recv_mark(rb, &start);
 	int rc = recv_while(rb, is_digit);
-	if (rc < 0) {
+	if (rc != EOK) {
 		recv_unmark(rb, &start);
 		return rc;
@@ -149,5 +149,5 @@
 	
 	rc = recv_while(rb, is_not_newline);
-	if (rc < 0) {
+	if (rc != EOK) {
 		recv_unmark(rb, &msg_start);
 		return rc;
Index: uspace/lib/nic/include/nic_addr_db.h
===================================================================
--- uspace/lib/nic/include/nic_addr_db.h	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/nic/include/nic_addr_db.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -60,5 +60,5 @@
 extern int nic_addr_db_insert(nic_addr_db_t *db, const uint8_t *addr);
 extern int nic_addr_db_remove(nic_addr_db_t *db, const uint8_t *addr);
-extern int nic_addr_db_contains(const nic_addr_db_t *db, const uint8_t *addr);
+extern bool nic_addr_db_contains(const nic_addr_db_t *db, const uint8_t *addr);
 extern void nic_addr_db_foreach(const nic_addr_db_t *db,
 	void (*func)(const uint8_t *, void *), void *arg);
Index: uspace/lib/nic/include/nic_rx_control.h
===================================================================
--- uspace/lib/nic/include/nic_rx_control.h	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/nic/include/nic_rx_control.h	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -118,5 +118,5 @@
 extern int nic_rxc_set_addr(nic_rxc_t *rxc,
 	const nic_address_t *prev_addr, const nic_address_t *curr_addr);
-extern int nic_rxc_check(const nic_rxc_t *rxc,
+extern bool nic_rxc_check(const nic_rxc_t *rxc,
 	const void *data, size_t size, nic_frame_type_t *frame_type);
 extern void nic_rxc_hw_filtering(nic_rxc_t *rxc,
Index: uspace/lib/nic/src/nic_addr_db.c
===================================================================
--- uspace/lib/nic/src/nic_addr_db.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/nic/src/nic_addr_db.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -223,5 +223,5 @@
  * @return true if the address is in the db, false otherwise
  */
-int nic_addr_db_contains(const nic_addr_db_t *db, const uint8_t *addr)
+bool nic_addr_db_contains(const nic_addr_db_t *db, const uint8_t *addr)
 {
 	assert(db && addr);
Index: uspace/lib/nic/src/nic_driver.c
===================================================================
--- uspace/lib/nic/src/nic_driver.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/nic/src/nic_driver.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -521,5 +521,5 @@
 	fibril_rwlock_read_lock(&nic_data->rxc_lock);
 	nic_frame_type_t frame_type;
-	int check = nic_rxc_check(&nic_data->rx_control, frame->data,
+	bool check = nic_rxc_check(&nic_data->rx_control, frame->data,
 	    frame->size, &frame_type);
 	fibril_rwlock_read_unlock(&nic_data->rxc_lock);
@@ -1092,5 +1092,5 @@
 		fibril_rwlock_read_unlock(&nic->main_lock);
 	}
-	return 0;
+	return EOK;
 }
 
Index: uspace/lib/nic/src/nic_rx_control.c
===================================================================
--- uspace/lib/nic/src/nic_rx_control.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/nic/src/nic_rx_control.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -394,5 +394,5 @@
  * @return True if the frame passes, false if it does not
  */
-int nic_rxc_check(const nic_rxc_t *rxc, const void *data, size_t size,
+bool nic_rxc_check(const nic_rxc_t *rxc, const void *data, size_t size,
 	nic_frame_type_t *frame_type)
 {
Index: uspace/lib/trackmod/protracker.c
===================================================================
--- uspace/lib/trackmod/protracker.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/trackmod/protracker.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -302,6 +302,5 @@
 		memcpy(&mod15, &mod31, sizeof(protracker_15smp_t));
 
-		rc = fseek(f, sizeof(protracker_15smp_t), SEEK_SET);
-		if (rc != 0) {
+		if (fseek(f, sizeof(protracker_15smp_t), SEEK_SET) < 0) {
 			printf("Error seeking.\n");
 			rc = EIO;
Index: uspace/lib/trackmod/xm.c
===================================================================
--- uspace/lib/trackmod/xm.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/lib/trackmod/xm.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -174,4 +174,5 @@
 	long seek_amount;
 	int rc;
+	int ret;
 
 	module->pattern = calloc(sizeof(trackmod_pattern_t), module->patterns);
@@ -182,6 +183,6 @@
 
 	for (i = 0; i < module->patterns; i++) {
-		rc = fread(&pattern, 1, sizeof(xm_pattern_t), f);
-		if (rc != sizeof(xm_pattern_t)) {
+		ret = fread(&pattern, 1, sizeof(xm_pattern_t), f);
+		if (ret != sizeof(xm_pattern_t)) {
 			rc = EIO;
 			goto error;
@@ -297,4 +298,5 @@
 	long pos;
 	int rc;
+	int ret;
 
 	module->instrs = uint16_t_le2host(xm_hdr->instruments);
@@ -305,6 +307,6 @@
 	for (i = 0; i < module->instrs; i++) {
 		pos = ftell(f);
-		rc = fread(&instr, 1, sizeof(xm_instr_t), f);
-		if (rc != sizeof(xm_instr_t)) {
+		ret = fread(&instr, 1, sizeof(xm_instr_t), f);
+		if (ret != sizeof(xm_instr_t)) {
 			rc = EIO;
 			goto error;
@@ -315,6 +317,6 @@
 
 		if (samples > 0) {
-			rc = fread(&instrx, 1, sizeof(xm_instr_ext_t), f);
-			if (rc != sizeof(xm_instr_ext_t)) {
+			ret = fread(&instrx, 1, sizeof(xm_instr_ext_t), f);
+			if (ret != sizeof(xm_instr_ext_t)) {
 				rc = EIO;
 				goto error;
@@ -346,6 +348,6 @@
 			pos = ftell(f);
 
-			rc = fread(&smp, 1, sizeof(xm_smp_t), f);
-			if (rc != sizeof(xm_smp_t)) {
+			ret = fread(&smp, 1, sizeof(xm_smp_t), f);
+			if (ret != sizeof(xm_smp_t)) {
 				rc = EIO;
 				goto error;
Index: uspace/srv/bd/file_bd/file_bd.c
===================================================================
--- uspace/srv/bd/file_bd/file_bd.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/srv/bd/file_bd/file_bd.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -222,5 +222,4 @@
 {
 	size_t n_rd;
-	int rc;
 
 	if (size < cnt * block_size)
@@ -238,6 +237,5 @@
 
 	clearerr(img);
-	rc = fseek(img, ba * block_size, SEEK_SET);
-	if (rc < 0) {
+	if (fseek(img, ba * block_size, SEEK_SET) < 0) {
 		fibril_mutex_unlock(&dev_lock);
 		return EIO;
@@ -264,5 +262,4 @@
 {
 	size_t n_wr;
-	int rc;
 
 	if (size < cnt * block_size)
@@ -280,6 +277,5 @@
 
 	clearerr(img);
-	rc = fseek(img, ba * block_size, SEEK_SET);
-	if (rc < 0) {
+	if (fseek(img, ba * block_size, SEEK_SET) < 0) {
 		fibril_mutex_unlock(&dev_lock);
 		return EIO;
Index: uspace/srv/bd/sata_bd/sata_bd.c
===================================================================
--- uspace/srv/bd/sata_bd/sata_bd.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/srv/bd/sata_bd/sata_bd.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -251,5 +251,5 @@
 	async_set_fallback_port_handler(sata_bd_connection, NULL);
 	rc = loc_server_register(NAME);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf(NAME ": Unable to register driver: %s.\n", str_error(rc));
 		return rc;
Index: uspace/srv/bd/vbd/disk.c
===================================================================
--- uspace/srv/bd/vbd/disk.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/srv/bd/vbd/disk.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -1114,6 +1114,5 @@
 	idx = part->lpart->index;
 
-	rc = asprintf(&name, "%sp%u", part->disk->svc_name, idx);
-	if (rc < 0) {
+	if (asprintf(&name, "%sp%u", part->disk->svc_name, idx) < 0) {
 		log_msg(LOG_DEFAULT, LVL_ERROR, "Out of memory.");
 		return ENOMEM;
Index: uspace/srv/fs/exfat/exfat_directory.c
===================================================================
--- uspace/srv/fs/exfat/exfat_directory.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/srv/fs/exfat/exfat_directory.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -218,5 +218,6 @@
 	uint16_t wname[EXFAT_FILENAME_LEN + 1];
 	exfat_dentry_t *d = NULL;
-	int rc, i;
+	int rc;
+	int i;
 	size_t offset = 0;
 	aoff64_t start_pos = 0;
@@ -305,5 +306,6 @@
     exfat_stream_dentry_t *ds)
 {
-	int rc, i, count;
+	int rc;
+	int i, count;
 	exfat_dentry_t *array = NULL, *de;
 	aoff64_t pos = di->pos;
@@ -372,5 +374,6 @@
 	exfat_dentry_t df, ds, *de;
 	uint16_t wname[EXFAT_FILENAME_LEN + 1];
-	int rc, i;
+	int rc;
+	int i;
 	size_t uctable_chars, j;
 	aoff64_t pos;
@@ -473,5 +476,6 @@
 int exfat_directory_erase_file(exfat_directory_t *di, aoff64_t pos)
 {
-	int rc, count;
+	int rc;
+	int count;
 	exfat_dentry_t *de;
 
Index: uspace/srv/fs/mfs/mfs_inode.c
===================================================================
--- uspace/srv/fs/mfs/mfs_inode.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/srv/fs/mfs/mfs_inode.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -83,5 +83,6 @@
 	struct mfs_sb_info *sbi;
 	block_t *b;
-	int i, r;
+	int i;
+	int r;
 
 	sbi = instance->sbi;
@@ -142,5 +143,6 @@
 	struct mfs_sb_info *sbi;
 	block_t *b;
-	int i, r;
+	int i;
+	int r;
 
 	ino_i = malloc(sizeof(*ino_i));
@@ -224,5 +226,6 @@
 mfs_write_inode_raw(struct mfs_node *mnode)
 {
-	int i, r;
+	int i;
+	int r;
 	block_t *b;
 	struct mfs_ino_info *ino_i = mnode->ino_i;
@@ -270,5 +273,6 @@
 	struct mfs_sb_info *sbi = mnode->instance->sbi;
 	block_t *b;
-	int i, r;
+	int i;
+	int r;
 
 	const uint32_t inum = ino_i->index - 1;
Index: uspace/srv/fs/mfs/mfs_rw.c
===================================================================
--- uspace/srv/fs/mfs/mfs_rw.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/srv/fs/mfs/mfs_rw.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -244,5 +244,6 @@
 	struct mfs_sb_info *sbi = inst->sbi;
 	struct mfs_ino_info *ino_i = mnode->ino_i;
-	int nr_direct, ptrs_per_block, rblock, r;
+	int nr_direct, ptrs_per_block, rblock;
+	int r;
 	int i;
 
Index: uspace/srv/hid/input/input.c
===================================================================
--- uspace/srv/hid/input/input.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/srv/hid/input/input.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -486,5 +486,5 @@
 	list_append(&kdev->link, &kbd_devs);
 	*kdevp = kdev;
-	return EOK;
+	return 0;
 	
 fail:
@@ -523,5 +523,5 @@
 	list_append(&mdev->link, &mouse_devs);
 	*mdevp = mdev;
-	return EOK;
+	return 0;
 	
 fail:
@@ -599,5 +599,5 @@
 	
 	*sdevp = sdev;
-	return EOK;
+	return 0;
 	
 fail:
@@ -670,5 +670,5 @@
 		if (!already_known) {
 			kbd_dev_t *kdev;
-			if (kbd_add_kbdev(svcs[i], &kdev) == EOK) {
+			if (kbd_add_kbdev(svcs[i], &kdev) == 0) {
 				printf("%s: Connected keyboard device '%s'\n",
 				    NAME, kdev->svc_name);
@@ -721,5 +721,5 @@
 		if (!already_known) {
 			mouse_dev_t *mdev;
-			if (mouse_add_mousedev(svcs[i], &mdev) == EOK) {
+			if (mouse_add_mousedev(svcs[i], &mdev) == 0) {
 				printf("%s: Connected mouse device '%s'\n",
 				    NAME, mdev->svc_name);
@@ -772,5 +772,5 @@
 		if (!already_known) {
 			serial_dev_t *sdev;
-			if (serial_add_srldev(svcs[i], &sdev) == EOK) {
+			if (serial_add_srldev(svcs[i], &sdev) == 0) {
 				printf("%s: Connected serial device '%s'\n",
 				    NAME, sdev->kdev->svc_name);
Index: uspace/srv/logger/logs.c
===================================================================
--- uspace/srv/logger/logs.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/srv/logger/logs.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -57,6 +57,5 @@
 	if (result == NULL)
 		return ENOMEM;
-	int rc = asprintf(&result->filename, "/log/%s", name);
-	if (rc < 0) {
+	if (asprintf(&result->filename, "/log/%s", name) < 0) {
 		free(result);
 		return ENOMEM;
@@ -91,7 +90,6 @@
 			goto error;
 	} else {
-		int rc = asprintf(&result->full_name, "%s/%s",
-		    parent->full_name, name);
-		if (rc < 0)
+		if (asprintf(&result->full_name, "%s/%s",
+		    parent->full_name, name) < 0)
 			goto error;
 		result->dest = parent->dest;
Index: uspace/srv/net/ethip/ethip.c
===================================================================
--- uspace/srv/net/ethip/ethip.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/srv/net/ethip/ethip.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -108,7 +108,7 @@
 	nic->iplink.arg = nic;
 
-	rc = asprintf(&svc_name, "net/eth%u", ++link_num);
-	if (rc < 0) {
+	if (asprintf(&svc_name, "net/eth%u", ++link_num) < 0) {
 		log_msg(LOG_DEFAULT, LVL_ERROR, "Out of memory.");
+		rc = ENOMEM;
 		goto error;
 	}
Index: uspace/srv/net/tcp/test/rqueue.c
===================================================================
--- uspace/srv/net/tcp/test/rqueue.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/srv/net/tcp/test/rqueue.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -63,5 +63,5 @@
 	/* We will be calling functions that perform logging */
 	rc = log_init("test-tcp");
-	PCUT_ASSERT_INT_EQUALS(EOK, rc);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 }
 
Index: uspace/srv/ns/clonable.c
===================================================================
--- uspace/srv/ns/clonable.c	(revision 8610c2c4d068b3acc29cae4d52b97b109bd41aea)
+++ uspace/srv/ns/clonable.c	(revision d5c1051faf4391647834d99babdd4a44ee5d9700)
@@ -130,5 +130,5 @@
 	int rc = loader_spawn("loader");
 	
-	if (rc < 0) {
+	if (rc != EOK) {
 		free(csr);
 		async_answer_0(callid, rc);
