Index: kernel/generic/include/ipc/ipc.h
===================================================================
--- kernel/generic/include/ipc/ipc.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ kernel/generic/include/ipc/ipc.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -148,5 +148,5 @@
 extern int ipc_call(phone_t *, call_t *);
 extern int ipc_call_sync(phone_t *, call_t *);
-extern call_t * ipc_wait_for_call(answerbox_t *, uint32_t, unsigned int);
+extern call_t *ipc_wait_for_call(answerbox_t *, uint32_t, unsigned int);
 extern int ipc_forward(call_t *, phone_t *, answerbox_t *, unsigned int);
 extern void ipc_answer(answerbox_t *, call_t *);
Index: kernel/generic/include/ipc/ipcrsc.h
===================================================================
--- kernel/generic/include/ipc/ipcrsc.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ kernel/generic/include/ipc/ipcrsc.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -39,8 +39,8 @@
 #include <ipc/ipc.h>
 
-extern call_t * get_call(sysarg_t callid);
-extern int phone_alloc(task_t *t);
-extern void phone_connect(int phoneid, answerbox_t *box);
-extern void phone_dealloc(int phoneid);
+extern call_t *get_call(sysarg_t);
+extern int phone_alloc(task_t *);
+extern void phone_connect(int, answerbox_t *);
+extern void phone_dealloc(int);
 
 #endif
Index: kernel/generic/include/proc/program.h
===================================================================
--- kernel/generic/include/proc/program.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ kernel/generic/include/proc/program.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -50,4 +50,5 @@
 	struct task *task;           /**< Program task */
 	struct thread *main_thread;  /**< Program main thread */
+	unsigned int loader_status;  /**< Binary loader error status */
 } program_t;
 
