Index: uspace/lib/drv/generic/dev_iface.c
===================================================================
--- uspace/lib/drv/generic/dev_iface.c	(revision a6e54c5db4014406256cc9e1682c3c4771222aef)
+++ uspace/lib/drv/generic/dev_iface.c	(revision 49698fac57de2ecd7140a9c7fd845dfa15affad5)
@@ -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 a6e54c5db4014406256cc9e1682c3c4771222aef)
+++ uspace/lib/drv/generic/driver.c	(revision 49698fac57de2ecd7140a9c7fd845dfa15affad5)
@@ -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 a6e54c5db4014406256cc9e1682c3c4771222aef)
+++ uspace/lib/drv/generic/remote_char.c	(revision 49698fac57de2ecd7140a9c7fd845dfa15affad5)
@@ -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 a6e54c5db4014406256cc9e1682c3c4771222aef)
+++ uspace/lib/drv/generic/remote_res.c	(revision 49698fac57de2ecd7140a9c7fd845dfa15affad5)
@@ -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);
 }
- 
- 
- /**
+
+/**
  * @}
  */
