Index: kernel/test/atomic/atomic1.c
===================================================================
--- kernel/test/atomic/atomic1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/atomic/atomic1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -35,29 +35,29 @@
 {
 	atomic_t a;
-	
+
 	atomic_set(&a, 10);
 	if (atomic_get(&a) != 10)
 		return "Failed atomic_set()/atomic_get()";
-	
+
 	if (atomic_postinc(&a) != 10)
 		return "Failed atomic_postinc()";
 	if (atomic_get(&a) != 11)
 		return "Failed atomic_get() after atomic_postinc()";
-	
+
 	if (atomic_postdec(&a) != 11)
 		return "Failed atomic_postdec()";
 	if (atomic_get(&a) != 10)
 		return "Failed atomic_get() after atomic_postdec()";
-	
+
 	if (atomic_preinc(&a) != 11)
 		return "Failed atomic_preinc()";
 	if (atomic_get(&a) != 11)
 		return "Failed atomic_get() after atomic_preinc()";
-	
+
 	if (atomic_predec(&a) != 10)
 		return "Failed atomic_predec()";
 	if (atomic_get(&a) != 10)
 		return "Failed atomic_get() after atomic_predec()";
-	
+
 	return NULL;
 }
Index: kernel/test/avltree/avltree1.c
===================================================================
--- kernel/test/avltree/avltree1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/avltree/avltree1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -56,8 +56,8 @@
 {
 	avltree_node_t *tmp;
-	
+
 	if (!node)
 		return NULL;
-	
+
 	if (node->lft) {
 		tmp = test_tree_parents(node->lft);
@@ -81,15 +81,15 @@
 {
 	int h1, h2, diff;
-	
+
 	if (!node)
 		return 0;
-	
+
 	h1 = test_tree_balance(node->lft);
 	h2 = test_tree_balance(node->rgt);
 	diff = h2 - h1;
-	
+
 	if ((diff != node->balance) || ((diff != -1) && (diff != 0) && (diff != 1)))
 		TPRINTF("Bad balance\n");
-	
+
 	return ((h1 > h2) ? (h1 + 1) : (h2 + 1));
 }
@@ -110,12 +110,12 @@
 		return;
 	}
-	
+
 	if (node == NULL)
 		return;
-	
+
 	TPRINTF("%" PRIu64 "[%" PRIu8 "]", node->key, node->balance);
 	if (node->lft != NULL || node->rgt != NULL) {
 		TPRINTF("(");
-		
+
 		print_tree_structure_flat(node->lft, level + 1);
 		if (node->rgt != NULL) {
@@ -123,5 +123,5 @@
 			print_tree_structure_flat(node->rgt, level + 1);
 		}
-		
+
 		TPRINTF(")");
 	}
@@ -131,25 +131,25 @@
 {
 	int i;
-	
+
 	for (i = 0; i < NODE_COUNT - 1; i++)
 		avltree_nodes[i].par = &avltree_nodes[i + 1];
-	
+
 	avltree_nodes[i].par = NULL;
-	
+
 	/*
 	 * Node keys which will be used for insertion. Up to NODE_COUNT size of
 	 * array.
 	 */
-	
+
 	/* First tree node and same key */
 	avltree_nodes[0].key = 60;
 	avltree_nodes[1].key = 60;
 	avltree_nodes[2].key = 60;
-	
+
 	/* LL rotation */
 	avltree_nodes[3].key = 50;
 	avltree_nodes[4].key = 40;
 	avltree_nodes[5].key = 30;
-	
+
 	/* LR rotation */
 	avltree_nodes[6].key = 20;
@@ -157,20 +157,20 @@
 	avltree_nodes[8].key = 25;
 	avltree_nodes[9].key = 25;
-	
+
 	/* LL rotation in lower floor */
 	avltree_nodes[10].key = 35;
-	
+
 	/* RR rotation */
 	avltree_nodes[11].key = 70;
 	avltree_nodes[12].key = 80;
-	
+
 	/* RL rotation */
 	avltree_nodes[13].key = 90;
 	avltree_nodes[14].key = 85;
-	
+
 	/* Insert 0 key */
 	avltree_nodes[15].key = 0;
 	avltree_nodes[16].key = 0;
-	
+
 	/* Insert reverse */
 	avltree_nodes[17].key = 600;
@@ -178,8 +178,8 @@
 	avltree_nodes[19].key = 400;
 	avltree_nodes[20].key = 300;
-	
+
 	for (i = 21; i < NODE_COUNT; i++)
 		avltree_nodes[i].key = i * 3;
-	
+
 	first_free_node = &avltree_nodes[0];
 }
@@ -188,8 +188,8 @@
 {
 	avltree_node_t *node;
-	
+
 	node = first_free_node;
 	first_free_node = first_free_node->par;
-	
+
 	return node;
 }
@@ -199,17 +199,17 @@
 	unsigned int i;
 	avltree_node_t *newnode;
-	
+
 	avltree_create(tree);
-	
+
 	TPRINTF("Inserting %zu nodes...", node_count);
-	
+
 	for (i = 0; i < node_count; i++) {
 		newnode = alloc_avltree_node();
-		
+
 		avltree_insert(tree, newnode);
 		test_tree_parents(tree->root);
 		test_tree_balance(tree->root);
 	}
-	
+
 	TPRINTF("done.\n");
 }
@@ -220,9 +220,9 @@
 	avltree_node_t *delnode;
 	unsigned int i;
-	
+
 	switch (node_position) {
 	case 0:
 		TPRINTF("Deleting root nodes...");
-		
+
 		while (tree->root != NULL) {
 			delnode = tree->root;
@@ -234,5 +234,5 @@
 	case 1:
 		TPRINTF("Deleting nodes according to creation time...");
-		
+
 		for (i = 0; i < node_count; i++) {
 			avltree_delete(tree, &avltree_nodes[i]);
@@ -242,5 +242,5 @@
 		break;
 	}
-	
+
 	TPRINTF("done.\n");
 }
@@ -249,7 +249,7 @@
 {
 	unsigned int i = 0;
-	
+
 	TPRINTF("Deleting minimum nodes...");
-	
+
 	while (tree->root != NULL) {
 		i++;
@@ -258,8 +258,8 @@
 		test_tree_balance(tree->root);
 	}
-	
+
 	if (i != node_count)
 		TPRINTF("Bad node count. Some nodes have been lost!\n");
-	
+
 	TPRINTF("done.\n");
 }
@@ -270,13 +270,13 @@
 	test_tree_insert(&avltree, NODE_COUNT);
 	test_tree_delete(&avltree, NODE_COUNT, 0);
-	
+
 	alloc_avltree_node_prepare();
 	test_tree_insert(&avltree, NODE_COUNT);
 	test_tree_delete(&avltree, NODE_COUNT, 1);
-	
+
 	alloc_avltree_node_prepare();
 	test_tree_insert(&avltree, NODE_COUNT);
 	test_tree_delmin(&avltree, NODE_COUNT);
-	
+
 	return NULL;
 }
Index: kernel/test/btree/btree1.c
===================================================================
--- kernel/test/btree/btree1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/btree/btree1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -38,7 +38,7 @@
 	btree_t t;
 	int i;
-	
+
 	btree_create(&t);
-	
+
 	TPRINTF("Inserting keys.\n");
 	btree_insert(&t, 19, data, NULL);
@@ -77,8 +77,8 @@
 	for (i = 100; i >= 50; i--)
 		btree_insert(&t, i, data, NULL);
-	
+
 	if (!test_quiet)
 		btree_print(&t);
-	
+
 	TPRINTF("Removing keys.\n");
 	btree_remove(&t, 50, NULL);
@@ -156,8 +156,8 @@
 	btree_remove(&t, 35, NULL);
 	btree_remove(&t, 36, NULL);
-	
+
 	if (!test_quiet)
 		btree_print(&t);
-	
+
 	return NULL;
 }
Index: kernel/test/cht/cht1.c
===================================================================
--- kernel/test/cht/cht1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/cht/cht1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -99,32 +99,32 @@
 	if (cht_find_lazy(h, (void*)0))
 		return "Found lazy in empty table.";
-	
+
 	if (cht_find(h, (void*)0))
 		return "Found in empty table.";
-	
+
 	if (cht_remove_key(h, (void*)0))
 		return "Removed from empty table.";
-	
+
 	const int val_cnt = 6;
 	val_t *v[6] = { NULL };
-	
+
 	for (int i = 0; i < val_cnt; ++i)
 		v[i] = malloc(sizeof(val_t), 0);
-	
+
 	size_t key[] = { 1, 1, 1, 11, 12, 13 };
-	
+
 	/* First three are identical */
 	for (int i = 0; i < 3; ++i)
 		set_val(v[i], 1, key[i]);
-	
+
 	/* Same hash, different key.*/
 	set_val(v[3], 1, key[3]);
-	
+
 	/* Different hashes and keys. */
 	set_val(v[4], 2, key[4]);
 	set_val(v[5], 3, key[5]);
-	
+
 	cht_link_t *dup;
-			
+
 	if (!cht_insert_unique(h, &v[0]->link, &dup))
 		return "Duplicates in empty";
@@ -132,5 +132,5 @@
 	if (cht_insert_unique(h, &v[1]->link, &dup))
 		return "Inserted a duplicate";
-	
+
 	if (dup != &v[0]->link)
 		return "Returned wrong duplicate";
@@ -138,18 +138,18 @@
 	if (!cht_insert_unique(h, &v[3]->link, &dup))
 		return "Refused non-equal item but with a hash in table.";
-	
+
 	cht_insert(h, &v[1]->link);
 	cht_insert(h, &v[2]->link);
-	
+
 	bool ok = true;
 	ok = ok && cht_insert_unique(h, &v[4]->link, &dup);
 	ok = ok && cht_insert_unique(h, &v[5]->link, &dup);