Index: kernel/generic/src/ipc/sysipc.c
===================================================================
--- kernel/generic/src/ipc/sysipc.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ kernel/generic/src/ipc/sysipc.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -597,5 +597,5 @@
 	if (IPC_GET_IMETHOD(call->data) == IPC_M_CONNECT_TO_ME) {
 		int phoneid = phone_alloc(TASK);
-		if (phoneid < 0) { /* Failed to allocate phone */
+		if (phoneid < 0) {  /* Failed to allocate phone */
 			IPC_SET_RETVAL(call->data, ELIMIT);
 			ipc_answer(box, call);
@@ -883,7 +883,7 @@
 	
 	/*
-	 * Userspace is not allowed to change interface and method of system
+	 * User space is not allowed to change interface and method of system
 	 * methods on forward, allow changing ARG1, ARG2, ARG3 and ARG4 by
-	 * means of method, arg1, arg2 and arg3.
+	 * means of imethod, arg1, arg2 and arg3.
 	 * If the interface and method is immutable, don't change anything.
 	 */
@@ -897,11 +897,11 @@
 			IPC_SET_ARG3(call->data, arg2);
 			
-			if (slow) {
+			if (slow)
 				IPC_SET_ARG4(call->data, arg3);
-				/*
-				 * For system methods we deliberately don't
-				 * overwrite ARG5.
-				 */
-			}
+			
+			/*
+			 * For system methods we deliberately don't
+			 * overwrite ARG5.
+			 */
 		} else {
 			IPC_SET_IMETHOD(call->data, imethod);
Index: kernel/generic/src/lib/rd.c
===================================================================
--- kernel/generic/src/lib/rd.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ kernel/generic/src/lib/rd.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -38,4 +38,5 @@
  */
 
+#include <print.h>
 #include <lib/rd.h>
 #include <mm/frame.h>
@@ -66,4 +67,6 @@
 	sysinfo_set_item_val("rd.size", NULL, size);
 	sysinfo_set_item_val("rd.address.physical", NULL, (sysarg_t) base);
+	
+	printf("RAM disk at %p (size %zu bytes)\n", (void *) base, size);
 }
 
Index: kernel/generic/src/main/kinit.c
===================================================================
--- kernel/generic/src/main/kinit.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ kernel/generic/src/main/kinit.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -201,5 +201,5 @@
 		str_cpy(namebuf + INIT_PREFIX_LEN,
 		    TASK_NAME_BUFLEN - INIT_PREFIX_LEN, name);
-
+		
 		/*
 		 * Create virtual memory mappings for init task images.
@@ -236,5 +236,7 @@
 			init_rd((void *) init.tasks[i].paddr, init.tasks[i].size);
 		} else
-			printf("init[%zu]: Init binary load failed (error %d)\n", i, rc);
+			printf("init[%zu]: Init binary load failed "
+			    "(error %d, loader status %u)\n", i, rc,
+			    programs[i].loader_status);
 	}
 	
Index: kernel/generic/src/proc/program.c
===================================================================
--- kernel/generic/src/proc/program.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ kernel/generic/src/proc/program.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -80,4 +80,5 @@
 	kernel_uarg->uspace_uarg = NULL;
 	
+	prg->loader_status = EE_OK;
 	prg->task = task_create(as, name);
 	if (!prg->task)
@@ -111,9 +112,10 @@
  * executable image. The task is returned in *task.
  *
- * @param image_addr Address of an executable program image.
- * @param name       Name to set for the program's task.
- * @param prg        Buffer for storing program info. If image_addr
- *                   points to a loader image, p->task will be set to
- *                   NULL and EOK will be returned.
+ * @param[in]  image_addr Address of an executable program image.
+ * @param[in]  name       Name to set for the program's task.
+ * @param[out] prg        Buffer for storing program info.
+ *                        If image_addr points to a loader image,
+ *                        prg->task will be set to NULL and EOK
+ *                        will be returned.
  *
  * @return EOK on success or negative error code.
@@ -126,12 +128,11 @@
 		return ENOMEM;
 	
-	unsigned int rc = elf_load((elf_header_t *) image_addr, as, 0);
-	LOG("elf_load() -> %u\n", rc);
-	if (rc != EE_OK) {
+	prg->loader_status = elf_load((elf_header_t *) image_addr, as, 0);
+	if (prg->loader_status != EE_OK) {
 		as_destroy(as);
 		prg->task = NULL;
 		prg->main_thread = NULL;
 		
-		if (rc != EE_LOADER)
+		if (prg->loader_status != EE_LOADER)
 			return ENOTSUP;
 		
@@ -141,6 +142,5 @@
 		
 		program_loader = image_addr;
-		LOG("Registered program loader at %p",
-		    (void *) image_addr);
+		printf("Program loader at %p\n", (void *) image_addr);
 		
 		return EOK;
@@ -172,9 +172,10 @@
 	}
 	
-	unsigned int rc = elf_load((elf_header_t *) program_loader, as,
+	prg->loader_status = elf_load((elf_header_t *) program_loader, as,
 	    ELD_F_LOADER);
-	if (rc != EE_OK) {
+	if (prg->loader_status != EE_OK) {
 		as_destroy(as);
-		printf("Cannot spawn loader (%s)\n", elf_error(rc));
+		printf("Cannot spawn loader (%s)\n",
+		    elf_error(prg->loader_status));
 		return ENOENT;
 	}
Index: kernel/generic/src/synch/spinlock.c
===================================================================
--- kernel/generic/src/synch/spinlock.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ kernel/generic/src/synch/spinlock.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -262,5 +262,5 @@
 	int rc = spinlock_trylock(&(lock->lock));
 	
-	ASSERT_IRQ_SPINLOCK(!rc || !lock->guard, lock);
+	ASSERT_IRQ_SPINLOCK((!rc) || (!lock->guard), lock);
 	return rc;
 }
Index: tools/toolchain.sh
===================================================================
--- tools/toolchain.sh	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ tools/toolchain.sh	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -149,5 +149,6 @@
 	echo " sparc64    SPARC V9"
 	echo " all        build all targets"
-	echo " parallel   same as 'all', but in parallel"
+	echo " parallel   same as 'all', but all in parallel"
+	echo " 2-way      same as 'all', but 2-way parallel"
 	echo
 	echo "The toolchain will be installed to the directory specified by"
@@ -431,4 +432,26 @@
 		wait
 		;;
+	"2-way")
+		prepare
+		build_target "amd64" "amd64-linux-gnu" &
+		build_target "arm32" "arm-linux-gnueabi" &
+		wait
+		
+		build_target "ia32" "i686-pc-linux-gnu" &
+		build_target "ia64" "ia64-pc-linux-gnu" &
+		wait
+		
+		build_target "mips32" "mipsel-linux-gnu" &
+		build_target "mips32eb" "mips-linux-gnu" &
+		wait
+		
+		build_target "mips64" "mips64el-linux-gnu" &
+		build_target "ppc32" "ppc-linux-gnu" &
+		wait
+		
+		build_target "ppc64" "ppc64-linux-gnu" &
+		build_target "sparc64" "sparc64-linux-gnu" &
+		wait
+		;;
 	*)
 		show_usage
Index: uspace/app/tester/hw/misc/virtchar1.c
===================================================================
--- uspace/app/tester/hw/misc/virtchar1.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/app/tester/hw/misc/virtchar1.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -48,6 +48,7 @@
 #include "../../tester.h"
 
-#define DEVICE_PATH_NORMAL "/loc/devices/\\virt\\null\\a"
-#define BUFFER_SIZE 64
+#define DEVICE_PATH_NORMAL  "/loc/devices/\\virt\\null\\a"
+
+#define BUFFER_SIZE  64
 
 static const char *test_virtchar1_internal(const char *path)
@@ -65,5 +66,5 @@
 	
 	TPRINTF("   ...file handle %d\n", fd);
-
+	
 	TPRINTF(" Asking for session...\n");
 	async_sess_t *sess = fd_session(EXCHANGE_SERIALIZE, fd);
@@ -96,12 +97,9 @@
 
 const char *test_virtchar1(void)
-{;
-	const char *res;
-
-	res = test_virtchar1_internal(DEVICE_PATH_NORMAL);
-	if (res != NULL) {
+{
+	const char *res = test_virtchar1_internal(DEVICE_PATH_NORMAL);
+	if (res != NULL)
 		return res;
-	}
-
+	
 	return NULL;
 }
Index: uspace/app/trace/proto.h
===================================================================
--- uspace/app/trace/proto.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/app/trace/proto.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -44,10 +44,10 @@
 typedef struct {
 	const char *name;
-
+	
 	int argc;
 	val_type_t arg_type[OPER_MAX_ARGS];
-
+	
 	val_type_t rv_type;
-
+	
 	int respc;
 	val_type_t resp_type[OPER_MAX_ARGS];
@@ -57,5 +57,5 @@
 	/** Protocol name */
 	const char *name;
-
+	
 	/** Maps method number to operation */
 	hash_table_t method_oper;
@@ -65,18 +65,16 @@
 extern hash_table_t srv_proto;
 
-void proto_init(void);
-void proto_cleanup(void);
+extern void proto_init(void);
+extern void proto_cleanup(void);
 
-void proto_register(int srv, proto_t *proto);
-proto_t *proto_get_by_srv(int srv);
-proto_t *proto_new(const char *name);
-void proto_delete(proto_t *proto);
-void proto_add_oper(proto_t *proto, int method, oper_t *oper);
-oper_t *proto_get_oper(proto_t *proto, int method);
+extern void proto_register(int, proto_t *);
+extern proto_t *proto_get_by_srv(int);
+extern proto_t *proto_new(const char *);
+extern void proto_delete(proto_t *);
+extern void proto_add_oper(proto_t *, int, oper_t *);
+extern oper_t *proto_get_oper(proto_t *, int);
 
-oper_t *oper_new(const char *name, int argc, val_type_t *arg_types,
-    val_type_t rv_type, int respc, val_type_t *resp_types);
-
-
+extern oper_t *oper_new(const char *, int, val_type_t *, val_type_t, int,
+    val_type_t *);
 
 #endif
Index: uspace/drv/bus/usb/ehci/res.c
===================================================================
--- uspace/drv/bus/usb/ehci/res.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/drv/bus/usb/ehci/res.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -109,5 +109,5 @@
 	return EOK;
 }
-/*----------------------------------------------------------------------------*/
+
 /** Calls the PCI driver with a request to enable interrupts
  *
@@ -127,5 +127,5 @@
 	return enabled ? EOK : EIO;
 }
-/*----------------------------------------------------------------------------*/
+
 /** Implements BIOS hands-off routine as described in EHCI spec
  *
Index: uspace/drv/bus/usb/uhci/res.c
===================================================================
--- uspace/drv/bus/usb/uhci/res.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/drv/bus/usb/uhci/res.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -86,5 +86,5 @@
 	return EOK;
 }
-/*----------------------------------------------------------------------------*/
+
 /** Call the PCI driver with a request to enable interrupts
  *
@@ -105,5 +105,5 @@
 	return enabled ? EOK : EIO;
 }
-/*----------------------------------------------------------------------------*/
+
 /** Call the PCI driver with a request to clear legacy support register
  *
Index: uspace/lib/c/generic/inet.c
===================================================================
--- uspace/lib/c/generic/inet.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/c/generic/inet.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -44,29 +44,25 @@
 {
 	async_exch_t *exch = async_exchange_begin(inet_sess);
-
+	
 	ipc_call_t answer;
 	aid_t req = async_send_0(exch, INET_CALLBACK_CREATE, &answer);
 	int rc = async_connect_to_me(exch, 0, 0, 0, inet_cb_conn, NULL);
 	async_exchange_end(exch);
-
+	
 	if (rc != EOK)
 		return rc;
-
+	
 	sysarg_t retval;
 	async_wait_for(req, &retval);
-	if (retval != EOK)
-		return retval;
-
-	return EOK;
+	
+	return retval;
 }
 
 static int inet_set_proto(uint8_t protocol)
 {
-	int rc;
-
 	async_exch_t *exch = async_exchange_begin(inet_sess);
-	rc = async_req_1_0(exch, INET_SET_PROTO, protocol);
+	int rc = async_req_1_0(exch, INET_SET_PROTO, protocol);
 	async_exchange_end(exch);
-
+	
 	return rc;
 }
@@ -80,15 +76,15 @@
 	assert(inet_ev_ops == NULL);
 	assert(inet_protocol == 0);
-
+	
 	rc = loc_service_get_id(SERVICE_NAME_INET, &inet_svc,
 	    IPC_FLAG_BLOCKING);
 	if (rc != EOK)
 		return ENOENT;
-
+	
 	inet_sess = loc_service_connect(EXCHANGE_SERIALIZE, inet_svc,
 	    IPC_FLAG_BLOCKING);
 	if (inet_sess == NULL)
 		return ENOENT;
-
+	
 	if (inet_set_proto(protocol) != EOK) {
 		async_hangup(inet_sess);
@@ -96,5 +92,5 @@
 		return EIO;
 	}
-
+	
 	if (inet_callback_create() != EOK) {
 		async_hangup(inet_sess);
@@ -102,5 +98,5 @@
 		return EIO;
 	}
-
+	
 	inet_protocol = protocol;
 	inet_ev_ops = ev_ops;
Index: uspace/lib/c/generic/inetcfg.c
===================================================================
--- uspace/lib/c/generic/inetcfg.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/c/generic/inetcfg.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -119,15 +119,15 @@
 
 	assert(inetcfg_sess == NULL);
-
+	
 	rc = loc_service_get_id(SERVICE_NAME_INETCFG, &inet_svc,
 	    IPC_FLAG_BLOCKING);
 	if (rc != EOK)
 		return ENOENT;
-
+	
 	inetcfg_sess = loc_service_connect(EXCHANGE_SERIALIZE, inet_svc,
 	    IPC_FLAG_BLOCKING);
 	if (inetcfg_sess == NULL)
 		return ENOENT;
-
+	
 	return EOK;
 }
Index: uspace/lib/c/generic/inetping.c
===================================================================
--- uspace/lib/c/generic/inetping.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/c/generic/inetping.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -49,22 +49,22 @@
 
 	assert(inetping_sess == NULL);
-
+	
 	inetping_ev_ops = ev_ops;
-
+	
 	rc = loc_service_get_id(SERVICE_NAME_INETPING, &inetping_svc,
 	    IPC_FLAG_BLOCKING);
 	if (rc != EOK)
 		return ENOENT;
-
+	
 	inetping_sess = loc_service_connect(EXCHANGE_SERIALIZE, inetping_svc,
 	    IPC_FLAG_BLOCKING);
 	if (inetping_sess == NULL)
 		return ENOENT;
-
+	
 	async_exch_t *exch = async_exchange_begin(inetping_sess);
 
 	rc = async_connect_to_me(exch, 0, 0, 0, inetping_cb_conn, NULL);
 	async_exchange_end(exch);
-
+	
 	if (rc != EOK) {
 		async_hangup(inetping_sess);
@@ -72,5 +72,5 @@
 		return rc;
 	}
-
+	
 	return EOK;
 }
Index: uspace/lib/c/generic/iplink.c
===================================================================
--- uspace/lib/c/generic/iplink.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/c/generic/iplink.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -49,29 +49,26 @@
     iplink_t **riplink)
 {
-	iplink_t *iplink = NULL;
-	int rc;
-
-	iplink = calloc(1, sizeof(iplink_t));
+	iplink_t *iplink = calloc(1, sizeof(iplink_t));
 	if (iplink == NULL)
 		return ENOMEM;
-
+	
 	iplink->sess = sess;
 	iplink->ev_ops = ev_ops;
-
+	
 	async_exch_t *exch = async_exchange_begin(sess);
-
-	rc = async_connect_to_me(exch, 0, 0, 0, iplink_cb_conn, iplink);
+	
+	int rc = async_connect_to_me(exch, 0, 0, 0, iplink_cb_conn, iplink);
 	async_exchange_end(exch);
-
+	
 	if (rc != EOK)
 		goto error;
-
+	
 	*riplink = iplink;
 	return EOK;
-
+	
 error:
 	if (iplink != NULL)
 		free(iplink);
-
+	
 	return rc;
 }
Index: uspace/lib/c/generic/net/socket_client.c
===================================================================
--- uspace/lib/c/generic/net/socket_client.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/c/generic/net/socket_client.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -283,9 +283,8 @@
 static async_sess_t *socket_get_tcp_sess(void)
 {
-	if (socket_globals.tcp_sess == NULL) {
+	if (socket_globals.tcp_sess == NULL)
 		socket_globals.tcp_sess = service_bind(SERVICE_TCP,
 		    0, 0, SERVICE_TCP, socket_connection);
-	}
-
+	
 	return socket_globals.tcp_sess;
 }
@@ -300,9 +299,8 @@
 static async_sess_t *socket_get_udp_sess(void)
 {
-	if (socket_globals.udp_sess == NULL) {
+	if (socket_globals.udp_sess == NULL)
 		socket_globals.udp_sess = service_bind(SERVICE_UDP,
 		    0, 0, SERVICE_UDP, socket_connection);
-	}
-
+	
 	return socket_globals.udp_sess;
 }
Index: uspace/lib/drv/generic/driver.c
===================================================================
--- uspace/lib/drv/generic/driver.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/drv/generic/driver.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -125,19 +125,17 @@
 static void driver_dev_add(ipc_callid_t iid, ipc_call_t *icall)
 {
-	char *dev_name = NULL;
-	int res;
-	
 	devman_handle_t dev_handle = IPC_GET_ARG1(*icall);
 	devman_handle_t parent_fun_handle = IPC_GET_ARG2(*icall);
 	
 	ddf_dev_t *dev = create_device();
-
+	
 	/* Add one reference that will be dropped by driver_dev_remove() */
 	dev_add_ref(dev);
 	dev->handle = dev_handle;
-
+	
+	char *dev_name = NULL;
 	async_data_write_accept((void **) &dev_name, true, 0, 0, 0, 0);
 	dev->name = dev_name;
-
+	
 	/*
 	 * Currently not used, parent fun handle is stored in context
@@ -146,5 +144,5 @@
 	(void) parent_fun_handle;
 	
-	res = driver->driver_ops->dev_add(dev);
+	int res = driver->driver_ops->dev_add(dev);
 	
 	if (res != EOK) {
@@ -163,12 +161,8 @@
 static void driver_dev_remove(ipc_callid_t iid, ipc_call_t *icall)
 {
-	devman_handle_t devh;
-	ddf_dev_t *dev;
-	int rc;
-	
-	devh = IPC_GET_ARG1(*icall);
+	devman_handle_t devh = IPC_GET_ARG1(*icall);
 	
 	fibril_mutex_lock(&devices_mutex);
-	dev = driver_get_device(devh);
+	ddf_dev_t *dev = driver_get_device(devh);
 	if (dev != NULL)
 		dev_add_ref(dev);
@@ -179,4 +173,6 @@
 		return;
 	}
+	
+	int rc;
 	
 	if (driver->driver_ops->dev_remove != NULL)
@@ -193,12 +189,8 @@
 static void driver_dev_gone(ipc_callid_t iid, ipc_call_t *icall)
 {
-	devman_handle_t devh;
-	ddf_dev_t *dev;
-	int rc;
-	
-	devh = IPC_GET_ARG1(*icall);
+	devman_handle_t devh = IPC_GET_ARG1(*icall);
 	
 	fibril_mutex_lock(&devices_mutex);
-	dev = driver_get_device(devh);
+	ddf_dev_t *dev = driver_get_device(devh);
 	if (dev != NULL)
 		dev_add_ref(dev);
@@ -209,4 +201,6 @@
 		return;
 	}
+	
+	int rc;
 	
 	if (driver->driver_ops->dev_gone != NULL)
@@ -223,9 +217,5 @@
 static void driver_fun_online(ipc_callid_t iid, ipc_call_t *icall)
 {
-	devman_handle_t funh;
-	ddf_fun_t *fun;
-	int rc;
-	
-	funh = IPC_GET_ARG1(*icall);
+	devman_handle_t funh = IPC_GET_ARG1(*icall);
 	
 	/*
@@ -236,5 +226,5 @@
 	fibril_mutex_lock(&functions_mutex);
 	
-	fun = driver_get_function(funh);
+	ddf_fun_t *fun = driver_get_function(funh);
 	if (fun != NULL)
 		fun_add_ref(fun);
@@ -248,4 +238,6 @@
 	
 	/* Call driver entry point */
+	int rc;
+	
 	if (driver->driver_ops->fun_online != NULL)
 		rc = driver->driver_ops->fun_online(fun);
@@ -260,9 +252,5 @@
 static void driver_fun_offline(ipc_callid_t iid, ipc_call_t *icall)
 {
-	devman_handle_t funh;
-	ddf_fun_t *fun;
-	int rc;
-	
-	funh = IPC_GET_ARG1(*icall);
+	devman_handle_t funh = IPC_GET_ARG1(*icall);
 	
 	/*
@@ -273,5 +261,5 @@
 	fibril_mutex_lock(&functions_mutex);
 	
-	fun = driver_get_function(funh);
+	ddf_fun_t *fun = driver_get_function(funh);
 	if (fun != NULL)
 		fun_add_ref(fun);
@@ -285,4 +273,6 @@
 	
 	/* Call driver entry point */
+	int rc;
+	
 	if (driver->driver_ops->fun_offline != NULL)
 		rc = driver->driver_ops->fun_offline(fun);
@@ -597,12 +587,10 @@
 void *ddf_dev_data_alloc(ddf_dev_t *dev, size_t size)
 {
-	void *data;
-
 	assert(dev->driver_data == NULL);
-
-	data = calloc(1, size);
+	
+	void *data = calloc(1, size);
 	if (data == NULL)
 		return NULL;
-
+	
 	dev->driver_data = data;
 	return data;
@@ -634,17 +622,15 @@
 ddf_fun_t *ddf_fun_create(ddf_dev_t *dev, fun_type_t ftype, const char *name)
 {
-	ddf_fun_t *fun;
-
-	fun = create_function();
+	ddf_fun_t *fun = create_function();
 	if (fun == NULL)
 		return NULL;
-
+	
 	/* Add one reference that will be dropped by ddf_fun_destroy() */
 	fun->dev = dev;
 	fun_add_ref(fun);
-
+	
 	fun->bound = false;
 	fun->ftype = ftype;
-
+	
 	fun->name = str_dup(name);
 	if (fun->name == NULL) {
@@ -652,5 +638,5 @@
 		return NULL;
 	}
-
+	
 	return fun;
 }
@@ -659,13 +645,11 @@
 void *ddf_fun_data_alloc(ddf_fun_t *fun, size_t size)
 {
-	void *data;
-
 	assert(fun->bound == false);
 	assert(fun->driver_data == NULL);
-
-	data = calloc(1, size);
+	
+	void *data = calloc(1, size);
 	if (data == NULL)
 		return NULL;
-
+	
 	fun->driver_data = data;
 	return data;
@@ -677,10 +661,11 @@
  * must not be bound.
  *
- * @param fun		Function to destroy
+ * @param fun Function to destroy
+ *
  */
 void ddf_fun_destroy(ddf_fun_t *fun)
 {
 	assert(fun->bound == false);
-
+	
 	/*
 	 * Drop the reference added by ddf_fun_create(). This will deallocate
@@ -697,4 +682,5 @@
 	if (fun->ops == NULL)
 		return NULL;
+	
 	return fun->ops->interfaces[idx];
 }
@@ -709,6 +695,8 @@
  * the same name.
  *
- * @param fun		Function to bind
- * @return		EOK on success or negative error code
+ * @param fun Function to bind
+ *
+ * @return EOK on success or negative error code
+ *
  */
 int ddf_fun_bind(ddf_fun_t *fun)
@@ -717,8 +705,6 @@
 	assert(fun->name != NULL);
 	
-	int res;
-	
 	add_to_functions_list(fun);
-	res = devman_add_function(fun->name, fun->ftype, &fun->match_ids,
+	int res = devman_add_function(fun->name, fun->ftype, &fun->match_ids,
 	    fun->dev->handle, &fun->handle);
 	if (res != EOK) {
@@ -736,17 +722,17 @@
  * the function invisible to the system.
  *
- * @param fun		Function to unbind
- * @return		EOK on success or negative error code
+ * @param fun Function to unbind
+ *
+ * @return EOK on success or negative error code
+ *
  */
 int ddf_fun_unbind(ddf_fun_t *fun)
 {
-	int res;
-	
 	assert(fun->bound == true);
 	
-	res = devman_remove_function(fun->handle);
+	int res = devman_remove_function(fun->handle);
 	if (res != EOK)
 		return res;
-
+	
 	remove_from_functions_list(fun);
 	
@@ -757,14 +743,14 @@
 /** Online function.
  *
- * @param fun		Function to online
- * @return		EOK on success or negative error code
+ * @param fun Function to online
+ *
+ * @return EOK on success or negative error code
+ *
  */
 int ddf_fun_online(ddf_fun_t *fun)
 {
-	int res;
-	
 	assert(fun->bound == true);
 	
-	res = devman_drv_fun_online(fun->handle);
+	int res = devman_drv_fun_online(fun->handle);
 	if (res != EOK)
 		return res;
@@ -775,14 +761,14 @@
 /** Offline function.
  *
- * @param fun		Function to offline
- * @return		EOK on success or negative error code
+ * @param fun Function to offline
+ *
+ * @return EOK on success or negative error code
+ *
  */
 int ddf_fun_offline(ddf_fun_t *fun)
 {
-	int res;
-	
 	assert(fun->bound == true);
 	
-	res = devman_drv_fun_offline(fun->handle);
+	int res = devman_drv_fun_offline(fun->handle);
 	if (res != EOK)
 		return res;
@@ -796,18 +782,19 @@
  * Cannot be called when the function node is bound.
  *
- * @param fun			Function
- * @param match_id_str		Match string
- * @param match_score		Match score
- * @return			EOK on success, ENOMEM if out of memory.
+ * @param fun          Function
+ * @param match_id_str Match string
+ * @param match_score  Match score
+ *
+ * @return EOK on success.
+ * @return ENOMEM if out of memory.
+ *
  */
 int ddf_fun_add_match_id(ddf_fun_t *fun, const char *match_id_str,
     int match_score)
 {
-	match_id_t *match_id;
-	
 	assert(fun->bound == false);
 	assert(fun->ftype == fun_inner);
 	
-	match_id = create_match_id();
+	match_id_t *match_id = create_match_id();
 	if (match_id == NULL)
 		return ENOMEM;
@@ -831,4 +818,5 @@
  *
  * Must only be called when the function is bound.
+ *
  */
 int ddf_fun_add_to_category(ddf_fun_t *fun, const char *cat_name)
@@ -842,6 +830,4 @@
 int ddf_driver_main(driver_t *drv)
 {
-	int rc;
-
 	/*
 	 * Remember the driver structure - driver_ops will be called by generic
@@ -858,5 +844,5 @@
 	 */
 	async_set_client_connection(driver_connection);
-	rc = devman_driver_register(driver->name);
+	int rc = devman_driver_register(driver->name);
 	if (rc != EOK) {
 		printf("Error: Failed to register driver with device manager "
@@ -864,5 +850,5 @@
 		    str_error(rc));
 		
-		return 1;
+		return rc;
 	}
 	
@@ -870,10 +856,10 @@
 	rc = task_retval(0);
 	if (rc != EOK)
-		return 1;
-
+		return rc;
+	
 	async_manager();
 	
 	/* Never reached. */
-	return 0;
+	return EOK;
 }
 
Index: uspace/lib/drv/generic/interrupt.c
===================================================================
--- uspace/lib/drv/generic/interrupt.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/drv/generic/interrupt.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -117,6 +117,6 @@
 }
 
-static void
-add_interrupt_context(interrupt_context_list_t *list, interrupt_context_t *ctx)
+static void add_interrupt_context(interrupt_context_list_t *list,
+    interrupt_context_t *ctx)
 {
 	fibril_mutex_lock(&list->mutex);
@@ -134,6 +134,6 @@
 }
 
-static interrupt_context_t *
-find_interrupt_context_by_id(interrupt_context_list_t *list, int id)
+static interrupt_context_t *find_interrupt_context_by_id(
+    interrupt_context_list_t *list, int id)
 {
 	interrupt_context_t *ctx;
@@ -153,6 +153,6 @@
 }
 
-static interrupt_context_t *
-find_interrupt_context(interrupt_context_list_t *list, ddf_dev_t *dev, int irq)
+static interrupt_context_t *find_interrupt_context(
+    interrupt_context_list_t *list, ddf_dev_t *dev, int irq)
 {
 	interrupt_context_t *ctx;
@@ -173,7 +173,6 @@
 
 
-int
-register_interrupt_handler(ddf_dev_t *dev, int irq, interrupt_handler_t *handler,
-    irq_code_t *pseudocode)
+int register_interrupt_handler(ddf_dev_t *dev, int irq,
+    interrupt_handler_t *handler, irq_code_t *pseudocode)
 {
 	interrupt_context_t *ctx = create_interrupt_context();
@@ -193,5 +192,5 @@
 		delete_interrupt_context(ctx);
 	}
-
+	
 	return res;
 }
Index: uspace/lib/drv/generic/log.c
===================================================================
--- uspace/lib/drv/generic/log.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/drv/generic/log.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -33,11 +33,11 @@
 #include <io/log.h>
 #include <stdarg.h>
-
 #include <ddf/log.h>
 
 /** Initialize the logging system.
  *
- * @param drv_name	Driver name, will be printed as part of message
- * @param level		Minimum message level to print
+ * @param drv_name Driver name, will be printed as part of message
+ * @param level    Minimum message level to print
+ *
  */
 int ddf_log_init(const char *drv_name, log_level_t level)
@@ -48,13 +48,14 @@
 /** Log a driver message.
  *
- * @param level		Message verbosity level. Message is only printed
- *			if verbosity is less than or equal to current
- *			reporting level.
- * @param fmt		Format string (no trailing newline)
+ * @param level Message verbosity level. Message is only printed
+ *              if verbosity is less than or equal to current
+ *              reporting level.
+ * @param fmt   Format string (no trailing newline)
+ *
  */
 void ddf_msg(log_level_t level, const char *fmt, ...)
 {
 	va_list args;
-
+	
 	va_start(args, fmt);
 	log_msgv(level, fmt, args);
Index: uspace/lib/drv/include/ddf/driver.h
===================================================================
--- uspace/lib/drv/include/ddf/driver.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/drv/include/ddf/driver.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -81,4 +81,5 @@
 	 */
 	devman_handle_t handle;
+	
 	/** Reference count */
 	atomic_t refcnt;
@@ -104,6 +105,8 @@
 	/** True if bound to the device manager */
 	bool bound;
+	
 	/** Function indentifier (asigned by device manager) */
 	devman_handle_t handle;
+	
 	/** Reference count */
 	atomic_t refcnt;
@@ -114,12 +117,17 @@
 	/** Function type */
 	fun_type_t ftype;
+	
 	/** Function name */
 	const char *name;
+	
 	/** List of device ids for driver matching */
 	match_id_list_t match_ids;
+	
 	/** Driver-specific data associated with this function */
 	void *driver_data;
+	
 	/** Implementation of operations provided by this function */
 	ddf_dev_ops_t *ops;
+	
 	/** Connection handler or @c NULL to use the DDF default handler. */
 	async_client_conn_t conn_handler;
@@ -137,10 +145,14 @@
 	/** Callback method for passing a new device to the device driver */
 	int (*dev_add)(ddf_dev_t *);
+	
 	/** Ask driver to remove a device */
 	int (*dev_remove)(ddf_dev_t *);
+	
 	/** Inform driver a device disappeared */
 	int (*dev_gone)(ddf_dev_t *);
+	
 	/** Ask driver to online a specific function */
 	int (*fun_online)(ddf_fun_t *);
+	
 	/** Ask driver to offline a specific function */
 	int (*fun_offline)(ddf_fun_t *);
Index: uspace/lib/drv/include/ddf/interrupt.h
===================================================================
--- uspace/lib/drv/include/ddf/interrupt.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/drv/include/ddf/interrupt.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -42,5 +42,4 @@
 #include <ddi.h>
 #include <fibril_synch.h>
-
 #include "driver.h"
 #include "../dev_iface.h"
Index: uspace/lib/drv/include/ops/hw_res.h
===================================================================
--- uspace/lib/drv/include/ops/hw_res.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/drv/include/ops/hw_res.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -39,5 +39,4 @@
 #include <device/hw_res.h>
 #include <sys/types.h>
-
 #include "../ddf/driver.h"
 
Index: uspace/lib/drv/include/ops/nic.h
===================================================================
--- uspace/lib/drv/include/ops/nic.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/drv/include/ops/nic.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -40,5 +40,4 @@
 #include <nic/nic.h>
 #include <sys/time.h>
-
 #include "../ddf/driver.h"
 
Index: uspace/lib/nic/include/nic.h
===================================================================
--- uspace/lib/nic/include/nic.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/nic/include/nic.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -83,4 +83,5 @@
  */
 typedef void (*send_frame_handler)(nic_t *, void *, size_t);
+
 /**
  * The handler for transitions between driver states.
@@ -94,4 +95,5 @@
  */
 typedef int (*state_change_handler)(nic_t *);
+
 /**
  * Handler for unicast filtering mode change.
@@ -106,5 +108,6 @@
  */
 typedef int (*unicast_mode_change_handler)(nic_t *,
-	nic_unicast_mode_t, const nic_address_t *, size_t);
+    nic_unicast_mode_t, const nic_address_t *, size_t);
+
 /**
  * Handler for multicast filtering mode change.
@@ -119,5 +122,6 @@
  */
 typedef int (*multicast_mode_change_handler)(nic_t *,
-	nic_multicast_mode_t, const nic_address_t *, size_t);
+    nic_multicast_mode_t, const nic_address_t *, size_t);
+
 /**
  * Handler for broadcast filtering mode change.
@@ -130,4 +134,5 @@
  */
 typedef int (*broadcast_mode_change_handler)(nic_t *, nic_broadcast_mode_t);
+
 /**
  * Handler for blocked sources list change.
@@ -138,5 +143,6 @@
  */
 typedef void (*blocked_sources_change_handler)(nic_t *,
-	const nic_address_t *, size_t);
+    const nic_address_t *, size_t);
+
 /**
  * Handler for VLAN filtering mask change.
@@ -145,4 +151,5 @@
  */
 typedef void (*vlan_mask_change_handler)(nic_t *, const nic_vlan_mask_t *);
+
 /**
  * Handler called when a WOL virtue is added.
@@ -165,4 +172,5 @@
  */
 typedef int (*wol_virtue_add_handler)(nic_t *, const nic_wol_virtue_t *);
+
 /**
  * Handler called when a WOL virtue is removed.
@@ -174,4 +182,5 @@
  */
 typedef void (*wol_virtue_remove_handler)(nic_t *, const nic_wol_virtue_t *);
+
 /**
  * Handler for poll mode change.
@@ -186,5 +195,6 @@
  */
 typedef int (*poll_mode_change_handler)(nic_t *,
-	nic_poll_mode_t, const struct timeval *);
+    nic_poll_mode_t, const struct timeval *);
+
 /**
  * Event handler called when the NIC should poll its buffers for a new frame
@@ -202,5 +212,5 @@
 extern int nic_driver_init(const char *);
 extern void nic_driver_implement(driver_ops_t *, ddf_dev_ops_t *,
-	nic_iface_t *);
+    nic_iface_t *);
 
 /* Functions called in add_device */
@@ -210,13 +220,13 @@
 extern void nic_set_send_frame_handler(nic_t *, send_frame_handler);
 extern void nic_set_state_change_handlers(nic_t *,
-	state_change_handler, state_change_handler, state_change_handler);
+    state_change_handler, state_change_handler, state_change_handler);
 extern void nic_set_filtering_change_handlers(nic_t *,
-	unicast_mode_change_handler, multicast_mode_change_handler,
-	broadcast_mode_change_handler, blocked_sources_change_handler,
-	vlan_mask_change_handler);
+    unicast_mode_change_handler, multicast_mode_change_handler,
+    broadcast_mode_change_handler, blocked_sources_change_handler,
+    vlan_mask_change_handler);
 extern void nic_set_wol_virtue_change_handlers(nic_t *,
-	wol_virtue_add_handler, wol_virtue_remove_handler);
+    wol_virtue_add_handler, wol_virtue_remove_handler);
 extern void nic_set_poll_handlers(nic_t *,
-	poll_mode_change_handler, poll_request_handler);
+    poll_mode_change_handler, poll_request_handler);
 
 /* General driver functions */
@@ -254,10 +264,10 @@
 extern void nic_report_hw_filtering(nic_t *, int, int, int);
 extern void nic_query_unicast(const nic_t *,
-	nic_unicast_mode_t *, size_t, nic_address_t *, size_t *);
+    nic_unicast_mode_t *, size_t, nic_address_t *, size_t *);
 extern void nic_query_multicast(const nic_t *,
-	nic_multicast_mode_t *, size_t, nic_address_t *, size_t *);
+    nic_multicast_mode_t *, size_t, nic_address_t *, size_t *);
 extern void nic_query_broadcast(const nic_t *, nic_broadcast_mode_t *);
 extern void nic_query_blocked_sources(const nic_t *,
-	size_t, nic_address_t *, size_t *);
+    size_t, nic_address_t *, size_t *);
 extern int nic_query_vlan_mask(const nic_t *, nic_vlan_mask_t *);
 extern int nic_query_wol_max_caps(const nic_t *, nic_wv_type_t);
