Index: uspace/lib/drv/generic/dev_iface.c
===================================================================
--- uspace/lib/drv/generic/dev_iface.c	(revision a79d88da204957831a1715d66a6d80828c09d5c1)
+++ uspace/lib/drv/generic/dev_iface.c	(revision 7a252ec898ad0b08c9e132a962b2d137a40b6be2)
@@ -35,9 +35,9 @@
 /** @file
  */
- 
+
 #include "dev_iface.h"
 #include "remote_res.h"
 #include "remote_char.h"
- 
+
 static iface_dipatch_table_t remote_ifaces = {
 	.ifaces = {
@@ -49,9 +49,10 @@
 remote_iface_t* get_remote_iface(int idx)
 {	
-	assert(is_valid_iface_idx(idx));	
-	return remote_ifaces.ifaces[idx];	
+	assert(is_valid_iface_idx(idx));
+	return remote_ifaces.ifaces[idx];
 }
 
-remote_iface_func_ptr_t get_remote_method(remote_iface_t *rem_iface, ipcarg_t iface_method_idx)
+remote_iface_func_ptr_t
+get_remote_method(remote_iface_t *rem_iface, ipcarg_t iface_method_idx)
 {
 	if (iface_method_idx >= rem_iface->method_count) {
@@ -60,7 +61,5 @@
 	return rem_iface->methods[iface_method_idx];
 }
- 
- 
- 
+
 /**
  * @}
Index: uspace/lib/drv/generic/driver.c
===================================================================
--- uspace/lib/drv/generic/driver.c	(revision a79d88da204957831a1715d66a6d80828c09d5c1)
+++ uspace/lib/drv/generic/driver.c	(revision 7a252ec898ad0b08c9e132a962b2d137a40b6be2)
@@ -53,14 +53,14 @@
 #include "driver.h"
 
-// driver structure 
+/* driver structure */
 
 static driver_t *driver;
 
-// devices
+/* devices */
 
 LIST_INITIALIZE(devices);
 FIBRIL_MUTEX_INITIALIZE(devices_mutex);
 
-// interrupts 
+/* interrupts */
 
 static interrupt_context_list_t interrupt_contexts;
@@ -79,13 +79,16 @@
 
 static void driver_irq_handler(ipc_callid_t iid, ipc_call_t *icall)
-{	
+{
 	int id = (int)IPC_GET_METHOD(*icall);
-	interrupt_context_t *ctx = find_interrupt_context_by_id(&interrupt_contexts, id);
-	if (NULL != ctx && NULL != ctx->handler) {
-		(*ctx->handler)(ctx->dev, iid, icall);		
-	}
-}
-
-int register_interrupt_handler(device_t *dev, int irq, interrupt_handler_t *handler, irq_code_t *pseudocode)
+	interrupt_context_t *ctx;
+	
+	ctx = find_interrupt_context_by_id(&interrupt_contexts, id);
+	if (NULL != ctx && NULL != ctx->handler)
+		(*ctx->handler)(ctx->dev, iid, icall);
+}
+
+int
+register_interrupt_handler(device_t *dev, int irq, interrupt_handler_t *handler,
+    irq_code_t *pseudocode)
 {
 	interrupt_context_t *ctx = create_interrupt_context();
@@ -97,7 +100,6 @@
 	add_interrupt_context(&interrupt_contexts, ctx);
 	
-	if (NULL == pseudocode) {
+	if (NULL == pseudocode)
 		pseudocode = &default_pseudocode;
-	}
 	
 	int res = ipc_register_irq(irq, dev->handle, ctx->id, pseudocode);
@@ -106,14 +108,17 @@
 		delete_interrupt_context(ctx);
 	}
-	return res;	
+
+	return res;
 }
 
 int unregister_interrupt_handler(device_t *dev, int irq)
 {
-	interrupt_context_t *ctx = find_interrupt_context(&interrupt_contexts, dev, irq);
+	interrupt_context_t *ctx = find_interrupt_context(&interrupt_contexts,
+	    dev, irq);
 	int res = ipc_unregister_irq(irq, dev->handle);
+
 	if (NULL != ctx) {
 		remove_interrupt_context(&interrupt_contexts, ctx);
-		delete_interrupt_context(ctx);		
+		delete_interrupt_context(ctx);
 	}
 	return res;
@@ -138,5 +143,5 @@
 	device_t *dev = NULL;
 	
-	fibril_mutex_lock(&devices_mutex);	
+	fibril_mutex_lock(&devices_mutex);
 	link_t *link = devices->next;
 	while (link != devices) {
@@ -162,15 +167,17 @@
 	dev->handle = dev_handle;
 	
-	async_data_write_accept((void **)&dev_name, true, 0, 0, 0, 0);
+	async_data_write_accept((void **) &dev_name, true, 0, 0, 0, 0);
 	dev->name = dev_name;
 	
-	add_to_devices_list(dev);		
+	add_to_devices_list(dev);
 	res = driver->driver_ops->add_device(dev);
 	if (0 == res) {
-		printf("%s: new device with handle = %x was added.\n", driver->name, dev_handle);
+		printf("%s: new device with handle = %x was added.\n",
+		    driver->name, dev_handle);
 	} else {
-		printf("%s: failed to add a new device with handle = %d.\n", driver->name, dev_handle);	
+		printf("%s: failed to add a new device with handle = %d.\n",
+		    driver->name, dev_handle);
 		remove_from_devices_list(dev);
-		delete_device(dev);	
+		delete_device(dev);
 	}
 	
@@ -205,14 +212,19 @@
  * Generic client connection handler both for applications and drivers.
  *
- * @param drv true for driver client, false for other clients (applications, services etc.).
+ * @param drv		True for driver client, false for other clients
+ *			(applications, services etc.).
  */
 static void driver_connection_gen(ipc_callid_t iid, ipc_call_t *icall, bool drv)
 {
-	// Answer the first IPC_M_CONNECT_ME_TO call and remember the handle of the device to which the client connected.
+	/*
+	 * Answer the first IPC_M_CONNECT_ME_TO call and remember the handle of
+	 * the device to which the client connected.
+	 */
 	device_handle_t handle = IPC_GET_ARG2(*icall);
 	device_t *dev = driver_get_device(&devices, handle);
 
 	if (dev == NULL) {
-		printf("%s: driver_connection_gen error - no device with handle %x was found.\n", driver->name, handle);
+		printf("%s: driver_connection_gen error - no device with handle"
+		    " %x was found.\n", driver->name, handle);
 		ipc_answer_0(iid, ENOENT);
 		return;
@@ -220,16 +232,17 @@
 	
 	
-	// TODO - if the client is not a driver, check whether it is allowed to use the device
+	/*
+	 * TODO - if the client is not a driver, check whether it is allowed to
+	 * use the device.
+	 */
 
 	int ret = EOK;
-	// open the device
-	if (NULL != dev->ops && NULL != dev->ops->open) {
+	/* open the device */
+	if (NULL != dev->ops && NULL != dev->ops->open)
 		ret = (*dev->ops->open)(dev);
-	}
 	
 	ipc_answer_0(iid, ret);	
-	if (EOK != ret) {
+	if (EOK != ret)
 		return;
-	}
 
 	while (1) {
@@ -242,55 +255,70 @@
 		switch  (method) {
 		case IPC_M_PHONE_HUNGUP:		
-			// close the device
-			if (NULL != dev->ops && NULL != dev->ops->close) {
+			/* close the device */
+			if (NULL != dev->ops && NULL != dev->ops->close)
 				(*dev->ops->close)(dev);
-			}			
 			ipc_answer_0(callid, EOK);
 			return;
 		default:		
-			// convert ipc interface id to interface index
+			/* convert ipc interface id to interface index */
 			
 			iface_idx = DEV_IFACE_IDX(method);
 			
 			if (!is_valid_iface_idx(iface_idx)) {
-				remote_handler_t *default_handler;
-				if (NULL != (default_handler = device_get_default_handler(dev))) {
+				remote_handler_t *default_handler =
+				    device_get_default_handler(dev);
+				if (NULL != default_handler) {
 					(*default_handler)(dev, callid, &call);
 					break;
 				}
-				// this is not device's interface and the default handler is not provided
-				printf("%s: driver_connection_gen error - invalid interface id %d.", driver->name, iface_idx);
+				/*
+				 * This is not device's interface and the
+				 * default handler is not provided.
+				 */
+				printf("%s: driver_connection_gen error - "
+				    "invalid interface id %d.",
+				    driver->name, iface_idx);
 				ipc_answer_0(callid, ENOTSUP);
 				break;
 			}
 
-			// calling one of the device's interfaces
+			/* calling one of the device's interfaces */
 			
-			// get the device interface structure
+			/* get the device interface structure */
 			void *iface = device_get_iface(dev, iface_idx);
 			if (NULL == iface) {
-				printf("%s: driver_connection_gen error - ", driver->name);
-				printf("device with handle %d has no interface with id %d.\n", handle, iface_idx);
+				printf("%s: driver_connection_gen error - ",
+				    driver->name);
+				printf("device with handle %d has no interface "
+				    "with id %d.\n", handle, iface_idx);
 				ipc_answer_0(callid, ENOTSUP);
 				break;
 			}
 
-			// get the corresponding interface for remote request handling ("remote interface")
+			/*
+			 * Get the corresponding interface for remote request
+			 * handling ("remote interface").
+			 */
 			remote_iface_t* rem_iface = get_remote_iface(iface_idx);
 			assert(NULL != rem_iface);
 
-			// get the method of the remote interface
+			/* get the method of the remote interface */
 			ipcarg_t iface_method_idx = IPC_GET_ARG1(call);
-			remote_iface_func_ptr_t iface_method_ptr = get_remote_method(rem_iface, iface_method_idx);
+			remote_iface_func_ptr_t iface_method_ptr =
+			    get_remote_method(rem_iface, iface_method_idx);
 			if (NULL == iface_method_ptr) {
 				// the interface has not such method
-				printf("%s: driver_connection_gen error - invalid interface method.", driver->name);
+				printf("%s: driver_connection_gen error - "
+				    "invalid interface method.", driver->name);
 				ipc_answer_0(callid, ENOTSUP);
 				break;
 			}
 			
-			// call the remote interface's method, which will receive parameters from the remote client
-			// and it will pass it to the corresponding local interface method associated with the device 
-			// by its driver
+			/*
+			 * Call the remote interface's method, which will
+			 * receive parameters from the remote client and it will
+			 * pass it to the corresponding local interface method
+			 * associated with the device by its driver.
+			 */
 			(*iface_method_ptr)(dev, iface, callid, &call);
 			break;
@@ -310,7 +338,5 @@
 
 
-/** Function for handling connections to device driver.
- *
- */
+/** Function for handling connections to device driver. */
 static void driver_connection(ipc_callid_t iid, ipc_call_t *icall)
 {
@@ -318,13 +344,13 @@
 	switch ((ipcarg_t) (IPC_GET_ARG1(*icall))) {
 	case DRIVER_DEVMAN:
-		// handle PnP events from device manager
+		/* handle PnP events from device manager */
 		driver_connection_devman(iid, icall);
 		break;
 	case DRIVER_DRIVER:
-		// handle request from drivers of child devices
+		/* handle request from drivers of child devices */
 		driver_connection_driver(iid, icall);
 		break;
 	case DRIVER_CLIENT:
-		// handle requests from client applications
+		/* handle requests from client applications */
 		driver_connection_client(iid, icall);
 		break;
@@ -338,6 +364,4 @@
 int child_device_register(device_t *child, device_t *parent)
 {
-	// printf("%s: child_device_register\n", driver->name);
-
 	assert(NULL != child->name);
 
@@ -345,7 +369,8 @@
 	
 	add_to_devices_list(child);
-	if (EOK == (res = devman_child_device_register(child->name, &child->match_ids, parent->handle, &child->handle))) {
+	res = devman_child_device_register(child->name, &child->match_ids,
+	    parent->handle, &child->handle);
+	if (EOK == res)
 		return res;
-	}
 	remove_from_devices_list(child);	
 	return res;
@@ -354,19 +379,25 @@
 int driver_main(driver_t *drv)
 {
-	// remember the driver structure - driver_ops will be called by generic handler for incoming connections
+	/*
+	 * Remember the driver structure - driver_ops will be called by generic
+	 * handler for incoming connections.
+	 */
 	driver = drv;
 
-	// initialize the list of interrupt contexts
+	/* Initialize the list of interrupt contexts. */
 	init_interrupt_context_list(&interrupt_contexts);
 	
-	// set generic interrupt handler
+	/* Set generic interrupt handler. */
 	async_set_interrupt_received(driver_irq_handler);
 	
-	// register driver by device manager with generic handler for incoming connections
+	/*
+	 * Register driver by device manager with generic handler for incoming
+	 * connections.
+	 */
 	devman_driver_register(driver->name, driver_connection);
 
 	async_manager();
 
-	// Never reached
+	/* Never reached. */
 	return 0;
 }
Index: uspace/lib/drv/generic/remote_char.c
===================================================================
--- uspace/lib/drv/generic/remote_char.c	(revision a79d88da204957831a1715d66a6d80828c09d5c1)
+++ uspace/lib/drv/generic/remote_char.c	(revision 7a252ec898ad0b08c9e132a962b2d137a40b6be2)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2010 Lenka Trochtova 
+ * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
  *
@@ -42,38 +42,43 @@
 #define MAX_CHAR_RW_COUNT 256
 
-static void remote_char_read(device_t *dev, void *iface, ipc_callid_t callid, ipc_call_t *call);
-static void remote_char_write(device_t *dev, void *iface, ipc_callid_t callid, ipc_call_t *call);
+static void remote_char_read(device_t *, void *, ipc_callid_t, ipc_call_t *);
+static void remote_char_write(device_t *, void *, ipc_callid_t, ipc_call_t *);
 
-/** Remote character interface operations. 
- */
+/** Remote character interface operations. */
 static remote_iface_func_ptr_t remote_char_iface_ops [] = {
 	&remote_char_read,
-	&remote_char_write	
-}; 
- 
-/** Remote character interface structure. 
- * Interface for processing request from remote clients addressed to the character interface.
+	&remote_char_write
+};
+
+/** Remote character interface structure.
+ *
+ * Interface for processing request from remote clients addressed to the
+ * character interface.
  */
 remote_iface_t remote_char_iface = {
-	.method_count = sizeof(remote_char_iface_ops) / sizeof(remote_iface_func_ptr_t),
+	.method_count = sizeof(remote_char_iface_ops) /
+	    sizeof(remote_iface_func_ptr_t),
 	.methods = remote_char_iface_ops
 };
 
 /** Process the read request from the remote client.
- * 
- * Receive the read request's parameters from the remote client and pass them to the local interface.
- * Return the result of the operation processed by the local interface to the remote client.
- * 
- * @param dev the device from which the data are read.
- * @param iface the local interface structure. 
+ *
+ * Receive the read request's parameters from the remote client and pass them
+ * to the local interface. Return the result of the operation processed by the
+ * local interface to the remote client.
+ *
+ * @param dev		The device from which the data are read.
+ * @param iface		The local interface structure.
  */
-static void remote_char_read(device_t *dev, void *iface, ipc_callid_t callid, ipc_call_t *call)
+static void
+remote_char_read(device_t *dev, void *iface, ipc_callid_t callid,
+    ipc_call_t *call)
 {	
-	char_iface_t *char_iface = (char_iface_t *)iface;
+	char_iface_t *char_iface = (char_iface_t *) iface;
 	ipc_callid_t cid;
 	
 	size_t len;
 	if (!async_data_read_receive(&cid, &len)) {
-		// TODO handle protocol error
+		/* TODO handle protocol error. */
 		ipc_answer_0(callid, EINVAL);
 		return;
@@ -86,12 +91,12 @@
 	}
 	
-	if (len > MAX_CHAR_RW_COUNT) {
+	if (len > MAX_CHAR_RW_COUNT)
 		len = MAX_CHAR_RW_COUNT;
-	}
 	
 	char buf[MAX_CHAR_RW_COUNT];
 	int ret = (*char_iface->read)(dev, buf, len);
 	
-	if (ret < 0) { // some error occured
+	if (ret < 0) {
+		/* Some error occured. */
 		async_data_read_finalize(cid, buf, 0);
 		ipc_answer_0(callid, ret);
@@ -99,28 +104,31 @@
 	}
 	
-	// the operation was successful, return the number of data read
+	/* The operation was successful, return the number of data read. */
 	async_data_read_finalize(cid, buf, ret);
-	ipc_answer_1(callid, EOK, ret);	
+	ipc_answer_1(callid, EOK, ret);
 }
 
 /** Process the write request from the remote client.
- * 
- * Receive the write request's parameters from the remote client and pass them to the local interface.
- * Return the result of the operation processed by the local interface to the remote client.
- * 
- * @param dev the device to which the data are written.
- * @param iface the local interface structure. 
+ *
+ * Receive the write request's parameters from the remote client and pass them
+ * to the local interface. Return the result of the operation processed by the
+ * local interface to the remote client.
+ *
+ * @param dev		The device to which the data are written.
+ * @param iface		The local interface structure.
  */
-static void remote_char_write(device_t *dev, void *iface, ipc_callid_t callid, ipc_call_t *call)
+static void
+remote_char_write(device_t *dev, void *iface, ipc_callid_t callid,
+    ipc_call_t *call)
 {
-	char_iface_t *char_iface = (char_iface_t *)iface;
+	char_iface_t *char_iface = (char_iface_t *) iface;
 	ipc_callid_t cid;
 	size_t len;
 	
 	if (!async_data_write_receive(&cid, &len)) {
-		// TODO handle protocol error
+		/* TODO handle protocol error. */
 		ipc_answer_0(callid, EINVAL);
 		return;
-    }
+	}
 	
 	if (!char_iface->write) {
@@ -130,7 +138,6 @@
 	}	
 	
-	if (len > MAX_CHAR_RW_COUNT) {
+	if (len > MAX_CHAR_RW_COUNT)
 		len = MAX_CHAR_RW_COUNT;
-	}
 	
 	char buf[MAX_CHAR_RW_COUNT];
@@ -139,13 +146,17 @@
 	
 	int ret = (*char_iface->write)(dev, buf, len);
-	if (ret < 0) { // some error occured
+	if (ret < 0) {
+		/* Some error occured. */
 		ipc_answer_0(callid, ret);
 	} else {
-		// the operation was successful, return the number of data written
+		/*
+		 * The operation was successful, return the number of data
+		 * written.
+		 */
 		ipc_answer_1(callid, EOK, ret);
 	}
 }
 
- /**
+/**
  * @}
  */
Index: uspace/lib/drv/generic/remote_res.c
===================================================================
--- uspace/lib/drv/generic/remote_res.c	(revision a79d88da204957831a1715d66a6d80828c09d5c1)
+++ uspace/lib/drv/generic/remote_res.c	(revision 7a252ec898ad0b08c9e132a962b2d137a40b6be2)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2010 Lenka Trochtova 
+ * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
  *
@@ -40,34 +40,37 @@
 #include "resource.h"
 
- 
-static void remote_res_get_resources(device_t *dev, void *iface, ipc_callid_t callid, ipc_call_t *call);
-static void remote_res_enable_interrupt(device_t *dev, void *iface, ipc_callid_t callid, ipc_call_t *call);
+static void remote_res_get_resources(device_t *, void *, ipc_callid_t,
+    ipc_call_t *);
+static void remote_res_enable_interrupt(device_t *, void *, ipc_callid_t,
+    ipc_call_t *);
 
 static remote_iface_func_ptr_t remote_res_iface_ops [] = {
 	&remote_res_get_resources,
-	&remote_res_enable_interrupt	
-}; 
- 
+	&remote_res_enable_interrupt
+};
+
 remote_iface_t remote_res_iface = {
-	.method_count = sizeof(remote_res_iface_ops) / sizeof(remote_iface_func_ptr_t),
+	.method_count = sizeof(remote_res_iface_ops) /
+	    sizeof(remote_iface_func_ptr_t),
 	.methods = remote_res_iface_ops
 };
 
-static void remote_res_enable_interrupt(device_t *dev, void *iface, ipc_callid_t callid, ipc_call_t *call)
+static void remote_res_enable_interrupt(device_t *dev, void *iface,
+    ipc_callid_t callid, ipc_call_t *call)
 {
-	resource_iface_t *ires = (resource_iface_t *)iface;
+	resource_iface_t *ires = (resource_iface_t *) iface;
 	
-	if (NULL == ires->enable_interrupt) {
+	if (NULL == ires->enable_interrupt)
 		ipc_answer_0(callid, ENOTSUP);
-	} else if (ires->enable_interrupt(dev)) {
+	else if (ires->enable_interrupt(dev))
 		ipc_answer_0(callid, EOK);
-	} else {
+	else
 		ipc_answer_0(callid, EREFUSED);
-	}	
 }
 
-static void remote_res_get_resources(device_t *dev, void *iface, ipc_callid_t callid, ipc_call_t *call)
+static void remote_res_get_resources(device_t *dev, void *iface,
+    ipc_callid_t callid, ipc_call_t *call)
 {
-	resource_iface_t *ires = (resource_iface_t *)iface;	
+	resource_iface_t *ires = (resource_iface_t *) iface;
 	if (NULL == ires->get_resources) {
 		ipc_answer_0(callid, ENOTSUP);
@@ -75,5 +78,5 @@
 	}
 	
-	hw_resource_list_t *hw_resources = ires->get_resources(dev);	
+	hw_resource_list_t *hw_resources = ires->get_resources(dev);
 	if (NULL == hw_resources){
 		ipc_answer_0(callid, ENOENT);
@@ -85,12 +88,11 @@
 	size_t len;
 	if (!async_data_read_receive(&callid, &len)) {
-		// protocol error - the recipient is not accepting data
+		/* protocol error - the recipient is not accepting data */
 		return;
 	}
 	async_data_read_finalize(callid, hw_resources->resources, len);
 }
- 
- 
- /**
+
+/**
  * @}
  */
Index: uspace/lib/drv/include/char.h
===================================================================
--- uspace/lib/drv/include/char.h	(revision a79d88da204957831a1715d66a6d80828c09d5c1)
+++ uspace/lib/drv/include/char.h	(revision 7a252ec898ad0b08c9e132a962b2d137a40b6be2)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2010 Lenka Trochtova 
+ * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
  *
@@ -32,4 +32,5 @@
 /** @file
  */
+
 #ifndef LIBDRV_CHAR_H_
 #define LIBDRV_CHAR_H_
@@ -38,6 +39,6 @@
 
 typedef struct char_iface {
-	int (*read)(device_t *dev, char *buf, size_t count);
-	int (*write)(device_t *dev, char *buf, size_t count);	
+	int (*read)(device_t *, char *, size_t);
+	int (*write)(device_t *, char *, size_t);
 } char_iface_t;
 
Index: uspace/lib/drv/include/dev_iface.h
===================================================================
--- uspace/lib/drv/include/dev_iface.h	(revision a79d88da204957831a1715d66a6d80828c09d5c1)
+++ uspace/lib/drv/include/dev_iface.h	(revision 7a252ec898ad0b08c9e132a962b2d137a40b6be2)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2010 Lenka Trochtova 
+ * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
  *
@@ -32,4 +32,5 @@
 /** @file
  */
+
 #ifndef LIBDRV_DEV_IFACE_H_
 #define LIBDRV_DEV_IFACE_H_
@@ -37,6 +38,5 @@
 #include "driver.h"
 
-
-// TODO declare device interface structures here
+/* TODO declare device interface structures here */
 
 #endif
Index: uspace/lib/drv/include/driver.h
===================================================================
--- uspace/lib/drv/include/driver.h	(revision a79d88da204957831a1715d66a6d80828c09d5c1)
+++ uspace/lib/drv/include/driver.h	(revision 7a252ec898ad0b08c9e132a962b2d137a40b6be2)
@@ -32,7 +32,7 @@
 /** @file
  */
+
 #ifndef LIBDRV_DRIVER_H_
 #define LIBDRV_DRIVER_H_
-
 
 #include <adt/list.h>
@@ -52,10 +52,14 @@
 typedef struct device device_t;
 
-// device interface
-
-// first two parameters: device and interface structure registered by the devices driver
-typedef void remote_iface_func_t(device_t*, void *, ipc_callid_t, ipc_call_t *);
+/* device interface */
+
+/*
+ * First two parameters: device and interface structure registered by the
+ * devices driver.
+ */
+typedef void remote_iface_func_t(device_t *, void *, ipc_callid_t,
+    ipc_call_t *);
 typedef remote_iface_func_t *remote_iface_func_ptr_t;
-typedef void remote_handler_t(device_t*, ipc_callid_t, ipc_call_t *);
+typedef void remote_handler_t(device_t *, ipc_callid_t, ipc_call_t *);
 
 typedef struct {
@@ -65,5 +69,5 @@
 
 typedef struct {
-	remote_iface_t * ifaces[DEV_IFACE_COUNT];
+	remote_iface_t *ifaces[DEV_IFACE_COUNT];
 } iface_dipatch_table_t;
 
@@ -74,48 +78,72 @@
 }
 
-remote_iface_t* get_remote_iface(int idx);
-remote_iface_func_ptr_t get_remote_method(remote_iface_t *rem_iface, ipcarg_t iface_method_idx);
-
-
-// device class
+remote_iface_t *get_remote_iface(int);
+remote_iface_func_ptr_t get_remote_method(remote_iface_t *, ipcarg_t);
+
+
+/* device class */
 
 /** Devices operations. */
 typedef struct device_ops {
-	/** Optional callback function called when a client is connecting to the device. */
-	int (*open)(device_t *dev);
-	/** Optional callback function called when a client is disconnecting from the device. */
-	void (*close)(device_t *dev);
+	/**
+	 * Optional callback function called when a client is connecting to the
+	 * device.
+	 */
+	int (*open)(device_t *);
+	
+	/**
+	 * Optional callback function called when a client is disconnecting from
+	 * the device.
+	 */
+	void (*close)(device_t *);
+	
 	/** The table of standard interfaces implemented by the device. */
-	void *interfaces[DEV_IFACE_COUNT];	
-	/** The default handler of remote client requests. If the client's remote request cannot be handled 
-	 * by any of the standard interfaces, the default handler is used.*/
+	void *interfaces[DEV_IFACE_COUNT];
+	
+	/**
+	 * The default handler of remote client requests. If the client's remote
+	 * request cannot be handled by any of the standard interfaces, the
+	 * default handler is used.
+	 */
 	remote_handler_t *default_handler;
 } device_ops_t;
 
 
-// device
+/* device */
 
 /** The device. */
 struct device {
-	/** Globally unique device identifier (assigned to the device by the device manager). */
+	/**
+	 * Globally unique device identifier (assigned to the device by the
+	 * device manager).
+	 */
 	device_handle_t handle;
-	/** The phone to the parent device driver (if it is different from this driver).*/
+	
+	/**
+	 * The phone to the parent device driver (if it is different from this
+	 * driver).
+	 */
 	int parent_phone;
+	
 	/** Parent device if handled by this driver, NULL otherwise. */
 	device_t *parent;
-	/** The device's name.*/
+	/** The device's name. */
 	const char *name;
-	/** The list of device ids for device-to-driver matching.*/
+	/** The list of device ids for device-to-driver matching. */
 	match_id_list_t match_ids;
-	/** The device driver's data associated with this device.*/
+	/** The device driver's data associated with this device. */
 	void *driver_data;
-	/** The implementation of operations provided by this device.*/
+	/** The implementation of operations provided by this device. */
 	device_ops_t *ops;
-	/** Pointer to the previous and next device in the list of devices handled by the driver */
+	
+	/**
+	 * Pointer to the previous and next device in the list of devices
+	 * handled by the driver.
+	 */
 	link_t link;
 };
 
 
-// driver
+/* driver */
 
 /** Generic device driver operations. */
@@ -123,5 +151,5 @@
 	/** Callback method for passing a new device to the device driver.*/
 	int (*add_device)(device_t *dev);
-	// TODO add other generic driver operations
+	/* TODO add other generic driver operations */
 } driver_ops_t;
 
@@ -134,11 +162,11 @@
 } driver_t;
 
-int driver_main(driver_t *drv);
-
-/** Create new device structure. 
- * 
- * @return the device structure.
- */
-static inline device_t * create_device()
+int driver_main(driver_t *);
+
+/** Create new device structure.
+ *
+ * @return		The device structure.
+ */
+static inline device_t *create_device(void)
 {
 	device_t *dev = malloc(sizeof(device_t));
@@ -150,31 +178,30 @@
 }
 
-/** Delete device structure. 
- * 
- * @param dev the device structure.
+/** Delete device structure.
+ *
+ * @param dev		The device structure.
  */
 static inline void delete_device(device_t *dev)
 {
 	clean_match_ids(&dev->match_ids);
-	if (NULL != dev->name) {
+	if (NULL != dev->name)
 		free(dev->name);
-	}
 	free(dev);
 }
 
-static inline void * device_get_iface(device_t *dev, dev_inferface_idx_t idx)
-{
-	assert(is_valid_iface_idx(idx));	
-	if (NULL == dev->ops) {
+static inline void *device_get_iface(device_t *dev, dev_inferface_idx_t idx)
+{
+	assert(is_valid_iface_idx(idx));
+	if (NULL == dev->ops)
 		return NULL;
-	}
-	return dev->ops->interfaces[idx];	
-}
-
-int child_device_register(device_t *child, device_t *parent);
-
-// interrupts
-
-typedef void interrupt_handler_t(device_t *dev, ipc_callid_t iid, ipc_call_t *icall);
+	return dev->ops->interfaces[idx];
+}
+
+int child_device_register(device_t *, device_t *);
+
+
+/* interrupts */
+
+typedef void interrupt_handler_t(device_t *, ipc_callid_t, ipc_call_t *);
 
 typedef struct interrupt_context {
@@ -192,10 +219,12 @@
 } interrupt_context_list_t;
 
-static inline interrupt_context_t * create_interrupt_context()
-{ 
-	interrupt_context_t *ctx = (interrupt_context_t *)malloc(sizeof(interrupt_context_t));
-	if (NULL != ctx) {
+static inline interrupt_context_t *create_interrupt_context(void)
+{
+	interrupt_context_t *ctx;
+	
+	ctx = (interrupt_context_t *) malloc(sizeof(interrupt_context_t));
+	if (NULL != ctx)
 		memset(ctx, 0, sizeof(interrupt_context_t));
-	}
+	
 	return ctx;
 }
@@ -203,7 +232,6 @@
 static inline void delete_interrupt_context(interrupt_context_t *ctx)
 {
-	if (NULL != ctx) {
+	if (NULL != ctx)
 		free(ctx);
-	}
 }
 
@@ -212,29 +240,30 @@
 	memset(list, 0, sizeof(interrupt_context_list_t));
 	fibril_mutex_initialize(&list->mutex);
-	list_initialize(&list->contexts);	
-}
-
-static inline void add_interrupt_context(interrupt_context_list_t *list, interrupt_context_t *ctx)
+	list_initialize(&list->contexts);
+}
+
+static inline void
+add_interrupt_context(interrupt_context_list_t *list, interrupt_context_t *ctx)
 {
 	fibril_mutex_lock(&list->mutex);
-	
 	ctx->id = list->curr_id++;
 	list_append(&ctx->link, &list->contexts);
-	
 	fibril_mutex_unlock(&list->mutex);
 }
 
-static inline void remove_interrupt_context(interrupt_context_list_t *list, interrupt_context_t *ctx)
+static inline void
+remove_interrupt_context(interrupt_context_list_t *list,
+    interrupt_context_t *ctx)
 {
 	fibril_mutex_lock(&list->mutex);
-	
 	list_remove(&ctx->link);
-	
 	fibril_mutex_unlock(&list->mutex);
 }
 
-static inline interrupt_context_t *find_interrupt_context_by_id(interrupt_context_list_t *list, int id) 
-{
-	fibril_mutex_lock(&list->mutex);	
+static inline interrupt_context_t *
+find_interrupt_context_by_id(interrupt_context_list_t *list, int id)
+{
+	fibril_mutex_lock(&list->mutex);
+	
 	link_t *link = list->contexts.next;
 	interrupt_context_t *ctx;
@@ -247,12 +276,15 @@
 		}
 		link = link->next;
-	}	
-	fibril_mutex_unlock(&list->mutex);	
+	}
+	
+	fibril_mutex_unlock(&list->mutex);
 	return NULL;
 }
 
-static inline interrupt_context_t *find_interrupt_context(interrupt_context_list_t *list, device_t *dev, int irq) 
-{
-	fibril_mutex_lock(&list->mutex);	
+static inline interrupt_context_t *
+find_interrupt_context(interrupt_context_list_t *list, device_t *dev, int irq)
+{
+	fibril_mutex_lock(&list->mutex);
+	
 	link_t *link = list->contexts.next;
 	interrupt_context_t *ctx;
@@ -265,22 +297,22 @@
 		}
 		link = link->next;
-	}	
-	fibril_mutex_unlock(&list->mutex);	
+	}
+	
+	fibril_mutex_unlock(&list->mutex);
 	return NULL;
 }
 
-int register_interrupt_handler(device_t *dev, int irq, interrupt_handler_t *handler, irq_code_t *pseudocode);
-int unregister_interrupt_handler(device_t *dev, int irq);
-
-
-// default handler for client requests
-
-static inline remote_handler_t * device_get_default_handler(device_t *dev)
-{
-	if (NULL == dev->ops) {
+int register_interrupt_handler(device_t *, int, interrupt_handler_t *,
+    irq_code_t *);
+int unregister_interrupt_handler(device_t *, int);
+
+
+/* default handler for client requests */
+
+static inline remote_handler_t *device_get_default_handler(device_t *dev)
+{
+	if (NULL == dev->ops)
 		return NULL;
-	}
-	
-	return dev->ops->default_handler;	
+	return dev->ops->default_handler;
 }
 
Index: uspace/lib/drv/include/remote_char.h
===================================================================
--- uspace/lib/drv/include/remote_char.h	(revision a79d88da204957831a1715d66a6d80828c09d5c1)
+++ uspace/lib/drv/include/remote_char.h	(revision 7a252ec898ad0b08c9e132a962b2d137a40b6be2)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2010 Lenka Trochtova 
+ * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
  *
@@ -32,4 +32,5 @@
 /** @file
  */
+
 #ifndef LIBDRV_REMOTE_CHAR_H_
 #define LIBDRV_REMOTE_CHAR_H_
Index: uspace/lib/drv/include/remote_res.h
===================================================================
--- uspace/lib/drv/include/remote_res.h	(revision a79d88da204957831a1715d66a6d80828c09d5c1)
+++ uspace/lib/drv/include/remote_res.h	(revision 7a252ec898ad0b08c9e132a962b2d137a40b6be2)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2010 Lenka Trochtova 
+ * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
  *
@@ -32,4 +32,5 @@
 /** @file
  */
+
 #ifndef LIBDRV_REMOTE_RES_H_
 #define LIBDRV_REMOTE_RES_H_
Index: uspace/lib/drv/include/resource.h
===================================================================
--- uspace/lib/drv/include/resource.h	(revision a79d88da204957831a1715d66a6d80828c09d5c1)
+++ uspace/lib/drv/include/resource.h	(revision 7a252ec898ad0b08c9e132a962b2d137a40b6be2)
@@ -32,4 +32,5 @@
 /** @file
  */
+
 #ifndef LIBDRV_RESOURCE_H_
 #define LIBDRV_RESOURCE_H_
@@ -38,6 +39,6 @@
 
 typedef struct resource_iface {
-	 hw_resource_list_t * (*get_resources)(device_t *dev);
-	 bool (*enable_interrupt)(device_t *dev);	
+	 hw_resource_list_t *(* get_resources)(device_t *);
+	 bool (*enable_interrupt)(device_t *);
 } resource_iface_t;
 