-	
+
 	if (!ok)
 		return "Refused unique ins 4, 5.";
-	
+
 	if (cht_find(h, (void*)0))
 		return "Phantom find.";
-	
+
 	cht_link_t *item = cht_find(h, (void*)v[5]->unique_id);
 	if (!item || item != &v[5]->link)
@@ -159,5 +159,5 @@
 	if (item)
 		return "Found nonexisting duplicate 5";
-	
+
 	item = cht_find(h, (void*)v[3]->unique_id);
 	if (!item || item != &v[3]->link)
@@ -167,15 +167,15 @@
 	if (item)
 		return "Found nonexisting duplicate 3, same hash as others.";
-	
+
 	item = cht_find(h, (void*)v[0]->unique_id);
 	((val_t*)item)->mark = true;
-	
+
 	for (int k = 1; k < 3; ++k) {
 		item = cht_find_next(h, item);
 		if (!item)
 			return "Did not find an inserted duplicate";
-		
+
 		val_t *val = ((val_t*)item);
-		
+
 		if (val->unique_id != v[0]->unique_id)
 			return "Found item with a different key.";
@@ -184,9 +184,9 @@
 		val->mark = true;
 	}
-	
+
 	for (int i = 0; i < 3; ++i) {
 		if (!v[i]->mark)
 			return "Did not find all duplicates";
-		
+
 		v[i]->mark = false;
 	}
@@ -196,13 +196,13 @@
 
 	item = cht_find_next(h, cht_find(h, (void*)key[0]));
-	
+
 	((val_t*)item)->mark = true;
 	if (!cht_remove_item(h, item))
 		return "Failed to remove inserted item";
-	
+
 	item = cht_find(h, (void*)key[0]);
 	if (!item || ((val_t*)item)->mark)
 		return "Did not find proper item.";
-	
+
 	item = cht_find_next(h, item);
 	if (!item || ((val_t*)item)->mark)
@@ -212,18 +212,18 @@
 	if (item)
 		return "Found removed duplicate";
-	
+
 	if (2 != cht_remove_key(h, (void*)key[0]))
 		return "Failed to remove all duplicates";
-	
+
 	if (cht_find(h, (void*)key[0]))
 		return "Found removed key";
-	
+
 	if (!cht_find(h, (void*)key[3]))
 		return "Removed incorrect key";
-	
+
 	for (size_t k = 0; k < sizeof(v) / sizeof(v[0]); ++k) {
 		cht_remove_key(h, (void*)key[k]);
 	}
-	
+
 	for (size_t k = 0; k < sizeof(v) / sizeof(v[0]); ++k) {
 		if (cht_find(h, (void*)key[k]))
@@ -239,9 +239,9 @@
 	if (!cht_create_simple(&h, &val_ops))
 		return "Could not create the table.";
-	
+
 	rcu_read_lock();
 	const char *err = do_sanity_test(&h);
 	rcu_read_unlock();
-	
+
 	cht_destroy(&h);
 
@@ -321,12 +321,12 @@
 				goto out_of_mem;
 			}
-			
+
 			s->free = true;
 			s->key = (i << 8) + work->id;
-			
+
 			cht_insert(work->h, &s->link);
 		}
 		TPRINTF("}");
-		
+
 		thread_sleep(2);
 