Index: uspace/lib/nic/include/nic_impl.h
===================================================================
--- uspace/lib/nic/include/nic_impl.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/nic/include/nic_impl.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -53,30 +53,30 @@
 extern int nic_get_stats_impl(ddf_fun_t *dev_fun, nic_device_stats_t *stats);
 extern int nic_unicast_get_mode_impl(ddf_fun_t *dev_fun,
-	nic_unicast_mode_t *, size_t, nic_address_t *, size_t *);
+    nic_unicast_mode_t *, size_t, nic_address_t *, size_t *);
 extern int nic_unicast_set_mode_impl(ddf_fun_t *dev_fun,
-	nic_unicast_mode_t, const nic_address_t *, size_t);
+    nic_unicast_mode_t, const nic_address_t *, size_t);
 extern int nic_multicast_get_mode_impl(ddf_fun_t *dev_fun,
-	nic_multicast_mode_t *, size_t, nic_address_t *, size_t *);
+    nic_multicast_mode_t *, size_t, nic_address_t *, size_t *);
 extern int nic_multicast_set_mode_impl(ddf_fun_t *dev_fun,
-	nic_multicast_mode_t, const nic_address_t *, size_t);
+    nic_multicast_mode_t, const nic_address_t *, size_t);
 extern int nic_broadcast_get_mode_impl(ddf_fun_t *, nic_broadcast_mode_t *);
 extern int nic_broadcast_set_mode_impl(ddf_fun_t *, nic_broadcast_mode_t);
 extern int nic_blocked_sources_get_impl(ddf_fun_t *,
-	size_t, nic_address_t *, size_t *);
+    size_t, nic_address_t *, size_t *);
 extern int nic_blocked_sources_set_impl(ddf_fun_t *, const nic_address_t *, size_t);
 extern int nic_vlan_get_mask_impl(ddf_fun_t *, nic_vlan_mask_t *);
 extern int nic_vlan_set_mask_impl(ddf_fun_t *, const nic_vlan_mask_t *);
 extern int nic_wol_virtue_add_impl(ddf_fun_t *dev_fun, nic_wv_type_t type,
-	const void *data, size_t length, nic_wv_id_t *new_id);
+    const void *data, size_t length, nic_wv_id_t *new_id);
 extern int nic_wol_virtue_remove_impl(ddf_fun_t *dev_fun, nic_wv_id_t id);
 extern int nic_wol_virtue_probe_impl(ddf_fun_t *dev_fun, nic_wv_id_t id,
-	nic_wv_type_t *type, size_t max_length, void *data, size_t *length);
+    nic_wv_type_t *type, size_t max_length, void *data, size_t *length);
 extern int nic_wol_virtue_list_impl(ddf_fun_t *dev_fun, nic_wv_type_t type,
-	size_t max_count, nic_wv_id_t *id_list, size_t *id_count);
+    size_t max_count, nic_wv_id_t *id_list, size_t *id_count);
 extern int nic_wol_virtue_get_caps_impl(ddf_fun_t *, nic_wv_type_t, int *);
 extern int nic_poll_get_mode_impl(ddf_fun_t *,
-	nic_poll_mode_t *, struct timeval *);
+    nic_poll_mode_t *, struct timeval *);
 extern int nic_poll_set_mode_impl(ddf_fun_t *,
-	nic_poll_mode_t, const struct timeval *);
+    nic_poll_mode_t, const struct timeval *);
 extern int nic_poll_now_impl(ddf_fun_t *);
 
