Index: uspace/lib/c/generic/adt/hash_table.c
===================================================================
--- uspace/lib/c/generic/adt/hash_table.c	(revision 63f89665fc0283c1661274dc636d5a66e03d48b4)
+++ uspace/lib/c/generic/adt/hash_table.c	(revision 9d6bfa54cd19173b48ae3d05ffc70bf7e60e75ab)
@@ -42,20 +42,19 @@
 #include <malloc.h>
 #include <assert.h>
-#include <stdio.h>
 #include <str.h>
 
 /** Create chained hash table.
  *
- * @param h		Hash table structure. Will be initialized by this call.
- * @param m		Number of hash table buckets.
- * @param max_keys	Maximal number of keys needed to identify an item.
- * @param op		Hash table operations structure.
- * @return		True on success
+ * @param h        Hash table structure. Will be initialized by this call.
+ * @param m        Number of hash table buckets.
+ * @param max_keys Maximal number of keys needed to identify an item.
+ * @param op       Hash table operations structure.
+ *
+ * @return True on success
+ *
  */
 int hash_table_create(hash_table_t *h, hash_count_t m, hash_count_t max_keys,
     hash_table_operations_t *op)
 {
-	hash_count_t i;
-
 	assert(h);
 	assert(op && op->hash && op->compare);
@@ -63,10 +62,10 @@
 	
 	h->entry = malloc(m * sizeof(link_t));
-	if (!h->entry) {
-		printf("cannot allocate memory for hash table\n");
+	if (!h->entry)
 		return false;
-	}
+	
 	memset((void *) h->entry, 0,  m * sizeof(link_t));
 	
+	hash_count_t i;
 	for (i = 0; i < m; i++)
 		list_initialize(&h->entry[i]);
@@ -75,4 +74,5 @@
 	h->max_keys = max_keys;
 	h->op = op;
+	
 	return true;
 }
@@ -80,5 +80,6 @@
 /** Destroy a hash table instance.
  *
- * @param h		Hash table to be destroyed.
+ * @param h Hash table to be destroyed.
+ *
  */
 void hash_table_destroy(hash_table_t *h)
@@ -86,4 +87,5 @@
 	assert(h);
 	assert(h->entry);
+	
 	free(h->entry);
 }
@@ -91,16 +93,14 @@
 /** Insert item into a hash table.
  *
- * @param h		Hash table.
- * @param key		Array of all keys necessary to compute hash index.
- * @param item		Item to be inserted into the hash table.
+ * @param h    Hash table.
+ * @param key  Array of all keys necessary to compute hash index.
+ * @param item Item to be inserted into the hash table.
  */
 void hash_table_insert(hash_table_t *h, unsigned long key[], link_t *item)
 {
-	hash_index_t chain;
-
 	assert(item);
 	assert(h && h->op && h->op->hash && h->op->compare);
-
-	chain = h->op->hash(key);
+	
+	hash_index_t chain = h->op->hash(key);
 	assert(chain < h->entries);
 	
@@ -110,19 +110,18 @@
 /** Search hash table for an item matching keys.
  *
- * @param h		Hash table.
- * @param key		Array of all keys needed to compute hash index.
- *
- * @return		Matching item on success, NULL if there is no such item.
+ * @param h   Hash table.
+ * @param key Array of all keys needed to compute hash index.
+ *
+ * @return Matching item on success, NULL if there is no such item.
+ *
  */
 link_t *hash_table_find(hash_table_t *h, unsigned long key[])
 {
+	assert(h && h->op && h->op->hash && h->op->compare);
+	
+	hash_index_t chain = h->op->hash(key);
+	assert(chain < h->entries);
+	
 	link_t *cur;
-	hash_index_t chain;
-
-	assert(h && h->op && h->op->hash && h->op->compare);
-
-	chain = h->op->hash(key);
-	assert(chain < h->entries);
-	
 	for (cur = h->entry[chain].next; cur != &h->entry[chain];
 	    cur = cur->next) {
@@ -142,25 +141,24 @@
  * For each removed item, h->remove_callback() is called.
  *
- * @param h		Hash table.
- * @param key		Array of keys that will be compared against items of
- * 			the hash table.
- * @param keys		Number of keys in the 'key' array.
+ * @param h    Hash table.
+ * @param key  Array of keys that will be compared against items of
+ *             the hash table.
+ * @param keys Number of keys in the 'key' array.
+ *
  */
 void hash_table_remove(hash_table_t *h, unsigned long key[], hash_count_t keys)
 {
-	hash_index_t chain;
-	link_t *cur;
-
 	assert(h && h->op && h->op->hash && h->op->compare &&
 	    h->op->remove_callback);
 	assert(keys <= h->max_keys);
 	
+	link_t *cur;
+	
 	if (keys == h->max_keys) {
-
 		/*
 		 * All keys are known, hash_table_find() can be used to find the
 		 * entry.
 		 */
-	
+		
 		cur = hash_table_find(h, key);
 		if (cur) {
@@ -168,4 +166,5 @@
 			h->op->remove_callback(cur);
 		}
+		
 		return;
 	}
@@ -175,4 +174,5 @@
 	 * Any partially matching entries are to be removed.
 	 */
+	hash_index_t chain;
 	for (chain = 0; chain < h->entries; chain++) {
 		for (cur = h->entry[chain].next; cur != &h->entry[chain];
@@ -195,14 +195,14 @@
 /** Apply fucntion to all items in hash table.
  *
- * @param h		Hash table.
- * @param f		Function to be applied.
- * @param arg		Argument to be passed to the function.
- */
-void
-hash_table_apply(hash_table_t *h, void (*f)(link_t *, void *), void *arg)
+ * @param h   Hash table.
+ * @param f   Function to be applied.
+ * @param arg Argument to be passed to the function.
+ *
+ */
+void hash_table_apply(hash_table_t *h, void (*f)(link_t *, void *), void *arg)
 {
 	hash_index_t bucket;
 	link_t *cur;
-
+	
 	for (bucket = 0; bucket < h->entries; bucket++) {
 		for (cur = h->entry[bucket].next; cur != &h->entry[bucket];