@@ -334,5 +334,5 @@
 		for (size_t i = 0; i < work->wave_elems; ++i) {
 			size_t key = (i << 8) + work->id;
-			
+
 			if (1 != cht_remove_key(work->h, (void*)key)) {
 				TPRINTF("Err: Failed to remove inserted item\n");
@@ -342,5 +342,5 @@
 		TPRINTF(">");
 	}
-	
+
 	/* Request that others stop. */
 	*work->stop = 1;
@@ -365,8 +365,8 @@
 	stress_work_t *work = (stress_work_t *)arg;
 	assert(0 == *work->stop);
-	
+
 	size_t loops = 0;
 	size_t seed = work->id;
-		
+
 	while (0 == *work->stop && !work->failed) {
 		seed = next_rand(seed);
@@ -374,5 +374,5 @@
 		seed = next_rand(seed);
 		size_t elem_idx = seed % work->elem_cnt;
-		
+
 		++loops;
 		if (0 == loops % (1024 * 1024)) {
@@ -381,9 +381,9 @@
 			TPRINTF("*");
 		}
-			
+
 		if (upd) {
 			seed = next_rand(seed);
 			bool item_op = seed & 1;
-			
+
 			if (work->elem[elem_idx].inserted) {
 				if (item_op) {
@@ -401,5 +401,5 @@
 			} else if (work->elem[elem_idx].deleted) {
 				work->elem[elem_idx].deleted = false;
-				
+
 				if (item_op) {
 					rcu_read_lock();
@@ -414,5 +414,5 @@
 					cht_insert(work->h, &work->elem[elem_idx].link);
 				}
-				
+
 				work->elem[elem_idx].inserted = true;
 			}
@@ -452,5 +452,5 @@
 {
 	cht_t h;
-	
+
 	if (!cht_create_simple(&h, &stress_ops)) {
 		TPRINTF("Failed to create the table\n");
@@ -464,12 +464,12 @@
 	size_t total_thr_cnt = op_thread_cnt + resize_thread_cnt;
 	size_t items_per_thread = 1024;
-	
+
 	size_t work_cnt = op_thread_cnt + resize_thread_cnt;
 	size_t item_cnt = op_thread_cnt * items_per_thread;
-	
+
 	/* Alloc hash table items. */
 	size_t size = item_cnt * sizeof(stress_t) + work_cnt * sizeof(stress_work_t)
 		+ sizeof(int);
-		
+
 	TPRINTF("Alloc and init table items. \n");
 	void *p = malloc(size, FRAME_ATOMIC);
@@ -479,11 +479,11 @@
 		return false;
 	}
-	
+
 	stress_t *pitem = p + work_cnt * sizeof(stress_work_t);
 	stress_work_t *pwork = p;
 	int *pstop = (int*)(pitem + item_cnt);
-	
+
 	*pstop = 0;
-	
+
 	/* Init work items. */
 	for (size_t i = 0; i < op_thread_cnt; ++i) {
@@ -496,5 +496,5 @@
 		pwork[i].failed = false;
 	}
-	
+
 	for (size_t i = op_thread_cnt; i < op_thread_cnt + resize_thread_cnt; ++i) {
 		pwork[i].h = &h;
@@ -505,5 +505,5 @@
 		pwork[i].failed = false;
 	}
-	
+
 	/* Init table elements. */
 	for (size_t k = 0; k < op_thread_cnt; ++k) {
@@ -515,11 +515,11 @@
 		}
 	}
-	
+
 	TPRINTF("Running %zu ins/del/find stress threads + %zu resizers.\n",
 		op_thread_cnt, resize_thread_cnt);
-	
+
 	/* Create and run threads. */
 	thread_t *thr[max_thread_cnt + resize_thread_cnt];
-	
+
 	for (size_t i = 0; i < total_thr_cnt; ++i) {
 		if (i < op_thread_cnt)
@@ -527,12 +527,12 @@
 		else
 			thr[i] = thread_create(resize_stresser, &pwork[i], TASK, 0, "cht-resize");
-		
+
 		assert(thr[i]);
 		thread_wire(thr[i], &cpus[i % config.cpu_active]);
 		thread_ready(thr[i]);
 	}
-	
+
 	bool failed = false;
-	
+
 	/* Wait for all threads to return. */
 	TPRINTF("Joining resize stressers.\n");
@@ -542,5 +542,5 @@
 		failed = pwork[i].failed || failed;
 	}
-	
+
 	TPRINTF("Joining op stressers.\n");
 	for (int i = (int)op_thread_cnt - 1; i >= 0; --i) {
@@ -550,5 +550,5 @@
 		failed = pwork[i].failed || failed;
 	}
-	
+
 	cht_destroy(&h);
 	free(p);
@@ -566,5 +566,5 @@
 		return err;
 	printf("Basic sanity test: ok.\n");
-	
+
 	if (!do_stress())
 		return "CHT stress test failed.";
Index: kernel/test/debug/mips1.c
===================================================================
--- kernel/test/debug/mips1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/debug/mips1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -40,9 +40,9 @@
 {
 	TPRINTF("If kconsole is compiled in, you should enter debug mode now.\n");
-	
+
 	asm volatile (
 		"break\n"
 	);
-	
+
 	return "Back from debug mode";
 }
Index: kernel/test/fault/fault1.c
===================================================================
--- kernel/test/fault/fault1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/fault/fault1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -40,5 +40,5 @@
 {
 	((int *)(0))[1] = 0;
-	
+
 	return "Written to NULL";
 }
Index: kernel/test/mm/falloc1.c
===================================================================
--- kernel/test/mm/falloc1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/mm/falloc1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -45,19 +45,19 @@
 	if (TEST_RUNS < 2)
 		return "Test is compiled with TEST_RUNS < 2";
-	
+
 	uintptr_t *frames = (uintptr_t *)
 	    malloc(MAX_FRAMES * sizeof(uintptr_t), 0);
 	if (frames == NULL)
 		return "Unable to allocate frames";
-	
+
 	unsigned int results[MAX_FRAMES + 1];
-	
+
 	for (unsigned int run = 0; run < TEST_RUNS; run++) {
 		for (size_t count = 1; count <= MAX_FRAMES; count++) {
 			size_t bytes = FRAMES2SIZE(count);
-			
+
 			TPRINTF("Allocating %zu frames blocks (%zu bytes) ... ",
 			    count, bytes);
-			
+
 			unsigned int allocated = 0;
 			for (unsigned int i = 0; i < (MAX_FRAMES / count); i++) {
@@ -70,7 +70,7 @@
 				}
 			}
-			
+
 			TPRINTF("%d blocks allocated.\n", allocated);
-			
+
 			if (run > 0) {
 				if (results[count] != allocated)
@@ -78,16 +78,16 @@
 			} else
 				results[count] = allocated;
-			
+
 			TPRINTF("Deallocating ... ");
-			
+
 			for (unsigned int i = 0; i < allocated; i++)
 				frame_free(frames[i], count);
-			
+
 			TPRINTF("done.\n");
 		}
 	}
-	
+
 	free(frames);
-	
+
 	return NULL;
 }
Index: kernel/test/mm/falloc2.c
===================================================================
--- kernel/test/mm/falloc2.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/mm/falloc2.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -51,5 +51,5 @@
 {
 	uint8_t val = THREAD->tid % THREADS;
-	
+
 	uintptr_t *frames = (uintptr_t *)
 	    malloc(MAX_FRAMES * sizeof(uintptr_t), FRAME_ATOMIC);
@@ -61,15 +61,15 @@
 		return;
 	}
-	
+
 	thread_detach(THREAD);
-	
+
 	for (unsigned int run = 0; run < THREAD_RUNS; run++) {
 		for (size_t count = 1; count <= MAX_FRAMES; count++) {
 			size_t bytes = FRAMES2SIZE(count);
-			
+
 			TPRINTF("Thread #%" PRIu64 " (cpu%u): "
 			    "Allocating %zu frames blocks (%zu bytes) ... \n", THREAD->tid,
 			    CPU->id, count, bytes);
-			
+
 			unsigned int allocated = 0;
 			for (unsigned int i = 0; i < (MAX_FRAMES / count); i++) {
@@ -81,5 +81,5 @@
 					break;
 			}
-			
+
 			TPRINTF("Thread #%" PRIu64 " (cpu%u): "
 			    "%u blocks allocated.\n", THREAD->tid, CPU->id,
@@ -87,5 +87,5 @@
 			TPRINTF("Thread #%" PRIu64 " (cpu%u): "
 			    "Deallocating ... \n", THREAD->tid, CPU->id);
-			
+
 			for (unsigned int i = 0; i < allocated; i++) {
 				for (size_t k = 0; k < bytes; k++) {
@@ -101,13 +101,13 @@
 				frame_free(frames[i], count);
 			}
-			
+
 			TPRINTF("Thread #%" PRIu64 " (cpu%u): "
 			    "Finished run.\n", THREAD->tid, CPU->id);
 		}
 	}
-	
+
 cleanup:
 	free(frames);
-	
+
 	TPRINTF("Thread #%" PRIu64 " (cpu%u): Exiting\n",
 	    THREAD->tid, CPU->id);
@@ -119,5 +119,5 @@
 	atomic_set(&thread_count, THREADS);
 	atomic_set(&thread_fail, 0);
-	
+
 	for (unsigned int i = 0; i < THREADS; i++) {
 		thread_t *thrd = thread_create(falloc, NULL, TASK,
@@ -129,5 +129,5 @@
 		thread_ready(thrd);
 	}
-	
+
 	while (atomic_get(&thread_count) > 0) {
 		TPRINTF("Threads left: %" PRIua "\n",
@@ -135,8 +135,8 @@
 		thread_sleep(1);
 	}
-	
+
 	if (atomic_get(&thread_fail) == 0)
 		return NULL;
-	
+
 	return "Test failed";
 }
Index: kernel/test/mm/mapping1.c
===================================================================
--- kernel/test/mm/mapping1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/mm/mapping1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -42,24 +42,24 @@
 {
 	uintptr_t frame = frame_alloc(1, FRAME_NONE, 0);
-	
+
 	uintptr_t page0 = km_map(frame, FRAME_SIZE,
 	    PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
 	TPRINTF("Virtual address %p mapped to physical address %p.\n",
 	    (void *) page0, (void *) frame);
-	
+
 	uintptr_t page1 = km_map(frame, FRAME_SIZE,
 	    PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
 	TPRINTF("Virtual address %p mapped to physical address %p.\n",
 	    (void *) page1, (void *) frame);
-	
+
 	for (unsigned int i = 0; i < 2; i++) {
 		TPRINTF("Writing magic using the first virtual address.\n");
-		
+
 		*((uint32_t *) page0) = TEST_MAGIC;
-		
+
 		TPRINTF("Reading magic using the second virtual address.\n");
-		
+
 		uint32_t v = *((uint32_t *) page1);
-		
+
 		if (v != TEST_MAGIC) {
 			km_unmap(page0, PAGE_SIZE);
@@ -68,13 +68,13 @@
 			return "Criss-cross read does not match the value written.";
 		}
-		
+
 		TPRINTF("Writing zero using the second virtual address.\n");
-		
+
 		*((uint32_t *) page1) = 0;
-		
+
 		TPRINTF("Reading zero using the first virtual address.\n");
-		
+
 		v = *((uint32_t *) page0);
-		
+
 		if (v != 0) {
 			km_unmap(page0, PAGE_SIZE);
@@ -84,9 +84,9 @@
 		}
 	}
-	
+
 	km_unmap(page0, PAGE_SIZE);
 	km_unmap(page1, PAGE_SIZE);
 	frame_free(frame, 1);
-	
+
 	return NULL;
 }
Index: kernel/test/mm/purge1.c
===================================================================
--- kernel/test/mm/purge1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/mm/purge1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -44,10 +44,10 @@
 	tlb_entry_t entryi;
 	tlb_entry_t entryd;
-	
+
 	int i;
-	
+
 	entryd.word[0] = 0;
 	entryd.word[1] = 0;
-	
+
 	entryd.p = true;                 /* present */
 	entryd.ma = MA_WRITEBACK;
@@ -58,8 +58,8 @@
 	entryd.ppn = 0;
 	entryd.ps = PAGE_WIDTH;
-	
+
 	entryi.word[0] = 0;
 	entryi.word[1] = 0;
-	
+
 	entryi.p = true;                 /* present */
 	entryi.ma = MA_WRITEBACK;
@@ -70,14 +70,14 @@
 	entryi.ppn = 0;
 	entryi.ps = PAGE_WIDTH;
-	
+
 	for (i = 0; i < 100; i++) {
 		itc_mapping_insert(0 + i * (1 << PAGE_WIDTH), 8, entryi);
 		dtc_mapping_insert(0 + i * (1 << PAGE_WIDTH), 9, entryd);
 	}
-	
+
 	tlb_invalidate_pages(8, 0x0c000, 14);
-	
+
 	/* tlb_invalidate_all(); */
-	
+
 	return NULL;
 }
Index: kernel/test/mm/slab1.c
===================================================================
--- kernel/test/mm/slab1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/mm/slab1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -42,60 +42,60 @@
 	slab_cache_t *cache;
 	int i;
-	
+
 	TPRINTF("Creating cache, object size: %d.\n", size);
-	
+
 	cache = slab_cache_create("test_cache", size, 0, NULL, NULL,
 	    SLAB_CACHE_NOMAGAZINE);
-	
+
 	TPRINTF("Allocating %d items...", count);
-	
+
 	for (i = 0; i < count; i++) {
 		data[i] = slab_alloc(cache, 0);
 		memsetb(data[i], size, 0);
 	}
-	
+
 	TPRINTF("done.\n");
-	
+
 	TPRINTF("Freeing %d items...", count);
-	
+
 	for (i = 0; i < count; i++)
 		slab_free(cache, data[i]);
-	
+
 	TPRINTF("done.\n");
-	
+
 	TPRINTF("Allocating %d items...", count);
-	
+
 	for (i = 0; i < count; i++) {
 		data[i] = slab_alloc(cache, 0);
 		memsetb(data[i], size, 0);
 	}
-	
+
 	TPRINTF("done.\n");
-	
+
 	TPRINTF("Freeing %d items...", count / 2);
-	
+
 	for (i = count - 1; i >= count / 2; i--)
 		slab_free(cache, data[i]);
-	
+
 	TPRINTF("done.\n");
-	
+
 	TPRINTF("Allocating %d items...", count / 2);
-	
+
 	for (i = count / 2; i < count; i++) {
 		data[i] = slab_alloc(cache, 0);
 		memsetb(data[i], size, 0);
 	}
-	
+
 	TPRINTF("done.\n");
-	
+
 	TPRINTF("Freeing %d items...", count);
-	
+
 	for (i = 0; i < count; i++)
 		slab_free(cache, data[i]);
-	
+
 	TPRINTF("done.\n");
-	
+
 	slab_cache_destroy(cache);
-	
+
 	TPRINTF("Test complete.\n");
 }
@@ -125,9 +125,9 @@
 	int offs = (int) (sysarg_t) data;
 	int i, j;
-	
+
 	thread_detach(THREAD);
-	
+
 	TPRINTF("Starting thread #%" PRIu64 "...\n", THREAD->tid);
-	
+
 	for (j = 0; j < 10; j++) {
 		for (i = 0; i < THR_MEM_COUNT; i++)
@@ -140,7 +140,7 @@
 			slab_free(thr_cache, thr_data[offs][i]);
 	}
-	
+
 	TPRINTF("Thread #%" PRIu64 " finished\n", THREAD->tid);
-	
+
 	semaphore_up(&thr_sem);
 }
@@ -150,8 +150,8 @@
 	thread_t *t;
 	int i;
-	
+
 	thr_cache = slab_cache_create("thread_cache", THR_MEM_SIZE, 0, NULL, NULL,
 	    SLAB_CACHE_NOMAGAZINE);
-	
+
 	semaphore_initialize(&thr_sem, 0);
 	for (i = 0; i < THREADS; i++) {
@@ -164,7 +164,7 @@
 	for (i = 0; i < THREADS; i++)
 		semaphore_down(&thr_sem);
-	
+
 	slab_cache_destroy(thr_cache);
-	
+
 	TPRINTF("Test complete.\n");
 }
@@ -174,5 +174,5 @@
 	testsimple();
 	testthreads();
-	
+
 	return NULL;
 }
Index: kernel/test/mm/slab2.c
===================================================================
--- kernel/test/mm/slab2.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/mm/slab2.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -48,13 +48,13 @@
 	slab_cache_t *cache2;
 	int i;
-	
+
 	void *data1, *data2;
 	void *olddata1 = NULL, *olddata2 = NULL;
-	
+
 	cache1 = slab_cache_create("test_cache1", ITEM_SIZE, 0, NULL, NULL, 0);
 	cache2 = slab_cache_create("test_cache2", ITEM_SIZE, 0, NULL, NULL, 0);
-	
+
 	TPRINTF("Allocating...");
-	
+
 	/* Use atomic alloc, so that we find end of memory */
 	do {
@@ -75,9 +75,9 @@
 		olddata2 = data2;
 	} while (true);
-	
+
 	TPRINTF("done.\n");
-	
+
 	TPRINTF("Deallocating cache2...");
-	
+
 	/* We do not have memory - now deallocate cache2 */
 	while (olddata2) {
@@ -86,9 +86,9 @@
 		olddata2 = data2;
 	}
-	
+
 	TPRINTF("done.\n");
-	
+
 	TPRINTF("Allocating to cache1...\n");
-	
+
 	for (i = 0; i < 30; i++) {
 		data1 = slab_alloc(cache1, FRAME_ATOMIC);
@@ -109,7 +109,7 @@
 		olddata1 = data1;
 	}
-	
+
 	TPRINTF("Deallocating cache1...");
-	
+
 	while (olddata1) {
 		data1 = *((void **) olddata1);
@@ -117,10 +117,10 @@
 		olddata1 = data1;
 	}
-	
+
 	TPRINTF("done.\n");
-	
+
 	if (!test_quiet)
 		slab_print_list();
-	
+
 	slab_cache_destroy(cache1);
 	slab_cache_destroy(cache2);
@@ -137,16 +137,16 @@
 {
 	void *data = NULL, *new;
-	
+
 	thread_detach(THREAD);
-	
+
 	mutex_lock(&starter_mutex);
 	condvar_wait(&thread_starter,&starter_mutex);
 	mutex_unlock(&starter_mutex);
-	
+
 	TPRINTF("Starting thread #%" PRIu64 "...\n", THREAD->tid);
 
 	/* Alloc all */
 	TPRINTF("Thread #%" PRIu64 " allocating...\n", THREAD->tid);
-	
+
 	while (true) {
 		/* Call with atomic to detect end of memory */
@@ -157,7 +157,7 @@
 		data = new;
 	}
-	
+
 	TPRINTF("Thread #%" PRIu64 " releasing...\n", THREAD->tid);
-	
+
 	while (data) {
 		new = *((void **)data);
@@ -166,7 +166,7 @@
 		data = new;
 	}
-	
+
 	TPRINTF("Thread #%" PRIu64 " allocating...\n", THREAD->tid);
-	
+
 	while (true) {
 		/* Call with atomic to detect end of memory */
@@ -177,7 +177,7 @@
 		data = new;
 	}
-	
+
 	TPRINTF("Thread #%" PRIu64 " releasing...\n", THREAD->tid);
-	
+
 	while (data) {
 		new = *((void **)data);
@@ -186,10 +186,10 @@
 		data = new;
 	}
-	
+
 	TPRINTF("Thread #%" PRIu64 " finished\n", THREAD->tid);
-	
+
 	if (!test_quiet)
 		slab_print_list();
-	
+
 	semaphore_up(&thr_sem);
 }
@@ -202,10 +202,10 @@
 	thread_t *t;
 	int i;
-	
+
 	TPRINTF("Running stress test with size %d\n", size);
-	
+
 	condvar_initialize(&thread_starter);
 	mutex_initialize(&starter_mutex, MUTEX_PASSIVE);
-	
+
 	thr_cache = slab_cache_create("thread_cache", size, 0, NULL, NULL, 0);
 	semaphore_initialize(&thr_sem,0);
@@ -218,8 +218,8 @@
 	thread_sleep(1);
 	condvar_broadcast(&thread_starter);
-	
+
 	for (i = 0; i < THREADS; i++)
 		semaphore_down(&thr_sem);
-	
+
 	slab_cache_destroy(thr_cache);
 	TPRINTF("Stress test complete.\n");
@@ -230,14 +230,14 @@
 	TPRINTF("Running reclaim single-thread test .. pass 1\n");
 	totalmemtest();
-	
+
 	TPRINTF("Running reclaim single-thread test .. pass 2\n");
 	totalmemtest();
-	
+
 	TPRINTF("Reclaim test OK.\n");
-	
+
 	multitest(128);
 	multitest(2048);
 	multitest(8192);
-	
+
 	return NULL;
 }
Index: kernel/test/print/print1.c
===================================================================
--- kernel/test/print/print1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/print/print1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -36,21 +36,21 @@
 	TPRINTF("Expected output: \"  tex\"\n");
 	TPRINTF("Real output:     \"%*.*s\"\n\n", 5, 3, "text");
-	
+
 	TPRINTF("Testing printf(\"%%10.8s\", \"very long text\"):\n");
 	TPRINTF("Expected output: \"  very lon\"\n");
 	TPRINTF("Real output:     \"%10.8s\"\n\n", "very long text");
-	
+
 	TPRINTF("Testing printf(\"%%8.10s\", \"text\"):\n");
 	TPRINTF("Expected output: \"    text\"\n");
 	TPRINTF("Real output:     \"%8.10s\"\n\n", "text");
-	
+
 	TPRINTF("Testing printf(\"%%8.10s\", \"very long text\"):\n");
 	TPRINTF("Expected output: \"very long \"\n");
 	TPRINTF("Real output:     \"%8.10s\"\n\n", "very long text");
-	
+
 	TPRINTF("Testing printf(\"%%-*.*s\", 7, 7, \"text\"):\n");
 	TPRINTF("Expected output: \"text   \"\n");
 	TPRINTF("Real output:     \"%-*.*s\"\n\n", 7, 7, "text");
-	
+
 	return NULL;
 }