Index: uspace/lib/nic/src/nic_driver.c
===================================================================
--- uspace/lib/nic/src/nic_driver.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/nic/src/nic_driver.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -79,6 +79,5 @@
 }
 
-/**
- * Fill in the default implementations for device options and NIC interface.
+/** Fill in the default implementations for device options and NIC interface.
  *
  * @param driver_ops
Index: uspace/lib/posix/stdbool.h
===================================================================
--- uspace/lib/posix/stdbool.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/posix/stdbool.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -37,10 +37,12 @@
 
 #ifdef LIBC_BOOL_H_
-#if (!defined(POSIX_STDIO_H_)) \
-		&& (!defined(POSIX_STDLIB_H_)) \
-		&& (!defined(POSIX_STRING_H_))
-#error "You can't include bool.h and stdbool.h at the same time."
+
+#if (!defined(POSIX_STDIO_H_)) && \
+    (!defined(POSIX_STDLIB_H_)) && \
+    (!defined(POSIX_STRING_H_))
+	#error "You can't include bool.h and stdbool.h at the same time."
 #endif
-#endif
+
+#endif /* LIBC_BOOL_H */
 
 #define LIBC_BOOL_H_
Index: uspace/lib/usb/include/usb/ddfiface.h
===================================================================
--- uspace/lib/usb/include/usb/ddfiface.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usb/include/usb/ddfiface.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -33,4 +33,5 @@
  * Implementations of DDF interfaces functions.
  */
+
 #ifndef LIBUSB_DDFIFACE_H_
 #define LIBUSB_DDFIFACE_H_
@@ -39,14 +40,15 @@
 #include <usb_iface.h>
 
-int usb_iface_get_hc_handle_device_impl(ddf_fun_t *, devman_handle_t *);
-int usb_iface_get_my_address_forward_impl(ddf_fun_t *, usb_address_t *);
+extern int usb_iface_get_hc_handle_device_impl(ddf_fun_t *, devman_handle_t *);
+extern int usb_iface_get_my_address_forward_impl(ddf_fun_t *, usb_address_t *);
 extern usb_iface_t usb_iface_hub_impl;
 
-int usb_iface_get_my_address_from_device_data(ddf_fun_t *, usb_address_t *);
+extern int usb_iface_get_my_address_from_device_data(ddf_fun_t *, usb_address_t *);
 extern usb_iface_t usb_iface_hub_child_impl;
 
-int usb_iface_get_hc_handle_hc_impl(ddf_fun_t *, devman_handle_t *);
+extern int usb_iface_get_hc_handle_hc_impl(ddf_fun_t *, devman_handle_t *);
 
 #endif
+
 /**
  * @}
Index: uspace/lib/usb/include/usb/debug.h
===================================================================
--- uspace/lib/usb/include/usb/debug.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usb/include/usb/debug.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -82,7 +82,7 @@
 /** Default log level. */
 #ifdef CONFIG_USB_VERBOSE
-#  define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_DEBUG
+	#define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_DEBUG
 #else
-#  define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_INFO
+	#define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_INFO
 #endif
 
Index: uspace/lib/usb/src/ddfiface.c
===================================================================
--- uspace/lib/usb/src/ddfiface.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usb/src/ddfiface.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -33,4 +33,5 @@
  * Implementations of DDF interfaces functions (actual implementation).
  */
+
 #include <devman.h>
 #include <async.h>
Index: uspace/lib/usb/src/hc.c
===================================================================
--- uspace/lib/usb/src/hc.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usb/src/hc.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -27,4 +27,5 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /** @addtogroup libusb
  * @{
@@ -33,4 +34,5 @@
  * General communication with host controller driver (implementation).
  */
+
 #include <usb/debug.h>
 
@@ -44,4 +46,5 @@
 {
 	assert(connection);
+	
 	fibril_mutex_lock(&connection->guard);
 	if (connection->ref_count == 0) {
@@ -55,12 +58,14 @@
 		}
 	}
+	
 	++connection->ref_count;
 	fibril_mutex_unlock(&connection->guard);
 	return EOK;
 }
-/*----------------------------------------------------------------------------*/
+
 static int usb_hc_connection_del_ref(usb_hc_connection_t *connection)
 {
 	assert(connection);
+	
 	fibril_mutex_lock(&connection->guard);
 	if (connection->ref_count == 0) {
@@ -70,4 +75,5 @@
 		return EOK;
 	}
+	
 	--connection->ref_count;
 	int ret = EOK;
@@ -125,5 +131,5 @@
 	return rc;
 }
-/*----------------------------------------------------------------------------*/
+
 void usb_hc_connection_deinitialize(usb_hc_connection_t *connection)
 {
@@ -140,5 +146,5 @@
 	fibril_mutex_unlock(&connection->guard);
 }
-/*----------------------------------------------------------------------------*/
+
 /** Open connection to host controller.
  *
@@ -150,5 +156,5 @@
 	return usb_hc_connection_add_ref(connection);
 }
-/*----------------------------------------------------------------------------*/
+
 /** Close connection to the host controller.
  *
@@ -160,5 +166,5 @@
 	return usb_hc_connection_del_ref(connection);
 }
-/*----------------------------------------------------------------------------*/
+
 /** Ask host controller for free address assignment.
  *
@@ -182,5 +188,5 @@
 	return ret == EOK ? address : ret;
 }
-/*----------------------------------------------------------------------------*/
+
 int usb_hc_bind_address(usb_hc_connection_t * connection,
     usb_address_t address, devman_handle_t handle)
@@ -194,5 +200,5 @@
 	return ret;
 }
-/*----------------------------------------------------------------------------*/
+
 /** Get handle of USB device with given address.
  *
@@ -213,5 +219,5 @@
 	return ret;
 }
-/*----------------------------------------------------------------------------*/
+
 int usb_hc_release_address(usb_hc_connection_t *connection,
     usb_address_t address)
@@ -225,5 +231,5 @@
 	return ret;
 }
-/*----------------------------------------------------------------------------*/
+
 int usb_hc_register_endpoint(usb_hc_connection_t *connection,
     usb_address_t address, usb_endpoint_t endpoint, usb_transfer_type_t type,
@@ -239,5 +245,5 @@
 	return ret;
 }
-/*----------------------------------------------------------------------------*/
+
 int usb_hc_unregister_endpoint(usb_hc_connection_t *connection,
     usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction)
@@ -252,5 +258,5 @@
 	return ret;
 }
-/*----------------------------------------------------------------------------*/
+
 int usb_hc_read(usb_hc_connection_t *connection, usb_address_t address,
     usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size,
@@ -266,5 +272,5 @@
 	return ret;
 }
-/*----------------------------------------------------------------------------*/
+
 int usb_hc_write(usb_hc_connection_t *connection, usb_address_t address,
     usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size)
Index: uspace/lib/usbdev/include/usb/dev/driver.h
===================================================================
--- uspace/lib/usbdev/include/usb/dev/driver.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usbdev/include/usb/dev/driver.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -33,4 +33,5 @@
  * USB device driver framework.
  */
+
 #ifndef LIBUSBDEV_DRIVER_H_
 #define LIBUSBDEV_DRIVER_H_
Index: uspace/lib/usbdev/include/usb/dev/hub.h
===================================================================
--- uspace/lib/usbdev/include/usb/dev/hub.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usbdev/include/usb/dev/hub.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -35,4 +35,5 @@
  * For class specific requests, see usb/classes/hub.h.
  */
+
 #ifndef LIBUSBDEV_HUB_H_
 #define LIBUSBDEV_HUB_H_
@@ -43,5 +44,5 @@
 #include <usb/hc.h>
 
-int usb_hc_new_device_wrapper(ddf_dev_t *, usb_hc_connection_t *, usb_speed_t,
+extern int usb_hc_new_device_wrapper(ddf_dev_t *, usb_hc_connection_t *, usb_speed_t,
     int (*)(void *), void *, usb_address_t *, ddf_dev_ops_t *, void *,
     ddf_fun_t **);
@@ -60,5 +61,5 @@
 } usb_hub_attached_device_t;
 
-int usb_hub_register_device(usb_hc_connection_t *,
+extern int usb_hub_register_device(usb_hc_connection_t *,
     const usb_hub_attached_device_t *);
 
@@ -69,8 +70,10 @@
 	if (attached_device == NULL)
 		return EBADMEM;
+	
 	return usb_hc_release_address(conn, attached_device->address);
 }
 
 #endif
+
 /**
  * @}
Index: uspace/lib/usbdev/include/usb/dev/recognise.h
===================================================================
--- uspace/lib/usbdev/include/usb/dev/recognise.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usbdev/include/usb/dev/recognise.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -33,4 +33,5 @@
  * USB device recognition.
  */
+
 #ifndef LIBUSBDEV_RECOGNISE_H_
 #define LIBUSBDEV_RECOGNISE_H_
@@ -41,17 +42,18 @@
 #include <ipc/devman.h>
 
-int usb_device_create_match_ids_from_device_descriptor(
+extern int usb_device_create_match_ids_from_device_descriptor(
     const usb_standard_device_descriptor_t *, match_id_list_t *);
 
-int usb_device_create_match_ids_from_interface(
+extern int usb_device_create_match_ids_from_interface(
     const usb_standard_device_descriptor_t *,
     const usb_standard_interface_descriptor_t *, match_id_list_t *);
 
-int usb_device_create_match_ids(usb_pipe_t *, match_id_list_t *);
+extern int usb_device_create_match_ids(usb_pipe_t *, match_id_list_t *);
 
-int usb_device_register_child_in_devman(usb_pipe_t *ctrl_pipe,
+extern int usb_device_register_child_in_devman(usb_pipe_t *ctrl_pipe,
     ddf_dev_t *, ddf_dev_ops_t *, void *, ddf_fun_t **);
 
 #endif
+
 /**
  * @}
Index: uspace/lib/usbdev/src/altiface.c
===================================================================
--- uspace/lib/usbdev/src/altiface.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usbdev/src/altiface.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -33,4 +33,5 @@
  * Handling alternate interface settings.
  */
+
 #include <usb/dev/driver.h>
 #include <usb/dev/request.h>
Index: uspace/lib/usbdev/src/hub.c
===================================================================
--- uspace/lib/usbdev/src/hub.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usbdev/src/hub.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -33,4 +33,5 @@
  * Functions needed by hub drivers.
  */
+
 #include <usb/dev/hub.h>
 #include <usb/dev/pipes.h>
@@ -114,5 +115,4 @@
 	return EOK;
 }
-
 
 /** Wrapper for registering attached device to the hub.
@@ -160,5 +160,5 @@
     ddf_dev_ops_t *dev_ops, void *new_dev_data, ddf_fun_t **new_fun)
 {
-	if (new_fun == NULL || hc_conn == NULL)
+	if ((new_fun == NULL) || (hc_conn == NULL))
 		return EINVAL;
 
Index: uspace/lib/usbdev/src/recognise.c
===================================================================
--- uspace/lib/usbdev/src/recognise.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usbdev/src/recognise.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -33,4 +33,5 @@
  * Functions for recognition of attached devices.
  */
+
 #include <sys/types.h>
 #include <fibril_synch.h>
@@ -311,4 +312,5 @@
  *	will be written.
  * @return Error code.
+ *
  */
 int usb_device_register_child_in_devman(usb_pipe_t *ctrl_pipe,
@@ -318,23 +320,23 @@
 	if (child_fun == NULL || ctrl_pipe == NULL)
 		return EINVAL;
-
+	
 	if (!dev_ops && dev_data) {
 		usb_log_warning("Using standard fun ops with arbitrary "
 		    "driver data. This does not have to work.\n");
 	}
-
+	
 	/** Index to append after device name for uniqueness. */
 	static atomic_t device_name_index = {0};
 	const size_t this_device_name_index =
 	    (size_t) atomic_preinc(&device_name_index);
-
+	
 	ddf_fun_t *child = NULL;
 	int rc;
-
+	
 	/*
 	 * TODO: Once the device driver framework support persistent
 	 * naming etc., something more descriptive could be created.
 	 */
-	char child_name[12]; /* The format is: "usbAB_aXYZ", length 11 */
+	char child_name[12];  /* The format is: "usbAB_aXYZ", length 11 */
 	rc = snprintf(child_name, sizeof(child_name),
 	    "usb%02zu_a%d", this_device_name_index, ctrl_pipe->wire->address);
@@ -342,5 +344,5 @@
 		goto failure;
 	}
-
+	
 	child = ddf_fun_create(parent, fun_inner, child_name);
 	if (child == NULL) {
@@ -348,14 +350,15 @@
 		goto failure;
 	}
-
-	if (dev_ops != NULL) {
+	
+	if (dev_ops != NULL)
 		child->ops = dev_ops;
-	} else {
+	else
 		child->ops = &child_ops;
-	}
-
+	
 	child->driver_data = dev_data;
-	/* Store the attached device in fun driver data if there is no
-	 * other data */
+	/*
+	 * Store the attached device in fun
+	 * driver data if there is no other data
+	 */
 	if (!dev_data) {
 		usb_hub_attached_device_t *new_device = ddf_fun_data_alloc(
@@ -365,36 +368,33 @@
 			goto failure;
 		}
+		
 		new_device->address = ctrl_pipe->wire->address;
 		new_device->fun = child;
 	}
-
-
+	
 	rc = usb_device_create_match_ids(ctrl_pipe, &child->match_ids);
-	if (rc != EOK) {
+	if (rc != EOK)
 		goto failure;
-	}
-
+	
 	rc = ddf_fun_bind(child);
-	if (rc != EOK) {
+	if (rc != EOK)
 		goto failure;
-	}
-
+	
 	*child_fun = child;
 	return EOK;
-
+	
 failure:
 	if (child != NULL) {
 		/* We know nothing about the data if it came from outside. */
-		if (dev_data) {
+		if (dev_data)
 			child->driver_data = NULL;
-		}
+		
 		/* This takes care of match_id deallocation as well. */
 		ddf_fun_destroy(child);
 	}
-
+	
 	return rc;
 }
 
-
 /**
  * @}
Index: uspace/lib/usbhid/src/hidiface.c
===================================================================
--- uspace/lib/usbhid/src/hidiface.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usbhid/src/hidiface.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -33,4 +33,5 @@
  * Client functions for accessing USB HID interface (implementation).
  */
+
 #include <dev_iface.h>
 #include <usbhid_iface.h>
Index: uspace/lib/usbhost/include/usb/host/hcd.h
===================================================================
--- uspace/lib/usbhost/include/usb/host/hcd.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usbhost/include/usb/host/hcd.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -33,4 +33,5 @@
  *
  */
+
 #ifndef LIBUSBHOST_HOST_HCD_H
 #define LIBUSBHOST_HOST_HCD_H
@@ -61,5 +62,5 @@
 	void (*ep_remove_hook)(hcd_t *, endpoint_t *);
 };
-/*----------------------------------------------------------------------------*/
+
 /** Initialize hcd_t structure.
  * Initializes device and endpoint managers. Sets data and hook pointer to NULL.
@@ -79,5 +80,5 @@
 	hcd->ep_remove_hook = NULL;
 }
-/*----------------------------------------------------------------------------*/
+
 /** Check registered endpoints and reset toggle bit if necessary.
  * @param hcd hcd_t structure, non-null.
@@ -92,5 +93,5 @@
 	    &hcd->ep_manager, target, (const uint8_t *)setup_data);
 }
-/*----------------------------------------------------------------------------*/
+
 /** Data retrieve wrapper.
  * @param fun ddf function, non-null.
@@ -102,8 +103,9 @@
 	return fun->driver_data;
 }
-/*----------------------------------------------------------------------------*/
+
 extern usbhc_iface_t hcd_iface;
 
 #endif
+
 /**
  * @}
Index: uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h
===================================================================
--- uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -26,4 +26,5 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /** @addtogroup libusbhost
  * @{
@@ -32,4 +33,5 @@
  * USB transfer transaction structures.
  */
+
 #ifndef LIBUSBHOST_HOST_USB_TRANSFER_BATCH_H
 #define LIBUSBHOST_HOST_USB_TRANSFER_BATCH_H
@@ -115,5 +117,5 @@
 void usb_transfer_batch_finish_error(const usb_transfer_batch_t *instance,
     const void* data, size_t size, int error);
-/*----------------------------------------------------------------------------*/
+
 /** Finish batch using stored error value and transferred size.
  *
@@ -128,5 +130,5 @@
 	    instance, data, instance->transfered_size, instance->error);
 }
-/*----------------------------------------------------------------------------*/
+
 /** Determine batch direction based on the callbacks present
  * @param[in] instance Batch structure to use, non-null.
@@ -153,5 +155,7 @@
 	assert(false);
 }
+
 #endif
+
 /**
  * @}
Index: uspace/lib/usbhost/src/iface.c
===================================================================
--- uspace/lib/usbhost/src/iface.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usbhost/src/iface.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -26,4 +26,5 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
 /** @addtogroup libusbhost
  * @{
@@ -32,4 +33,5 @@
  * @brief HCD DDF interface implementation
  */
+
 #include <ddf/driver.h>
 #include <errno.h>
@@ -98,5 +100,5 @@
 	return ret;
 }