Index: kernel/test/print/print2.c
===================================================================
--- kernel/test/print/print2.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/print/print2.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -36,24 +36,24 @@
 	TPRINTF("Expected output: [a]\n");
 	TPRINTF("Real output:     [%c]\n\n", 'a');
-	
+
 	TPRINTF("Testing printf(\"%%d %%3.2d %%-3.2d %%2.3d %%-2.3d\", 1, 2, 3, 4, 5):\n");
 	TPRINTF("Expected output: [1] [ 02] [03 ] [004] [005]\n");
 	TPRINTF("Real output:     [%d] [%3.2d] [%-3.2d] [%2.3d] [%-2.3d]\n\n", 1, 2, 3, 4, 5);
-	
+
 	TPRINTF("Testing printf(\"%%d %%3.2d %%-3.2d %%2.3d %%-2.3d\", -1, -2, -3, -4, -5):\n");
 	TPRINTF("Expected output: [-1] [-02] [-03] [-004] [-005]\n");
 	TPRINTF("Real output:     [%d] [%3.2d] [%-3.2d] [%2.3d] [%-2.3d]\n\n", -1, -2, -3, -4, -5);
-	
+
 	TPRINTF("Testing printf(\"%%lld %%3.2lld %%-3.2lld %%2.3lld %%-2.3lld\", (long long) -1, (long long) -2, (long long) -3, (long long) -4, (long long) -5):\n");
 	TPRINTF("Expected output: [-1] [-02] [-03] [-004] [-005]\n");
 	TPRINTF("Real output:     [%lld] [%3.2lld] [%-3.2lld] [%2.3lld] [%-2.3lld]\n\n", (long long) -1, (long long) -2, (long long) -3, (long long) -4, (long long) -5);
-	
+
 	TPRINTF("Testing printf(\"%%#x %%5.3#x %%-5.3#x %%3.5#x %%-3.5#x\", 17, 18, 19, 20, 21):\n");
 	TPRINTF("Expected output: [0x11] [0x012] [0x013] [0x00014] [0x00015]\n");
 	TPRINTF("Real output:     [%#x] [%#5.3x] [%#-5.3x] [%#3.5x] [%#-3.5x]\n\n", 17, 18, 19, 20, 21);
-	
+
 	char ch[12];
 	ptrdiff_t d, neg_d;
-	
+
 	d = &ch[0] - &ch[12];
 	neg_d = (unsigned)(-d);
@@ -61,11 +61,11 @@
 	TPRINTF("Expected output: [-12] [12] [c] [-12] [14]\n");
 	TPRINTF("Real output:     [%td] [%tu] [%tx] [%ti] [%to]\n\n", d, neg_d, neg_d, d, neg_d);
-	
+
 	sysarg_t nat = 0x12345678;
-	
+
 	TPRINTF("Testing printf(\"%%#" PRIx64 " %%#" PRIx32 " %%#" PRIx16 " %%#" PRIx8 " %%#" PRIxn " %%#" PRIx64 " %%s\", (uint64_t) UINT64_C(0x1234567887654321), (uint32_t) UINT32_C(0x12345678), (uint16_t) UINT16_C(0x1234), (uint8_t) UINT8_C(0x12), nat, (uint64_t) UINT64_C(0x1234567887654321), \"Lovely string\"):\n");
 	TPRINTF("Expected output: [0x1234567887654321] [0x12345678] [0x1234] [0x12] [0x12345678] [0x1234567887654321] \"Lovely string\"\n");
 	TPRINTF("Real output:     [%#" PRIx64 "] [%#" PRIx32 "] [%#" PRIx16 "] [%#" PRIx8 "] [%#" PRIxn "] [%#" PRIx64 "] \"%s\"\n\n", (uint64_t) UINT64_C(0x1234567887654321), (uint32_t) UINT32_C(0x12345678), (uint16_t) UINT16_C(0x1234), (uint8_t) UINT8_C(0x12), nat, (uint64_t) UINT64_C(0x1234567887654321), "Lovely string");