-/*----------------------------------------------------------------------------*/
+
 /** Calls ep_add_hook upon endpoint registration.
  * @param ep Endpoint to be registered.
@@ -113,5 +115,5 @@
 	return EOK;
 }
-/*----------------------------------------------------------------------------*/
+
 /** Calls ep_remove_hook upon endpoint removal.
  * @param ep Endpoint to be unregistered.
@@ -126,5 +128,5 @@
 		hcd->ep_remove_hook(hcd, ep);
 }
-/*----------------------------------------------------------------------------*/
+
 /** Calls ep_remove_hook upon endpoint removal. Prints warning.
  * @param ep Endpoint to be unregistered.
@@ -141,5 +143,5 @@
 		hcd->ep_remove_hook(hcd, ep);
 }
-/*----------------------------------------------------------------------------*/
+
 /** Request address interface function.
  *
@@ -164,5 +166,5 @@
 	    &hcd->dev_manager, address, strict, speed);
 }
-/*----------------------------------------------------------------------------*/
+
 /** Bind address interface function.
  *
@@ -183,5 +185,5 @@
 	    &hcd->dev_manager, address, handle);
 }
-/*----------------------------------------------------------------------------*/
+
 /** Find device handle by address interface function.
  *
@@ -200,5 +202,5 @@
 	    &hcd->dev_manager, address, handle, NULL);
 }
-/*----------------------------------------------------------------------------*/
+
 /** Release address interface function.
  *
@@ -218,5 +220,5 @@
 	return EOK;
 }
-/*----------------------------------------------------------------------------*/
+
 /** Register endpoint interface function.
  * @param fun DDF function.
@@ -254,5 +256,5 @@
 	    register_helper, hcd);
 }
-/*----------------------------------------------------------------------------*/
+
 /** Unregister endpoint interface function.
  * @param fun DDF function.
@@ -274,5 +276,5 @@
 	    endpoint, direction, unregister_helper, hcd);
 }
-/*----------------------------------------------------------------------------*/
+
 /** Inbound communication interface function.
  * @param fun DDF function.
@@ -292,5 +294,5 @@
 	    setup_data, callback, NULL, arg, "READ");
 }
-/*----------------------------------------------------------------------------*/
+
 /** Outbound communication interface function.
  * @param fun DDF function.
@@ -310,5 +312,5 @@
 	    setup_data, NULL, callback, arg, "WRITE");
 }
-/*----------------------------------------------------------------------------*/
+
 /** usbhc Interface implementation using hcd_t from libusbhost library. */
 usbhc_iface_t hcd_iface = {
@@ -324,4 +326,5 @@
 	.write = usb_write,
 };
+
 /**
  * @}
Index: uspace/lib/usbvirt/src/device.c
===================================================================
--- uspace/lib/usbvirt/src/device.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/lib/usbvirt/src/device.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -33,4 +33,5 @@
  * Virtual USB device main routines.
  */
+
 #include <errno.h>
 #include <str.h>
Index: uspace/srv/bd/ata_bd/ata_bd.c
===================================================================
--- uspace/srv/bd/ata_bd/ata_bd.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/bd/ata_bd/ata_bd.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -191,5 +191,5 @@
 	}
 
-	printf(NAME ": Accepting connections\n");
+	printf("%s: Accepting connections\n", NAME);
 	task_retval(0);
 	async_manager();
@@ -243,31 +243,28 @@
 static int ata_bd_init(void)
 {
+	async_set_client_connection(ata_bd_connection);
+	int rc = loc_server_register(NAME);
+	if (rc != EOK) {
+		printf("%s: Unable to register driver.\n", NAME);
+		return rc;
+	}
+	
 	void *vaddr;
-	int rc;
-	
-	async_set_client_connection(ata_bd_connection);
-	rc = loc_server_register(NAME);
-	if (rc < 0) {
-		printf(NAME ": Unable to register driver.\n");
-		return rc;
-	}
-
 	rc = pio_enable((void *) cmd_physical, sizeof(ata_cmd_t), &vaddr);
 	if (rc != EOK) {
-		printf(NAME ": Could not initialize device I/O space.\n");
+		printf("%s: Could not initialize device I/O space.\n", NAME);
 		return rc;
 	}
-
+	
 	cmd = vaddr;
-
+	
 	rc = pio_enable((void *) ctl_physical, sizeof(ata_ctl_t), &vaddr);
 	if (rc != EOK) {
-		printf(NAME ": Could not initialize device I/O space.\n");
+		printf("%s: Could not initialize device I/O space.\n", NAME);
 		return rc;
 	}
-
+	
 	ctl = vaddr;
-
-
+	
 	return EOK;
 }
Index: uspace/srv/bd/file_bd/file_bd.c
===================================================================
--- uspace/srv/bd/file_bd/file_bd.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/bd/file_bd/file_bd.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -119,13 +119,13 @@
 	rc = loc_service_register(device_name, &service_id);
 	if (rc != EOK) {
-		printf(NAME ": Unable to register device '%s'.\n",
-			device_name);
+		printf("%s: Unable to register device '%s'.\n",
+		    NAME, device_name);
 		return rc;
 	}
-
-	printf(NAME ": Accepting connections\n");
+	
+	printf("%s: Accepting connections\n", NAME);
 	task_retval(0);
 	async_manager();
-
+	
 	/* Not reached */
 	return 0;
@@ -139,33 +139,30 @@
 static int file_bd_init(const char *fname)
 {
-	int rc;
-	long img_size;
-	
 	async_set_client_connection(file_bd_connection);
-	rc = loc_server_register(NAME);
-	if (rc < 0) {
-		printf(NAME ": Unable to register driver.\n");
+	int rc = loc_server_register(NAME);
+	if (rc != EOK) {
+		printf("%s: Unable to register driver.\n", NAME);
 		return rc;
 	}
-
+	
 	img = fopen(fname, "rb+");
 	if (img == NULL)
 		return EINVAL;
-
+	
 	if (fseek(img, 0, SEEK_END) != 0) {
 		fclose(img);
 		return EIO;
 	}
-
-	img_size = ftell(img);
+	
+	off64_t img_size = ftell(img);
 	if (img_size < 0) {
 		fclose(img);
 		return EIO;
 	}
-
+	
 	num_blocks = img_size / block_size;
-
+	
 	fibril_mutex_initialize(&dev_lock);
-
+	
 	return EOK;
 }
Index: uspace/srv/bd/gxe_bd/gxe_bd.c
===================================================================
--- uspace/srv/bd/gxe_bd/gxe_bd.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/bd/gxe_bd/gxe_bd.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -122,33 +122,34 @@
 static int gxe_bd_init(void)
 {
+	async_set_client_connection(gxe_bd_connection);
+	int rc = loc_server_register(NAME);
+	if (rc != EOK) {
+		printf("%s: Unable to register driver.\n", NAME);
+		return rc;
+	}
+	
 	void *vaddr;
-	int rc, i;
-	char name[16];
-	
-	async_set_client_connection(gxe_bd_connection);
-	rc = loc_server_register(NAME);
-	if (rc < 0) {
-		printf(NAME ": Unable to register driver.\n");
-		return rc;
-	}
-
 	rc = pio_enable((void *) dev_physical, sizeof(gxe_bd_t), &vaddr);
 	if (rc != EOK) {
-		printf(NAME ": Could not initialize device I/O space.\n");
+		printf("%s: Could not initialize device I/O space.\n", NAME);
 		return rc;
 	}
-
+	
 	dev = vaddr;
-
-	for (i = 0; i < MAX_DISKS; i++) {
-		snprintf(name, 16, "%s/disk%d", NAMESPACE, i);
+	
+	for (unsigned int i = 0; i < MAX_DISKS; i++) {
+		char name[16];
+		
+		snprintf(name, 16, "%s/disk%u", NAMESPACE, i);
 		rc = loc_service_register(name, &service_id[i]);
 		if (rc != EOK) {
-			printf(NAME ": Unable to register device %s.\n", name);
+			printf("%s: Unable to register device %s.\n", NAME,
+			    name);
 			return rc;
 		}
+		
 		fibril_mutex_initialize(&dev_lock[i]);
 	}
-
+	
 	return EOK;
 }
Index: uspace/srv/bd/part/guid_part/guid_part.c
===================================================================
--- uspace/srv/bd/part/guid_part/guid_part.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/bd/part/guid_part/guid_part.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -170,5 +170,5 @@
 		return rc;
 	}
-
+	
 	/*
 	 * Create partition devices.
Index: uspace/srv/bd/rd/rd.c
===================================================================
--- uspace/srv/bd/rd/rd.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/bd/rd/rd.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -237,5 +237,5 @@
 	async_set_client_connection(rd_connection);
 	ret = loc_server_register(NAME);
-	if (ret < 0) {
+	if (ret != EOK) {
 		printf("%s: Unable to register driver (%d)\n", NAME, ret);
 		return false;
Index: uspace/srv/clipboard/clipboard.c
===================================================================
--- uspace/srv/clipboard/clipboard.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/clipboard/clipboard.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -181,7 +181,7 @@
 	
 	async_set_client_connection(clip_connection);
-	
-	if (service_register(SERVICE_CLIPBOARD) != EOK)
-		return -1;
+	int rc = service_register(SERVICE_CLIPBOARD);
+	if (rc != EOK)
+		return rc;
 	
 	printf("%s: Accepting connections\n", NAME);
Index: uspace/srv/devman/devman.h
===================================================================
--- uspace/srv/devman/devman.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/devman/devman.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -210,5 +210,4 @@
 };
 
-
 /** Represents device tree. */
 typedef struct dev_tree {
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/devman/main.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -245,5 +245,5 @@
 	
 	fibril_rwlock_write_lock(&device_tree.rwlock);
-
+	
 	if (fun->state == FUN_ON_LINE) {
 		fibril_rwlock_write_unlock(&device_tree.rwlock);
@@ -259,5 +259,5 @@
 			return ENOMEM;
 		}
-
+		
 		insert_dev_node(&device_tree, dev, fun);
 		dev_add_ref(dev);
@@ -272,4 +272,5 @@
 		/* Give one reference over to assign_driver_fibril(). */
 		dev_add_ref(dev);
+		
 		/*
 		 * Try to find a suitable driver and assign it to the device.  We do
@@ -288,7 +289,6 @@
 		}
 		fibril_add_ready(assign_fibril);
-	} else {
+	} else
 		loc_register_tree_function(fun, &device_tree);
-	}
 	
 	fibril_rwlock_write_unlock(&device_tree.rwlock);
@@ -1149,4 +1149,5 @@
 		if (dev->pfun->dev != NULL)
 			driver = dev->pfun->dev->drv;
+		
 		fwd_h = dev->pfun->handle;
 	} else if (dev->state == DEVICE_USABLE) {
@@ -1154,5 +1155,5 @@
 		driver = dev->drv;
 		assert(driver != NULL);
-
+		
 		fwd_h = handle;
 	}
@@ -1181,9 +1182,9 @@
 
 	if (fun != NULL) {
-		log_msg(LVL_DEBUG, 
+		log_msg(LVL_DEBUG,
 		    "Forwarding request for `%s' function to driver `%s'.",
 		    fun->pathname, driver->name);
 	} else {
-		log_msg(LVL_DEBUG, 
+		log_msg(LVL_DEBUG,
 		    "Forwarding request for `%s' device to driver `%s'.",
 		    dev->pfun->pathname, driver->name);
@@ -1193,8 +1194,9 @@
 	async_forward_fast(iid, exch, method, fwd_h, 0, IPC_FF_NONE);
 	async_exchange_end(exch);
-
+	
 cleanup:
 	if (dev != NULL)
 		dev_del_ref(dev);
+	
 	if (fun != NULL)
 		fun_del_ref(fun);
@@ -1299,7 +1301,7 @@
 		return false;
 	}
-
+	
 	log_msg(LVL_DEBUG, "devman_init - list of drivers has been initialized.");
-
+	
 	/* Create root device node. */
 	if (!init_device_tree(&device_tree, &drivers_list)) {
@@ -1307,5 +1309,5 @@
 		return false;
 	}
-
+	
 	/*
 	 * Caution: As the device manager is not a real loc
@@ -1322,9 +1324,10 @@
 int main(int argc, char *argv[])
 {
-	printf(NAME ": HelenOS Device Manager\n");
-
-	if (log_init(NAME, LVL_WARN) != EOK) {
-		printf(NAME ": Error initializing logging subsystem.\n");
-		return -1;
+	printf("%s: HelenOS Device Manager\n", NAME);
+	
+	int rc = log_init(NAME, LVL_WARN);
+	if (rc != EOK) {
+		printf("%s: Error initializing logging subsystem.\n", NAME);
+		return rc;
 	}
 	
@@ -1333,20 +1336,21 @@
 	async_set_client_data_destructor(devman_client_data_destroy);
 	async_set_client_connection(devman_connection);
-
+	
 	if (!devman_init()) {
 		log_msg(LVL_ERROR, "Error while initializing service.");
 		return -1;
 	}
-
+	
 	/* Register device manager at naming service. */
-	if (service_register(SERVICE_DEVMAN) != EOK) {
+	rc = service_register(SERVICE_DEVMAN);
+	if (rc != EOK) {
 		log_msg(LVL_ERROR, "Failed registering as a service.");
-		return -1;
-	}
-
-	printf(NAME ": Accepting connections.\n");
+		return rc;
+	}
+	
+	printf("%s: Accepting connections.\n", NAME);
 	task_retval(0);
 	async_manager();
-
+	
 	/* Never reached. */
 	return 0;
Index: uspace/srv/hid/console/console.c
===================================================================
--- uspace/srv/hid/console/console.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/hid/console/console.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -827,5 +827,5 @@
 	async_set_client_connection(client_connection);
 	int rc = loc_server_register(NAME);
-	if (rc < 0) {
+	if (rc != EOK) {
 		printf("%s: Unable to register server (%s)\n", NAME,
 		    str_error(rc));
Index: uspace/srv/hid/fb/fb.c
===================================================================
--- uspace/srv/hid/fb/fb.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/hid/fb/fb.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -990,6 +990,6 @@
 	int rc = loc_server_register(NAME);
 	if (rc != EOK) {
-		printf("%s: Unable to register driver (%d)\n", NAME, rc);
-		return 1;
+		printf("%s: Unable to register driver\n", NAME);
+		return rc;
 	}
 	
Index: uspace/srv/hid/input/ctl/kbdev.c
===================================================================
--- uspace/srv/hid/input/ctl/kbdev.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/hid/input/ctl/kbdev.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -68,5 +68,5 @@
 	/** Link to generic keyboard device */
 	kbd_dev_t *kbd_dev;
-
+	
 	/** Session with kbdev device */
 	async_sess_t *sess;
@@ -75,10 +75,8 @@
 static kbdev_t *kbdev_new(kbd_dev_t *kdev)
 {
-	kbdev_t *kbdev;
-
-	kbdev = calloc(1, sizeof(kbdev_t));
+	kbdev_t *kbdev = calloc(1, sizeof(kbdev_t));
 	if (kbdev == NULL)
 		return NULL;
-
+	
 	kbdev->kbd_dev = kdev;
 
@@ -90,4 +88,5 @@
 	if (kbdev->sess != NULL)
 		async_hangup(kbdev->sess);
+	
 	free(kbdev);
 }
@@ -95,35 +94,31 @@
 static int kbdev_ctl_init(kbd_dev_t *kdev)
 {
-	async_sess_t *sess;
-	async_exch_t *exch;
-	kbdev_t *kbdev;
-	int rc;
-
-	sess = loc_service_connect(EXCHANGE_SERIALIZE, kdev->svc_id, 0);
+	async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE,
+	    kdev->svc_id, 0);
 	if (sess == NULL) {
 		printf("%s: Failed starting session with '%s.'\n", NAME,
 		    kdev->svc_name);
-		return -1;
+		return ENOENT;
 	}
-
-	kbdev = kbdev_new(kdev);
+	
+	kbdev_t *kbdev = kbdev_new(kdev);
 	if (kbdev == NULL) {
 		printf("%s: Failed allocating device structure for '%s'.\n",
 		    NAME, kdev->svc_name);
 		async_hangup(sess);
-		return -1;
+		return ENOMEM;
 	}
-
+	
 	kbdev->sess = sess;
-
-	exch = async_exchange_begin(sess);
+	
+	async_exch_t *exch = async_exchange_begin(sess);
 	if (exch == NULL) {
 		printf("%s: Failed starting exchange with '%s'.\n", NAME,
 		    kdev->svc_name);
 		kbdev_destroy(kbdev);
-		return -1;
+		return ENOENT;
 	}
-
-	rc = async_connect_to_me(exch, 0, 0, 0, kbdev_callback_conn, kbdev);
+	
+	int rc = async_connect_to_me(exch, 0, 0, 0, kbdev_callback_conn, kbdev);
 	if (rc != EOK) {
 		printf("%s: Failed creating callback connection from '%s'.\n",
@@ -131,9 +126,9 @@
 		async_exchange_end(exch);
 		kbdev_destroy(kbdev);
-		return -1;
+		return rc;
 	}
-
+	
 	async_exchange_end(exch);
-
+	
 	kdev->ctl_private = (void *) kbdev;
 	return 0;
@@ -142,13 +137,9 @@
 static void kbdev_ctl_set_ind(kbd_dev_t *kdev, unsigned mods)
 {
-	async_sess_t *sess;
-	async_exch_t *exch;
-
-	sess = ((kbdev_t *) kdev->ctl_private)->sess;
-
-	exch = async_exchange_begin(sess);
+	async_sess_t *sess = ((kbdev_t *) kdev->ctl_private)->sess;
+	async_exch_t *exch = async_exchange_begin(sess);
 	if (!exch)
 		return;
-
+	
 	async_msg_1(exch, KBDEV_SET_IND, mods);
 	async_exchange_end(exch);
Index: uspace/srv/hid/input/generic/input.c
===================================================================
--- uspace/srv/hid/input/generic/input.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/hid/input/generic/input.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -662,7 +662,7 @@
 	async_set_client_connection(client_connection);
 	int rc = loc_server_register(NAME);
-	if (rc < 0) {
-		printf("%s: Unable to register server (%d)\n", NAME, rc);
-		return -1;
+	if (rc != EOK) {
+		printf("%s: Unable to register server\n", NAME);
+		return rc;
 	}
 	
@@ -671,7 +671,8 @@
 	
 	service_id_t service_id;
-	if (loc_service_register(kbd, &service_id) != EOK) {
+	rc = loc_service_register(kbd, &service_id);
+	if (rc != EOK) {
 		printf("%s: Unable to register service %s\n", NAME, kbd);
-		return -1;
+		return rc;
 	}
 	
Index: uspace/srv/hid/input/port/adb.c
===================================================================
--- uspace/srv/hid/input/port/adb.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/hid/input/port/adb.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -65,12 +65,9 @@
 static int adb_port_init(kbd_dev_t *kdev)
 {
+	kbd_dev = kdev;
+	
 	const char *dev = "adb/kbd";
 	service_id_t service_id;
-	async_exch_t *exch;
-	int rc;
-	
-	kbd_dev = kdev;
-	
-	rc = loc_service_get_id(dev, &service_id, 0);
+	int rc = loc_service_get_id(dev, &service_id, 0);
 	if (rc != EOK)
 		return rc;
@@ -82,5 +79,5 @@
 	}
 	
-	exch = async_exchange_begin(dev_sess);
+	async_exch_t *exch = async_exchange_begin(dev_sess);
 	if (exch == NULL) {
 		printf("%s: Failed starting exchange with device\n", NAME);
@@ -89,5 +86,4 @@
 	}
 	
-	/* NB: The callback connection is slotted for removal */
 	rc = async_connect_to_me(exch, 0, 0, 0, kbd_port_events, NULL);
 	async_exchange_end(exch);
Index: uspace/srv/hid/input/proto/mousedev.c
===================================================================
--- uspace/srv/hid/input/proto/mousedev.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/hid/input/proto/mousedev.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -117,5 +117,5 @@
 		printf("%s: Failed starting session with '%s'\n", NAME,
 		    mdev->svc_name);
-		return -1;
+		return ENOENT;
 	}
 	
@@ -125,5 +125,5 @@
 		    NAME, mdev->svc_name);
 		async_hangup(sess);
-		return -1;
+		return ENOMEM;
 	}
 	
@@ -134,5 +134,5 @@
 		mousedev_destroy(mousedev);
 		async_hangup(sess);
-		return -1;
+		return ENOENT;
 	}
 	
@@ -145,8 +145,8 @@
 		    NAME, mdev->svc_name);
 		mousedev_destroy(mousedev);
-		return -1;
+		return rc;
 	}
 	
-	return 0;
+	return EOK;
 }
 
Index: uspace/srv/hid/remcons/remcons.c
===================================================================
--- uspace/srv/hid/remcons/remcons.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/hid/remcons/remcons.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -71,4 +71,5 @@
 	TELNET_IAC, TELNET_WONT, TELNET_LINEMODE
 };
+
 static const size_t telnet_force_character_mode_command_count =
     sizeof(telnet_force_character_mode_command) / sizeof(telnet_cmd_t);