-	
+
 	return NULL;
 }
Index: kernel/test/print/print3.c
===================================================================
--- kernel/test/print/print3.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/print/print3.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -38,25 +38,25 @@
 	char buffer[BUFFER_SIZE];
 	int retval;
-	
+
 	TPRINTF("Testing snprintf(buffer, " STRING(BUFFER_SIZE) ", \"Short text without parameters.\"):\n");
 	TPRINTF("Expected result: retval=30 buffer=\"Short text without parameters.\"\n");
 	retval = snprintf(buffer, BUFFER_SIZE, "Short text without parameters.");
 	TPRINTF("Real result:     retval=%d buffer=\"%s\"\n\n", retval, buffer);
-	
+
 	TPRINTF("Testing snprintf(buffer, " STRING(BUFFER_SIZE) ", \"Very very very long text without parameters.\"):\n");
 	TPRINTF("Expected result: retval=44 buffer=\"Very very very long text withou\"\n");
 	retval = snprintf(buffer, BUFFER_SIZE, "Very very very long text without parameters.");
 	TPRINTF("Real result:     retval=%d buffer=\"%s\"\n\n", retval, buffer);
-	
+
 	TPRINTF("Testing snprintf(buffer, " STRING(BUFFER_SIZE) ", \"Short %%s.\", \"text\"):\n");
 	TPRINTF("Expected result: retval=11 buffer=\"Short text.\"\n");
 	retval = snprintf(buffer, BUFFER_SIZE, "Short %s.", "text");
 	TPRINTF("Real result:     retval=%d buffer=\"%s\"\n\n", retval, buffer);
-	
+
 	TPRINTF("Testing snprintf(buffer, " STRING(BUFFER_SIZE) ", \"Very long %%s. This text's length is more than %%d. We are interested in the result.\", \"text\", " STRING(BUFFER_SIZE) "):\n");
 	TPRINTF("Expected result: retval=84 buffer=\"Very long text. This text's len\"\n");
 	retval = snprintf(buffer, BUFFER_SIZE, "Very long %s. This text's length is more than %d. We are interested in the result.", "text", BUFFER_SIZE);
 	TPRINTF("Real result:     retval=%d buffer=\"%s\"\n\n", retval, buffer);
-	
+
 	return NULL;
 }
Index: kernel/test/print/print4.c
===================================================================
--- kernel/test/print/print4.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/print/print4.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -34,32 +34,32 @@
 {
 	TPRINTF("ASCII printable characters (32 - 127) using printf(\"%%c\") and printf(\"%%lc\"):\n");
-	
+
 	uint8_t group;
 	for (group = 1; group < 4; group++) {
 		TPRINTF("%#x: ", group << 5);
-		
+
 		uint8_t index;
 		for (index = 0; index < 32; index++)
 			TPRINTF("%c", (char) ((group << 5) + index));
-		
+
 		TPRINTF("  ");
 		for (index = 0; index < 32; index++)
 			TPRINTF("%lc", (wint_t) ((group << 5) + index));
-		
+
 		TPRINTF("\n");
 	}
-	
+
 	TPRINTF("\nExtended ASCII characters (128 - 255) using printf(\"%%lc\"):\n");
-	
+
 	for (group = 4; group < 8; group++) {
 		TPRINTF("%#x: ", group << 5);
-		
+
 		uint8_t index;
 		for (index = 0; index < 32; index++)
 			TPRINTF("%lc", (wint_t) ((group << 5) + index));
-		
+
 		TPRINTF("\n");
 	}
-	
+
 	TPRINTF("\nUTF-8 strings using printf(\"%%s\"):\n");
 	TPRINTF("English:  %s\n", "Quick brown fox jumps over the lazy dog");
@@ -70,5 +70,5 @@
 	TPRINTF("Russian:  %s\n", "Леннон познакомился с художницей-авангардисткой");
 	TPRINTF("Armenian: %s\n", "Սկսեց հրատարակվել Երուսաղեմի հայկական");
-	
+
 	TPRINTF("\nUTF-32 strings using printf(\"%%ls\"):\n");
 	TPRINTF("English:  %ls\n", L"Quick brown fox jumps over the lazy dog");
@@ -79,5 +79,5 @@
 	TPRINTF("Russian:  %ls\n", L"Леннон познакомился с художницей-авангардисткой");
 	TPRINTF("Armenian: %ls\n", L"Սկսեց հրատարակվել Երուսաղեմի հայկական");
-	
+
 	return NULL;
 }
Index: kernel/test/print/print5.c
===================================================================
--- kernel/test/print/print5.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/print/print5.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -48,9 +48,9 @@
 	TPRINTF("Expected output: \"(NULL)\"\n");
 	TPRINTF("Real output:     \"%s\"\n\n", (char *) NULL);
-	
+
 	TPRINTF("Testing printf(\"%%c %%3.2c %%-3.2c %%2.3c %%-2.3c\", 'a', 'b', 'c', 'd', 'e'):\n");
 	TPRINTF("Expected output: [a] [  b] [c  ] [ d] [e ]\n");
 	TPRINTF("Real output:     [%c] [%3.2c] [%-3.2c] [%2.3c] [%-2.3c]\n\n", 'a', 'b', 'c', 'd', 'e');
-	
+
 	return NULL;
 }
Index: kernel/test/smpcall/smpcall1.c
===================================================================
--- kernel/test/smpcall/smpcall1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/smpcall/smpcall1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -66,7 +66,7 @@
 	size_t *pcall_cnt = (size_t*)p;
 	smp_call_t call_info[MAX_CPUS];
-	
+
 	unsigned int cpu_count = min(config.cpu_active, MAX_CPUS);
-	
+
 	for (int iter = 0; iter < ITERATIONS; ++iter) {
 		/* Synchronous version. */
@@ -79,5 +79,5 @@
 			smp_call(cpu_id, inc, pcall_cnt);
 		}
-		
+
 		/*
 		 * Async calls run in parallel on different cpus, so passing the
@@ -85,10 +85,10 @@
 		 */
 		size_t local_cnt[MAX_CPUS] = {0};
-		
+
 		/* Now start asynchronous calls. */
 		for (unsigned cpu_id = 0; cpu_id < cpu_count; ++cpu_id) {
 			smp_call_async(cpu_id, inc, &local_cnt[cpu_id], &call_info[cpu_id]);
 		}
-		
+
 		/* And wait for all async calls to complete. */
 		for (unsigned cpu_id = 0; cpu_id < cpu_count; ++cpu_id) {
@@ -112,15 +112,15 @@
 	size_t call_cnt[MAX_CPUS] = {0};
 	thread_t *thread[MAX_CPUS] = { NULL };
-	
+
 	unsigned int cpu_count = min(config.cpu_active, MAX_CPUS);
 	size_t running_thread_cnt = 0;
 
 	TPRINTF("Spawning threads on %u cpus.\n", cpu_count);
-	
+
 	/* Create a wired thread on each cpu. */
 	for (unsigned int id = 0; id < cpu_count; ++id) {
 		thread[id] = thread_create(test_thread, &call_cnt[id], TASK,
 			THREAD_FLAG_NONE, "smp-call-test");
-		
+
 		if (thread[id]) {
 			thread_wire(thread[id], &cpus[id]);
@@ -133,5 +133,5 @@
 	size_t exp_calls = calc_exp_calls(running_thread_cnt);
 	size_t exp_calls_sum = exp_calls * cpu_count;
-	
+
 	TPRINTF("Running %zu wired threads. Expecting %zu calls. Be patient.\n",
 		running_thread_cnt, exp_calls_sum);
@@ -142,5 +142,5 @@
 		}
 	}
-	
+
 	/* Wait for threads to complete. */
 	for (unsigned int i = 0; i < cpu_count; ++i) {
@@ -152,8 +152,8 @@
 
 	TPRINTF("Threads finished. Checking number of smp_call()s.\n");
-	
+
 	bool ok = true;
 	size_t calls_sum = 0;
-	
+
 	for (size_t i = 0; i < cpu_count; ++i) {
 		if (thread[i] != NULL) {
@@ -164,15 +164,15 @@
 			}
 		}
-		
+
 		calls_sum += call_cnt[i];
 	}
-	
+
 	if (calls_sum != exp_calls_sum) {
 		TPRINTF("Error: total acknowledged sum: %zu instead of %zu.\n",
 			calls_sum, exp_calls_sum);
-		
+
 		ok = false;
 	}
-	
+
 	if (ok) {
 		TPRINTF("Success: number of received smp_calls is as expected (%zu).\n",
@@ -181,4 +181,4 @@
 	} else
 		return "Failed: incorrect acknowledged smp_calls.\n";
-	
+
 }
Index: kernel/test/synch/rcu1.c
===================================================================
--- kernel/test/synch/rcu1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/synch/rcu1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -67,5 +67,5 @@
 		TPRINTF(".");
 	}