@@ -272,8 +273,7 @@
 static int network_user_fibril(void *arg)
 {
-	int rc;
 	telnet_user_t *user = arg;
 
-	rc = loc_service_register(user->service_name, &user->service_id);
+	int rc = loc_service_register(user->service_name, &user->service_id);
 	if (rc != EOK) {
 		telnet_user_error(user, "Unable to register %s with loc: %s.",
@@ -284,9 +284,9 @@
 	telnet_user_log(user, "Service %s registerd with id %" PRIun ".",
 	    user->service_name, user->service_id);
-
+	
 	fid_t spawn_fibril = fibril_create(spawn_task_fibril, user);
 	assert(spawn_fibril);
 	fibril_add_ready(spawn_fibril);
-
+	
 	/* Wait for all clients to exit. */
 	fibril_mutex_lock(&user->guard);
@@ -304,5 +304,5 @@
 	}
 	fibril_mutex_unlock(&user->guard);
-
+	
 	rc = loc_service_unregister(user->service_id);
 	if (rc != EOK) {
@@ -324,15 +324,14 @@
 	async_set_client_connection(client_connection);
 	int rc = loc_server_register(NAME);
-	if (rc < 0) {
-		fprintf(stderr, NAME ": Unable to register server: %s.\n",
-		    str_error(rc));
-		return 1;
-	}
-
+	if (rc != EOK) {
+		fprintf(stderr, "%s: Unable to register server\n", NAME);
+		return rc;
+	}
+	
 	struct sockaddr_in addr;
-
+	
 	addr.sin_family = AF_INET;
 	addr.sin_port = htons(port);
-
+	
 	rc = inet_pton(AF_INET, "127.0.0.1", (void *)
 	    &addr.sin_addr.s_addr);
Index: uspace/srv/hid/remcons/telnet.h
===================================================================
--- uspace/srv/hid/remcons/telnet.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/hid/remcons/telnet.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -57,5 +57,4 @@
 #define TELNET_LINEMODE 34
 
-
 #endif
 
Index: uspace/srv/hid/remcons/user.h
===================================================================
--- uspace/srv/hid/remcons/user.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/hid/remcons/user.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -76,24 +76,26 @@
 } telnet_user_t;
 
-telnet_user_t *telnet_user_create(int socket);
-void telnet_user_destroy(telnet_user_t *user);
-telnet_user_t *telnet_user_get_for_client_connection(service_id_t id);
-bool telnet_user_is_zombie(telnet_user_t *user);
-void telnet_user_notify_client_disconnected(telnet_user_t *user);
-int telnet_user_get_next_keyboard_event(telnet_user_t *user, kbd_event_t *event);
-int telnet_user_send_data(telnet_user_t *user, uint8_t *data, size_t size);
-void telnet_user_update_cursor_x(telnet_user_t *user, int new_x);
+extern telnet_user_t *telnet_user_create(int);
+extern void telnet_user_destroy(telnet_user_t *);
+extern telnet_user_t *telnet_user_get_for_client_connection(service_id_t);
+extern bool telnet_user_is_zombie(telnet_user_t *);
+extern void telnet_user_notify_client_disconnected(telnet_user_t *);
+extern int telnet_user_get_next_keyboard_event(telnet_user_t *, kbd_event_t *);
+extern int telnet_user_send_data(telnet_user_t *, uint8_t *, size_t);
+extern void telnet_user_update_cursor_x(telnet_user_t *, int);
 
 /** Print informational message about connected user. */
 #ifdef CONFIG_DEBUG
 #define telnet_user_log(user, fmt, ...) \
-	printf(NAME " [console %d (%d)]: " fmt "\n", user->id, (int) user->service_id, ##__VA_ARGS__)
+	printf(NAME " [console %d (%d)]: " fmt "\n", \
+	    user->id, (int) user->service_id, ##__VA_ARGS__)
 #else
-#define telnet_user_log(user, fmt, ...) (void)0
+#define telnet_user_log(user, fmt, ...) ((void) 0)
 #endif
 
 /** Print error message associated with connected user. */
 #define telnet_user_error(user, fmt, ...) \
-	fprintf(stderr, NAME " [console %d (%d)]: ERROR: " fmt "\n", user->id, (int) user->service_id, ##__VA_ARGS__)
+	fprintf(stderr, NAME " [console %d (%d)]: ERROR: " fmt "\n", \
+	    user->id, (int) user->service_id, ##__VA_ARGS__)
 
 #endif
Index: uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
===================================================================
--- uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -84,13 +84,11 @@
 int main(int argc, char *argv[])
 {
-	int rc;
-
-	printf(NAME ": S3C24xx touchscreen driver\n");
+	printf("%s: S3C24xx touchscreen driver\n", NAME);
 	
 	async_set_client_connection(s3c24xx_ts_connection);
-	rc = loc_server_register(NAME);
-	if (rc < 0) {
-		printf(NAME ": Unable to register driver.\n");
-		return -1;
+	int rc = loc_server_register(NAME);
+	if (rc != EOK) {
+		printf("%s: Unable to register driver.\n", NAME);
+		return rc;
 	}
 
Index: uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
===================================================================
--- uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -77,13 +77,11 @@
 int main(int argc, char *argv[])
 {
-	int rc;
-
-	printf(NAME ": S3C24xx on-chip UART driver\n");
-
+	printf("%s: S3C24xx on-chip UART driver\n", NAME);
+	
 	async_set_client_connection(s3c24xx_uart_connection);
-	rc = loc_server_register(NAME);
-	if (rc < 0) {
-		printf(NAME ": Unable to register server.\n");
-		return -1;
+	int rc = loc_server_register(NAME);
+	if (rc != EOK) {
+		printf("%s: Unable to register server.\n", NAME);
+		return rc;
 	}
 
Index: uspace/srv/loader/main.c
===================================================================
--- uspace/srv/loader/main.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/loader/main.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -450,9 +450,10 @@
 	int rc = ns_intro(id);
 	if (rc != EOK)
-		return -1;
+		return rc;
 	
 	/* Register at naming service. */
-	if (service_register(SERVICE_LOAD) != EOK)
-		return -2;
+	rc = service_register(SERVICE_LOAD);
+	if (rc != EOK)
+		return rc;
 	
 	async_manager();
Index: uspace/srv/locsrv/locsrv.c
===================================================================
--- uspace/srv/locsrv/locsrv.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/locsrv/locsrv.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -390,5 +390,4 @@
 	 */
 	list_initialize(&server->services);
-
 	link_initialize(&server->servers);
 	
@@ -1490,6 +1489,7 @@
 	
 	/* Register location service at naming service */
-	if (service_register(SERVICE_LOC) != EOK)
-		return -1;
+	int rc = service_register(SERVICE_LOC);
+	if (rc != EOK)
+		return rc;
 	
 	printf("%s: Accepting connections\n", NAME);
Index: uspace/srv/locsrv/locsrv.h
===================================================================
--- uspace/srv/locsrv/locsrv.h	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/locsrv/locsrv.h	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -86,18 +86,26 @@
 	/** Link to global list of services (services_list) */
 	link_t services;
+	
 	/** Link to server list of services (loc_server_t.services) */
 	link_t server_services;
+	
 	/** Link to list of services in category (category_t.services) */
 	link_t cat_services;
+	
 	/** List of category memberships (svc_categ_t) */
 	list_t cat_memb;
+	
 	/** Unique service identifier */
 	service_id_t id;
+	
 	/** Service namespace */
 	loc_namespace_t *namespace;
+	
 	/** Service name */
 	char *name;
+	
 	/** Supplier of this service */
 	loc_server_t *server;
+	
 	/** Use this interface when forwarding to server. */
 	sysarg_t forward_interface;
Index: uspace/srv/net/ethip/ethip.c
===================================================================
--- uspace/srv/net/ethip/ethip.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/net/ethip/ethip.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -73,18 +73,16 @@
 static int ethip_init(void)
 {
-	int rc;
-
 	async_set_client_connection(ethip_client_conn);
-
-	rc = loc_server_register(NAME);
+	
+	int rc = loc_server_register(NAME);
 	if (rc != EOK) {
 		log_msg(LVL_ERROR, "Failed registering server.");
 		return rc;
 	}
-
+	
 	rc = ethip_nic_discovery_start();
 	if (rc != EOK)
 		return rc;
-
+	
 	return EOK;
 }
Index: uspace/srv/net/ethip/ethip_nic.c
===================================================================
--- uspace/srv/net/ethip/ethip_nic.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/net/ethip/ethip_nic.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -150,20 +150,18 @@
 static int ethip_nic_open(service_id_t sid)
 {
-	ethip_nic_t *nic;
-	int rc;
 	bool in_list = false;
 	nic_address_t nic_address;
-
+	
 	log_msg(LVL_DEBUG, "ethip_nic_open()");
-	nic = ethip_nic_new();
+	ethip_nic_t *nic = ethip_nic_new();
 	if (nic == NULL)
 		return ENOMEM;
-
-	rc = loc_service_get_name(sid, &nic->svc_name);
+	
+	int rc = loc_service_get_name(sid, &nic->svc_name);
 	if (rc != EOK) {
 		log_msg(LVL_ERROR, "Failed getting service name.");
 		goto error;
 	}
-
+	
 	nic->sess = loc_service_connect(EXCHANGE_SERIALIZE, sid, 0);
 	if (nic->sess == NULL) {
@@ -171,7 +169,7 @@
 		goto error;
 	}
-
+	
 	nic->svc_id = sid;
-
+	
 	rc = nic_callback_create(nic->sess, ethip_nic_cb_conn, nic);
 	if (rc != EOK) {
@@ -298,7 +296,5 @@
 int ethip_nic_discovery_start(void)
 {
-	int rc;
-
-	rc = loc_register_cat_change_cb(ethip_nic_cat_change_cb);
+	int rc = loc_register_cat_change_cb(ethip_nic_cat_change_cb);
 	if (rc != EOK) {
 		log_msg(LVL_ERROR, "Failed registering callback for NIC "
@@ -306,5 +302,5 @@
 		return rc;
 	}
-
+	
 	return ethip_nic_check_new();
 }
Index: uspace/srv/net/inetsrv/inetsrv.c
===================================================================
--- uspace/srv/net/inetsrv/inetsrv.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/net/inetsrv/inetsrv.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -66,17 +66,15 @@
 static int inet_init(void)
 {
-	service_id_t sid;
-	int rc;
-
 	log_msg(LVL_DEBUG, "inet_init()");
-
+	
 	async_set_client_connection(inet_client_conn);
-
-	rc = loc_server_register(NAME);
+	
+	int rc = loc_server_register(NAME);
 	if (rc != EOK) {
 		log_msg(LVL_ERROR, "Failed registering server (%d).", rc);
 		return EEXIST;
 	}
-
+	
+	service_id_t sid;
 	rc = loc_service_register_with_iface(SERVICE_NAME_INET, &sid,
 	    INET_PORT_DEFAULT);
@@ -85,5 +83,5 @@
 		return EEXIST;
 	}
-
+	
 	rc = loc_service_register_with_iface(SERVICE_NAME_INETCFG, &sid,
 	    INET_PORT_CFG);
@@ -92,5 +90,5 @@
 		return EEXIST;
 	}
-
+	
 	rc = loc_service_register_with_iface(SERVICE_NAME_INETPING, &sid,
 	    INET_PORT_PING);
@@ -99,9 +97,9 @@
 		return EEXIST;
 	}
-
+	
 	rc = inet_link_discovery_start();
 	if (rc != EOK)
 		return EEXIST;
-
+	
 	return EOK;
 }
Index: uspace/srv/net/loopip/loopip.c
===================================================================
--- uspace/srv/net/loopip/loopip.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/net/loopip/loopip.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -91,7 +91,7 @@
 	category_id_t iplink_cat;
 	const char *svc_name = "net/loopback";
-
+	
 	async_set_client_connection(loopip_client_conn);
-
+	
 	rc = loc_server_register(NAME);
 	if (rc != EOK) {
Index: uspace/srv/net/tcp/sock.c
===================================================================
--- uspace/srv/net/tcp/sock.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/net/tcp/sock.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -68,14 +68,12 @@
 int tcp_sock_init(void)
 {
-	int rc;
-
 	socket_ports_initialize(&gsock);
-
+	
 	async_set_client_connection(tcp_sock_connection);
-
-	rc = service_register(SERVICE_TCP);
+	
+	int rc = service_register(SERVICE_TCP);
 	if (rc != EOK)
 		return EEXIST;
-
+	
 	return EOK;
 }
Index: uspace/srv/net/udp/sock.c
===================================================================
--- uspace/srv/net/udp/sock.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/net/udp/sock.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -66,14 +66,12 @@
 int udp_sock_init(void)
 {
-	int rc;
-
 	socket_ports_initialize(&gsock);
-
+	
 	async_set_client_connection(udp_sock_connection);
-
-	rc = service_register(SERVICE_UDP);
+	
+	int rc = service_register(SERVICE_UDP);
 	if (rc != EOK)
 		return EEXIST;
-
+	
 	return EOK;
 }
Index: uspace/srv/ns/ns.c
===================================================================
--- uspace/srv/ns/ns.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/ns/ns.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -48,5 +48,5 @@
 int main(int argc, char **argv)
 {
-	printf(NAME ": HelenOS IPC Naming Service\n");
+	printf("%s: HelenOS IPC Naming Service\n", NAME);
 	
 	int rc = service_init();
Index: uspace/srv/vfs/vfs.c
===================================================================
--- uspace/srv/vfs/vfs.c	(revision 11b9ad7655dbecb81e5f452a36742fdc3849b9c7)
+++ uspace/srv/vfs/vfs.c	(revision 520acaf919bc5eaa42052f07a1276495bf0eada1)
@@ -159,5 +159,5 @@
 int main(int argc, char **argv)
 {
-	printf(NAME ": HelenOS VFS server\n");
+	printf("%s: HelenOS VFS server\n", NAME);
 	
 	/*
@@ -165,5 +165,6 @@
 	 */
 	if (!vfs_nodes_init()) {
-		printf(NAME ": Failed to initialize VFS node hash table\n");
+		printf("%s: Failed to initialize VFS node hash table\n",
+		    NAME);
 		return ENOMEM;
 	}
@@ -175,5 +176,5 @@
 	    AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE);
 	if (plb == (void *) -1) {
-		printf(NAME ": Cannot create address space area\n");
+		printf("%s: Cannot create address space area\n", NAME);
 		return ENOMEM;
 	}
@@ -196,11 +197,12 @@
 	async_set_interrupt_received(notification_received);
 	event_task_subscribe(EVENT_TASK_STATE_CHANGE, VFS_TASK_STATE_CHANGE);
-
+	
 	/*
 	 * Register at the naming service.
 	 */
-	if (service_register(SERVICE_VFS) != EOK) {
+	int rc = service_register(SERVICE_VFS);
+	if (rc != EOK) {
 		printf("%s: Cannot register VFS service\n", NAME);
-		return EINVAL;
+		return rc;
 	}
 	
@@ -208,5 +210,5 @@
 	 * Start accepting connections.
 	 */
-	printf(NAME ": Accepting connections\n");
+	printf("%s: Accepting connections\n", NAME);
 	async_manager();
 	return 0;