-	
+
 	if (!p->exited) {
 		*presult = ETIMEOUT;
@@ -81,8 +81,8 @@
 {
 	assert(thread[k] == NULL);
-	
+
 	thread[k] = thread_create(func, arg, TASK, THREAD_FLAG_NONE,
 		"test-rcu-thread");
-		
+
 	if(thread[k]) {
 		/* Distribute evenly. */
@@ -95,7 +95,7 @@
 {
 	size_t thread_cnt = get_thread_cnt();
-	
+
 	one_idx = 0;
-	
+
 	for (size_t i = 0; i < thread_cnt; ++i) {
 		run_thread(i, func, NULL);
@@ -106,7 +106,7 @@
 {
 	size_t thread_cnt = get_thread_cnt();
-	
+
 	one_idx = 0;
-	
+
 	for (size_t i = 0; i < thread_cnt; ++i) {
 		if (thread[i]) {
@@ -115,10 +115,10 @@
 				errno_t ret = thread_join_timeout(thread[i], 5 * 1000 * 1000, 0);
 				joined = (ret != ETIMEOUT);
-				
+
 				if (ret == EOK) {
 					TPRINTF("%zu threads remain\n", thread_cnt - i - 1);
 				}
 			} while (!joined);
-			
+
 			thread_detach(thread[i]);
 			thread[i] = NULL;
@@ -140,5 +140,5 @@
 
 	--one_idx;
-	
+
 	if (thread[one_idx]) {
 		thread_join(thread[one_idx]);
@@ -154,12 +154,12 @@
 {
 	size_t nop_iters = (size_t)arg;
-	
+
 	TPRINTF("Enter nop-reader\n");
-	
+
 	for (size_t i = 0; i < nop_iters; ++i) {
 		rcu_read_lock();
 		rcu_read_unlock();
 	}
-	
+
 	TPRINTF("Exit nop-reader\n");
 }
@@ -169,9 +169,9 @@
 	assert(0 < steps && from <= to && 0 < to);
 	size_t inc = (to - from) / (steps - 1);
-	
+
 	for (size_t i = 0; i < steps - 1; ++i) {
 		seq[i] = i * inc + from;
 	}
-	
+
 	seq[steps - 1] = to;
 }
@@ -181,13 +181,13 @@
 	size_t seq[MAX_THREADS] = {0};
 	get_seq(100, 100000, get_thread_cnt(), seq);
-	
+
 	TPRINTF("\nRun %zu thr: repeat empty no-op reader sections\n", get_thread_cnt());
-	
+
 	for (size_t k = 0; k < get_thread_cnt(); ++k)
 		run_one(nop_reader, (void*)seq[k]);
-	
+
 	TPRINTF("\nJoining %zu no-op readers\n", get_thread_cnt());
 	join_all();
-	
+
 	return true;
 }
@@ -202,17 +202,17 @@
 	size_t nop_iters = (size_t)arg;
 	size_t outer_iters = iter_cnt / nop_iters;
-	
+
 	TPRINTF("Enter long-reader\n");
-	
+
 	for (size_t i = 0; i < outer_iters; ++i) {
 		rcu_read_lock();
-		
+
 		for (volatile size_t k = 0; k < nop_iters; ++k) {
 			/* nop, but increment volatile k */
 		}
-		
+
 		rcu_read_unlock();
 	}
-	
+
 	TPRINTF("Exit long-reader\n");
 }
@@ -222,14 +222,14 @@
 	size_t seq[MAX_THREADS] = {0};
 	get_seq(10, 1000 * 1000, get_thread_cnt(), seq);
-	
+
 	TPRINTF("\nRun %zu thr: repeat long reader sections, will preempt, no cbs.\n",
 		get_thread_cnt());
-	
+
 	for (size_t k = 0; k < get_thread_cnt(); ++k)
 		run_one(long_reader, (void*)seq[k]);
-	
+
 	TPRINTF("\nJoining %zu readers with long reader sections.\n", get_thread_cnt());
 	join_all();
-	
+
 	return true;
 }
@@ -253,5 +253,5 @@
 		rcu_item_t *a = malloc(sizeof(rcu_item_t), FRAME_ATOMIC);
 		rcu_item_t *b = malloc(sizeof(rcu_item_t), FRAME_ATOMIC);
-		
+
 		if (a && b) {
 			rcu_call(a, count_cb);
@@ -272,12 +272,12 @@
 	size_t exp_cnt = nop_updater_iters * get_thread_cnt();
 	size_t max_used_mem = sizeof(rcu_item_t) * exp_cnt;
-	
+
 	TPRINTF("\nRun %zu thr: post %zu no-op callbacks (%zu B used), no readers.\n",
 		get_thread_cnt(), exp_cnt, max_used_mem);
-	
+
 	run_all(nop_updater);
 	TPRINTF("\nJoining %zu no-op callback threads\n", get_thread_cnt());
 	join_all();
-	
+
 	size_t loop_cnt = 0, max_loops = 15;
 
@@ -287,5 +287,5 @@
 		thread_sleep(1);
 	}
-	
+
 	return loop_cnt < max_loops;
 }
@@ -312,9 +312,9 @@
 {
 	TPRINTF("Enter one-cb-reader\n");
-	
-	rcu_read_lock();
-	
+
+	rcu_read_lock();
+
 	item_w_cookie_t *item = malloc(sizeof(item_w_cookie_t), FRAME_ATOMIC);
-	
+
 	if (item) {
 		item->cookie = magic_cookie;
@@ -323,9 +323,9 @@
 		TPRINTF("\n[out-of-mem]\n");
 	}
-	
+
 	thread_sleep(1);
-	
+
 	rcu_read_unlock();
-	
+
 	TPRINTF("Exit one-cb-reader\n");
 }
@@ -334,18 +334,18 @@
 {
 	one_cb_is_done = 0;
-	
+
 	TPRINTF("\nRun a single reader that posts one callback.\n");
 	run_one(one_cb_reader, NULL);
 	join_one();
-	
+
 	TPRINTF("\nJoined one-cb reader, wait for callback.\n");
 	size_t loop_cnt = 0;
 	size_t max_loops = 4; /* 200 ms total */
-	
+
 	while (!one_cb_is_done && loop_cnt < max_loops) {
 		thread_usleep(50 * 1000);
 		++loop_cnt;
 	}
-	
+
 	return one_cb_is_done;
 }
@@ -373,9 +373,9 @@
 {
 	seq_item_t *item = member_to_inst(rcu_item, seq_item_t, rcu);
-	
+
 	/* Racy but errs to the conservative side, so it is ok. */
 	if (max_upd_done_time < item->start_time) {
 		max_upd_done_time = item->start_time;
-		
+
 		/* Make updated time visible */
 		memory_barrier();
@@ -393,5 +393,5 @@
 #ifndef KARCH_riscv64
 	seq_work_t *work = (seq_work_t*)arg;
-	
+
 	/* Alternate between reader and updater roles. */
 	for (size_t k = 0; k < work->iters; ++k) {
@@ -400,31 +400,31 @@
 			rcu_read_lock();
 			atomic_count_t start_time = atomic_postinc(&cur_time);
-			
+
 			for (volatile size_t d = 0; d < 10 * i; ++d ){
 				/* no-op */
 			}
-			
+
 			/* Get most recent max_upd_done_time. */
 			memory_barrier();
-			
+
 			if (start_time < max_upd_done_time) {
 				seq_test_result = ERACE;
 			}
-			
+
 			rcu_read_unlock();
-			
+
 			if (seq_test_result != EOK)
 				return;
 		}
-		
+
 		/* Updater */
 		for (size_t i = 0; i < work->update_cnt; ++i) {
 			seq_item_t *a = malloc(sizeof(seq_item_t), FRAME_ATOMIC);
 			seq_item_t *b = malloc(sizeof(seq_item_t), FRAME_ATOMIC);
-			
+
 			if (a && b) {
 				a->start_time = atomic_postinc(&cur_time);
 				rcu_call(&a->rcu, seq_cb);
-				
+
 				b->start_time = atomic_postinc(&cur_time);
 				rcu_call(&b->rcu, seq_cb);
@@ -437,5 +437,5 @@
 			}
 		}
-		
+
 	}
 #else
@@ -454,10 +454,10 @@
 	size_t read_cnt[MAX_THREADS] = {0};
 	seq_work_t item[MAX_THREADS];
-	
+
 	size_t total_cbs = 0;
 	size_t max_used_mem = 0;
-	
+
 	get_seq(0, total_cnt, get_thread_cnt(), read_cnt);
-	
+
 
 	for (size_t i = 0; i < get_thread_cnt(); ++i) {
@@ -465,8 +465,8 @@
 		item[i].read_cnt = read_cnt[i];
 		item[i].iters = iters;
-		
+
 		total_cbs += 2 * iters * item[i].update_cnt;
 	}
-	
+
 	max_used_mem = total_cbs * sizeof(seq_item_t);
 
@@ -474,16 +474,16 @@
 	uint64_t mem_units;
 	bin_order_suffix(max_used_mem, &mem_units, &mem_suffix, false);
-	
+
 	TPRINTF("\nRun %zu th: check callback completion time in readers. "
 		"%zu callbacks total (max %" PRIu64 " %s used). Be patient.\n",
 		get_thread_cnt(), total_cbs, mem_units, mem_suffix);
-	
+
 	for (size_t i = 0; i < get_thread_cnt(); ++i) {
 		run_one(seq_func, &item[i]);
 	}
-	
+
 	TPRINTF("\nJoining %zu seq-threads\n", get_thread_cnt());
 	join_all();
-	
+
 	if (seq_test_result == ENOMEM) {
 		TPRINTF("\nErr: out-of mem\n");
@@ -491,5 +491,5 @@
 		TPRINTF("\nERROR: race detected!!\n");
 	}
-	
+
 	return seq_test_result == EOK;
 }
@@ -510,10 +510,10 @@
 	rcu_read_lock();
 	rcu_read_unlock();
-	
+
 	rcu_call((rcu_item_t*)arg, reader_unlocked);
-	
-	rcu_read_lock();
-	rcu_read_lock();
-	
+
+	rcu_read_lock();
+	rcu_read_lock();
+
 	/* Exit without unlocking the rcu reader section. */
 }
@@ -522,5 +522,5 @@
 {
 	TPRINTF("\nReader exits thread with rcu_lock\n");
-	
+
 	exited_t *p = malloc(sizeof(exited_t), FRAME_ATOMIC);
 	if (!p) {
@@ -528,13 +528,13 @@
 		return false;
 	}
-		
+
 	p->exited = false;
-	
+
 	run_one(reader_exit, p);
 	join_one();
-	
+
 	errno_t result = EOK;
 	wait_for_cb_exit(2 /* secs */, p, &result);
-	
+
 	if (result != EOK) {
 		TPRINTF("Err: RCU locked up after exiting from within a reader\n");
@@ -543,5 +543,5 @@
 		free(p);
 	}
-	
+
 	return result == EOK;
 }
@@ -570,5 +570,5 @@
 
 	TPRINTF("reader_prev{ ");
-	
+
 	rcu_read_lock();
 	scheduler();
@@ -588,5 +588,5 @@
 	preempt_t *p = (preempt_t*)arg;
 	assert(!p->e.exited);
-	
+
 	TPRINTF("reader_inside_cur{ ");
 	/*
@@ -613,5 +613,5 @@
 	preempt_t *p = (preempt_t*)arg;
 	assert(!p->e.exited);
-	
+
 	TPRINTF("reader_cur{ ");
 	rcu_read_lock();
@@ -622,5 +622,5 @@
 	/* Preempt while cur GP detection is running */
 	thread_sleep(1);
-	
+
 	/* Err: exited before this reader completed. */
 	if (p->e.exited)
@@ -635,5 +635,5 @@
 	preempt_t *p = (preempt_t*)arg;
 	assert(!p->e.exited);
-	
+
 	TPRINTF("reader_next1{ ");
 	rcu_read_lock();
@@ -641,5 +641,5 @@
 	/* Preempt before cur GP detection starts. */
 	scheduler();
-	
+
 	/* Start GP. */
 	rcu_call(&p->e.rcu, preempted_unlocked);
@@ -657,5 +657,5 @@
 	preempt_t *p = (preempt_t*)arg;
 	assert(!p->e.exited);
-	
+
 	TPRINTF("reader_next2{ ");
 	rcu_read_lock();
@@ -663,5 +663,5 @@
 	/* Preempt before cur GP detection starts. */
 	scheduler();
-	
+
 	/* Start GP. */
 	rcu_call(&p->e.rcu, preempted_unlocked);
@@ -691,14 +691,14 @@
 		return false;
 	}
-	
+
 	p->e.exited = false;
 	p->result = EOK;
-	
+
 	run_one(f, p);
 	join_one();
-	
+
 	/* Wait at most 4 secs. */
 	wait_for_cb_exit(4, &p->e, &p->result);
-	
+
 	if (p->result == EOK) {
 		free(p);
@@ -714,20 +714,20 @@
 {
 	TPRINTF("\nReaders will be preempted.\n");
-	
+
 	bool success = true;
 	bool ok = true;
-	
+
 	ok = do_one_reader_preempt(preempted_reader_prev,
 		"Err: preempted_reader_prev()\n");
 	success = success && ok;
-	
+
 	ok = do_one_reader_preempt(preempted_reader_inside_cur,
 		"Err: preempted_reader_inside_cur()\n");
 	success = success && ok;
-	
+
 	ok = do_one_reader_preempt(preempted_reader_cur,
 		"Err: preempted_reader_cur()\n");
 	success = success && ok;
-	
+
 	ok = do_one_reader_preempt(preempted_reader_next1,
 		"Err: preempted_reader_next1()\n");
@@ -737,5 +737,5 @@
 		"Err: preempted_reader_next2()\n");
 	success = success && ok;
-	
+
 	return success;
 }
@@ -751,22 +751,22 @@
 {
 	synch_t *synch = (synch_t *) arg;
-	
+
 	rcu_read_lock();
 
 	/* Order accesses of synch after the reader section begins. */
 	memory_barrier();
-	
+
 	synch->reader_running = true;
-	
+
 	while (!synch->synch_running) {
 		/* 0.5 sec */
 		delay(500 * 1000);
 	}
-	
+
 	/* Run for 1 sec */
 	delay(1000 * 1000);
 	/* thread_join() propagates done to do_synch() */
 	synch->reader_done = true;
-	
+
 	rcu_read_unlock();
 }
@@ -776,18 +776,18 @@
 {
 	TPRINTF("\nSynchronize with long reader\n");
-	
+
 	synch_t *synch = malloc(sizeof(synch_t), FRAME_ATOMIC);
-	
+
 	if (!synch) {
 		TPRINTF("[out-of-mem]\n");
 		return false;
 	}
-	
+
 	synch->reader_done = false;
 	synch->reader_running = false;
 	synch->synch_running = false;
-	
+
 	run_one(synch_reader, synch);
-	
+
 	/* Wait for the reader to enter its critical section. */
 	scheduler();
@@ -795,11 +795,11 @@
 		thread_usleep(500 * 1000);
 	}
-	
+
 	synch->synch_running = true;
-	
+
 	rcu_synchronize();
 	join_one();
-	
-	
+
+
 	if (synch->reader_done) {
 		free(synch);
@@ -827,17 +827,17 @@
 {
 	TPRINTF("\nrcu_barrier: Wait for outstanding rcu callbacks to complete\n");
-	
+
 	barrier_t *barrier = malloc(sizeof(barrier_t), FRAME_ATOMIC);
-	
+
 	if (!barrier) {
 		TPRINTF("[out-of-mem]\n");
 		return false;
 	}
-	
+
 	atomic_set(&barrier->done, 0);
-	
+
 	rcu_call(&barrier->rcu_item, barrier_callback);
 	rcu_barrier();
-	
+
 	if (1 == atomic_get(&barrier->done)) {
 		free(barrier);
@@ -861,9 +861,9 @@
 {
 	bool *done = (bool*) arg;
-	
+
 	while (!*done) {
 		rcu_read_lock();
 		rcu_read_unlock();
-		
+
 		/*
 		 * Do some work outside of the reader section so we are not always
@@ -884,8 +884,8 @@
 {
 	stress_t *s = (stress_t *)arg;
-	
+
 	for (size_t i = 0; i < s->iters; ++i) {
 		rcu_item_t *item = malloc(sizeof(rcu_item_t), FRAME_ATOMIC);
-		
+
 		if (item) {
 			rcu_call(item, stress_cb);
@@ -894,5 +894,5 @@
 			return;
 		}
-		
+
 		/* Print a dot if we make a progress of 1% */
 		if (s->master && 0 == (i % (s->iters/100)))
@@ -907,13 +907,13 @@
 	stress_t master = { .iters = cb_per_thread, .master = true };
 	stress_t worker = { .iters = cb_per_thread, .master = false };
-	
+
 	size_t thread_cnt = min(MAX_THREADS / 2, config.cpu_active);
 	/* Each cpu has one reader and one updater. */
 	size_t reader_cnt = thread_cnt;
 	size_t updater_cnt = thread_cnt;
-	
+
 	size_t exp_upd_calls = updater_cnt * cb_per_thread;
 	size_t max_used_mem = exp_upd_calls * sizeof(rcu_item_t);
-	
+
 	const char *mem_suffix;
 	uint64_t mem_units;
@@ -923,5 +923,5 @@
 		" total (max %" PRIu64 " %s used). Be very patient.\n",
 		reader_cnt, updater_cnt, exp_upd_calls, mem_units, mem_suffix);
-	
+
 	for (size_t k = 0; k < reader_cnt; ++k) {
 		run_one(stress_reader, &done);
@@ -931,15 +931,15 @@
 		run_one(stress_updater, k > 0 ? &worker : &master);
 	}
-	
+
 	TPRINTF("\nJoining %zu stress updaters.\n", updater_cnt);
-	
+
 	for (size_t k = 0; k < updater_cnt; ++k) {
 		join_one();
 	}
-	
+
 	done = true;
 
 	TPRINTF("\nJoining %zu stress nop-readers.\n", reader_cnt);
-	
+
 	join_all();
 	return true;
@@ -957,12 +957,12 @@
 {
 	expedite_t *e = (expedite_t *)arg;
-	
+
 	if (1 < e->count_down) {
 		--e->count_down;
-		
+
 		if (0 == (e->count_down % (e->total_cnt/100))) {
 			TPRINTF("*");
 		}
-		
+
 		_rcu_call(e->expedite, &e->r, expedite_cb);
 	} else {
@@ -979,7 +979,7 @@
 	e.count_down = cnt;
 	e.expedite = exp;
-	
+
 	_rcu_call(e.expedite, &e.r, expedite_cb);
-	
+
 	while (0 < e.count_down) {
 		thread_sleep(1);
@@ -992,5 +992,5 @@
 	size_t exp_cnt = 1000 * 1000;
 	size_t normal_cnt = 1 * 1000;
-	
+
 	TPRINTF("Expedited: sequence of %zu rcu_calls\n", exp_cnt);
 	run_expedite(true, exp_cnt);
@@ -1024,10 +1024,10 @@
 		{ 0, NULL, NULL }
 	};
-	
+
 	bool success = true;
 	bool ok = true;
 	uint64_t completed_gps = rcu_completed_gps();
 	uint64_t delta_gps = 0;
-	
+
 	for (int i = 0; test_func[i].func; ++i) {
 		if (!test_func[i].include) {
@@ -1037,8 +1037,8 @@
 			TPRINTF("\nRunning subtest %s.\n", test_func[i].desc);
 		}
-		
+
 		ok = test_func[i].func();
 		success = success && ok;
-		
+
 		delta_gps = rcu_completed_gps() - completed_gps;
 		completed_gps += delta_gps;
Index: kernel/test/synch/semaphore1.c
===================================================================
--- kernel/test/synch/semaphore1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/synch/semaphore1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -49,7 +49,7 @@
 {
 	thread_detach(THREAD);
-	
+
 	waitq_sleep(&can_start);
-	
+
 	semaphore_down(&sem);
 	atomic_inc(&items_produced);
@@ -61,7 +61,7 @@
 {
 	thread_detach(THREAD);
-	
+
 	waitq_sleep(&can_start);
-	
+
 	semaphore_down(&sem);
 	atomic_inc(&items_consumed);
@@ -75,20 +75,20 @@
 	atomic_count_t consumers;
 	atomic_count_t producers;
-	
+
 	waitq_initialize(&can_start);
 	semaphore_initialize(&sem, AT_ONCE);
-	
+
 	for (i = 1; i <= 3; i++) {
 		thread_t *thrd;
-		
+
 		atomic_set(&items_produced, 0);
 		atomic_set(&items_consumed, 0);
-		
+
 		consumers = i * CONSUMERS;
 		producers = (4 - i) * PRODUCERS;
-		
+
 		TPRINTF("Creating %" PRIua " consumers and %" PRIua " producers...",
 		    consumers, producers);
-		
+
 		for (j = 0; j < (CONSUMERS + PRODUCERS) / 2; j++) {
 			for (k = 0; k < i; k++) {
@@ -109,10 +109,10 @@
 			}
 		}
-		
+
 		TPRINTF("ok\n");
-		
+
 		thread_sleep(1);
 		waitq_wakeup(&can_start, WAKEUP_ALL);
-		
+
 		while ((items_consumed.count != consumers) || (items_produced.count != producers)) {
 			TPRINTF("%" PRIua " consumers remaining, %" PRIua " producers remaining\n",
@@ -121,5 +121,5 @@
 		}
 	}
-	
+
 	return NULL;
 }
Index: kernel/test/synch/semaphore2.c
===================================================================
--- kernel/test/synch/semaphore2.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/synch/semaphore2.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -50,5 +50,5 @@
 {
 	uint32_t rc;
-	
+
 	spinlock_lock(&sem_lock);
 	rc = seed % max;
@@ -62,9 +62,9 @@
 	errno_t rc;
 	int to;
-	
+
 	thread_detach(THREAD);
-	
+
 	waitq_sleep(&can_start);
-	
+
 	to = random(20000);
 	TPRINTF("cpu%u, tid %" PRIu64 " down+ (%d)\n", CPU->id, THREAD->tid, to);
@@ -74,8 +74,8 @@
 		return;
 	}
-	
+
 	TPRINTF("cpu%u, tid %" PRIu64 " down=\n", CPU->id, THREAD->tid);
 	thread_usleep(random(30000));
-	
+
 	semaphore_up(&sem);
 	TPRINTF("cpu%u, tid %" PRIu64 " up\n", CPU->id, THREAD->tid);
@@ -85,10 +85,10 @@
 {
 	uint32_t i, k;
-	
+
 	waitq_initialize(&can_start);
 	semaphore_initialize(&sem, 5);
-	
+
 	thread_t *thrd;
-	
+
 	k = random(7) + 1;
 	TPRINTF("Creating %" PRIu32 " consumers\n", k);
@@ -101,8 +101,8 @@
 			TPRINTF("Error creating thread\n");
 	}
-	
+
 	thread_usleep(20000);
 	waitq_wakeup(&can_start, WAKEUP_ALL);
-	
+
 	return NULL;
 }
Index: kernel/test/synch/workq-test-core.h
===================================================================
--- kernel/test/synch/workq-test-core.h	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/synch/workq-test-core.h	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -54,5 +54,5 @@
 {
 	++work->wave;
-	
+
 	if (work->wave < WAVES) {
 		work->count_down = COUNT;
@@ -79,5 +79,5 @@
 		child->count_down = work->count_down;
 	}
-	
+
 	return child;
 }
@@ -93,9 +93,9 @@
 	/* Ensure work_item is ours for the taking. */
 	memsetb(work_item, sizeof(work_t), 0xec);
-	
+
 	test_work_t *work = (test_work_t *)work_item;
-	
+
 	atomic_inc(&call_cnt[work->wave]);
-	
+
 	if (0 < work->count_down) {
 		/* Sleep right before creating the last generation. */
@@ -108,5 +108,5 @@
 			}
 		}
-		
+
 		--work->count_down;
 
@@ -122,5 +122,5 @@
 			}
 		}
-		
+
 		if (!core_workq_enqueue(work_item, reproduce)) {
 			if (work->master)
@@ -131,5 +131,5 @@
 	} else {
 		/* We're done with this wave - only the master survives. */
-		
+
 		if (work->master && new_wave(work)) {
 			if (!core_workq_enqueue(work_item, reproduce)) {
@@ -140,5 +140,5 @@
 			if (work->master)
 				TPRINTF("\nMaster work item done.\n");
-				
+
 			free_work(work);
 		}
@@ -157,5 +157,5 @@
 	work->wave = 0;
 	work->count_down = COUNT;
-	
+
 	/*
 	 * k == COUNT_POW
@@ -166,16 +166,16 @@
 	 */
 	size_t exp_call_cnt = (COUNT_POW + 2) * (1 << (COUNT_POW - 1));
-	
+
 	TPRINTF("waves: %d, count_down: %d, total expected calls: %zu\n",
 		WAVES, COUNT, exp_call_cnt * WAVES);
-	
+
 
 	core_workq_enqueue(&work->work_item, reproduce);
-	
+
 	size_t sleep_cnt = 0;
 	/* At least 40 seconds total (or 2 sec to end while there's work). */
 	size_t max_sleep_secs = end_prematurely ? 2 : MAIN_MAX_SLEEP_SEC;
 	size_t max_sleep_cnt = (max_sleep_secs * 1000) / MAIN_POLL_SLEEP_MS;
-	
+
 	for (int i = 0; i < WAVES; ++i) {
 		while (atomic_get(&call_cnt[i]) < exp_call_cnt
@@ -186,7 +186,7 @@
 		}
 	}
-	
+
 	bool success = true;
-	
+
 	for (int i = 0; i < WAVES; ++i) {
 		if (atomic_get(&call_cnt[i]) == exp_call_cnt) {
@@ -199,6 +199,6 @@
 		}
 	}
-	
-	
+
+
 	if (success)
 		return NULL;
Index: kernel/test/synch/workqueue2.c
===================================================================
--- kernel/test/synch/workqueue2.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/synch/workqueue2.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -63,5 +63,5 @@
 	basic_done = 0;
 	workq_global_enqueue(&basic_work, basic_test_work);
-	
+
 	while (!basic_done) {
 		TPRINTF(".");
@@ -87,14 +87,14 @@
 {
 	workq = workq_create(qname);
-	
+
 	if (!workq) {
 		return "Failed to create a work queue.\n";
 	}
-	
+
 	const char *ret = run_workq_core(stop);
-	
+
 	TPRINTF("Stopping work queue...\n");
 	workq_stop(workq);
-	
+
 	TPRINTF("Destroying work queue...\n");
 	workq_destroy(workq);
@@ -123,7 +123,7 @@
 	const char *err = NULL;
 	const char *res;
-	
+
 	basic_test();
-	
+
 	res = test_custom_workq();
 	if (res) {
@@ -131,5 +131,5 @@
 		err = res;
 	}
-	
+
 	res = test_custom_workq_stop();
 	if (res) {
@@ -137,5 +137,5 @@
 		err = res;
 	}
-	
+
 	res = test_workqueue3();
 	if (res) {
Index: kernel/test/synch/workqueue3.c
===================================================================
--- kernel/test/synch/workqueue3.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/synch/workqueue3.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -66,5 +66,5 @@
 
 	TPRINTF("Done.\n");
-	
+
 	return err;
 }
Index: kernel/test/test.c
===================================================================
--- kernel/test/test.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/test.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -75,14 +75,14 @@
 	size_t len = str_length(input);
 	test_t **test = (test_t **) ctx;
-	
+
 	if (*test == NULL)
 		*test = tests;
-	
+
 	for (; (*test)->name; (*test)++) {
 		const char *curname = (*test)->name;
-		
+
 		if (str_length(curname) < len)
 			continue;
-		
+
 		if (str_lcmp(input, curname, len) == 0) {
 			(*test)++;
@@ -92,5 +92,5 @@
 		}
 	}
-	
+
 	return NULL;
 }
Index: kernel/test/thread/thread1.c
===================================================================
--- kernel/test/thread/thread1.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
+++ kernel/test/thread/thread1.c	(revision db3c88347157ed2aeffe98179283d9e4e0243edd)
@@ -45,5 +45,5 @@
 {
 	thread_detach(THREAD);
-	
+
 	while (atomic_get(&finish)) {
 		TPRINTF("%" PRIu64 " ", THREAD->tid);
@@ -57,8 +57,8 @@
 	unsigned int i;
 	atomic_count_t total = 0;
-	
+
 	atomic_set(&finish, 1);
 	atomic_set(&threads_finished, 0);
-	
+
 	for (i = 0; i < THREADS; i++) {
 		thread_t *t;
@@ -71,8 +71,8 @@
 		total++;
 	}
-	
+
 	TPRINTF("Running threads for 10 seconds...\n");
 	thread_sleep(10);
-	
+
 	atomic_set(&finish, 0);
 	while (atomic_get(&threads_finished) < total) {
@@ -80,5 +80,5 @@
 		thread_sleep(1);
 	}
-	
+
 	return NULL;
 }
