Index: uspace/app/rcutest/rcutest.c
===================================================================
--- uspace/app/rcutest/rcutest.c	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ uspace/app/rcutest/rcutest.c	(revision 34e1206ec4dc79f0592077e3ee270fba91d1eb9d)
@@ -174,10 +174,10 @@
 {
 	fid_t fid = fibril_create(func, arg);
-	
+
 	if (0 == fid) {
 		printf("Failed to create a fibril!\n");
 		return false;
 	}
-	
+
 	fibril_add_ready(fid);
 	return true;
@@ -190,12 +190,12 @@
 	size_t failed_cnt = 0;
 	size_t ok_cnt = 0;
-	
+
 	for (size_t i = 0; i < test_desc_cnt; ++i) {
 		test_desc_t *t = &test_desc[i];
-		
+
 		if (t->func && !t->aggregate && include_filter(t)) {
 			printf("Running \'%s\'...\n", t->name);
 			bool ok = test_desc[i].func(info);
-			
+
 			if (ok) {
 				++ok_cnt;
@@ -207,5 +207,5 @@
 		}
 	}
-	
+
 	printf("\n");
 
@@ -215,5 +215,5 @@
 		printf("%zu tests failed\n", failed_cnt);
 	}
-	
+
 	return 0 == failed_cnt;
 }
@@ -273,5 +273,5 @@
 	/* nop */
 	rcu_read_unlock();
-	
+
 	rcu_synchronize();
 
@@ -284,9 +284,9 @@
 	fibril_yield();
 	rcu_read_unlock();
-	
+
 	fibril_yield();
 	rcu_synchronize();
 	rcu_synchronize();
-	
+
 	rcu_read_lock();
 	/* nop */
@@ -295,5 +295,5 @@
 
 	rcu_read_unlock();
-	
+
 	return !rcu_read_locked();
 }
@@ -312,5 +312,5 @@
 {
 	rcu_register_fibril();
-	
+
 	printf("lock{");
 	rcu_read_lock();
@@ -324,14 +324,14 @@
 	++arg->done_sleeps_cnt;
 	printf("}");
-	
+
 	if (arg->synched) {
 		arg->failed = 1;
 		printf("Error: rcu_sync exited prematurely.\n");
 	}
-	
+
 	arg->exited_cs = true;
 	rcu_read_unlock();
 	printf("}");
-	
+
 	rcu_deregister_fibril();
 	return 0;
@@ -341,16 +341,16 @@
 {
 	one_reader_info_t info = { 0 };
-	
+
 	if (!create_fibril((fibril_func_t) sleeping_reader, &info))
 		return false;
-	
+
 	/* 1 sec, waits for the reader to enter its critical section and sleep. */
 	async_usleep(1 * USECS_PER_SEC);
-	
+
 	if (!info.entered_cs || info.exited_cs) {
 		printf("Error: reader is unexpectedly outside of critical section.\n");
 		return false;
 	}
-	
+
 	info.synching = true;
 	printf("sync[");
@@ -361,5 +361,5 @@
 	/* Load info.exited_cs */
 	memory_barrier();
-	
+
 	if (!info.exited_cs || info.failed) {
 		printf("Error: rcu_sync() returned before the reader exited its CS.\n");
@@ -394,9 +394,9 @@
 {
 	rcu_register_fibril();
-	
+
 	printf("old-lock{");
 	rcu_read_lock();
 	arg->old_entered_cs = true;
-	
+
 	printf("wait-for-sync{");
 	/* Wait for rcu_sync() to start waiting for us. */
@@ -405,7 +405,7 @@
 	}
 	printf(" }");
-	
+
 	/* A new reader starts while rcu_sync() is in progress. */
-	
+
 	printf("wait-for-new-R{");
 	/* Wait for the new reader to enter its reader section. */
@@ -414,17 +414,17 @@
 	}
 	printf(" }");
-	
+
 	arg->old_exited_cs = true;
-	
+
 	assert(!arg->new_exited_cs);
-	
+
 	if (arg->synched) {
 		arg->failed = 1;
 		printf("Error: rcu_sync() did not wait for preexisting reader.\n");
 	}
-	
+
 	rcu_read_unlock();
 	printf(" }");
-	
+
 	rcu_deregister_fibril();
 	return 0;
@@ -434,10 +434,10 @@
 {
 	rcu_register_fibril();
-	
+
 	/* Wait until rcu_sync() starts. */
 	while (!arg->synching) {
 		async_usleep(WAIT_STEP_US);
 	}
-	
+
 	/*
 	 * synching is set when rcu_sync() is about to be entered so wait
@@ -445,5 +445,5 @@
 	 */
 	async_usleep(WAIT_STEP_US);
-	
+
 	printf("new-lock(");
 	rcu_read_lock();
@@ -454,9 +454,9 @@
 		async_usleep(WAIT_STEP_US);
 	}
-	
+
 	arg->new_exited_cs = true;
 	/* Write new_exited_cs before exiting reader section. */
 	memory_barrier();
-	
+
 	/*
 	 * Preexisting reader should have exited by now, so rcu_synchronize()
@@ -467,5 +467,5 @@
 		printf("Error: preexisting reader should have exited by now!\n");
 	}
-	
+
 	rcu_read_unlock();
 	printf(")");
@@ -478,5 +478,5 @@
 {
 	two_reader_info_t info = { 0 };
-	
+
 	if (!create_fibril((fibril_func_t) preexisting_reader, &info))
 		return false;
@@ -484,33 +484,33 @@
 	if (!create_fibril((fibril_func_t) new_reader, &info))
 		return false;
-	
+
 	/* Waits for the preexisting_reader to enter its CS.*/
 	while (!info.old_entered_cs) {
 		async_usleep(WAIT_STEP_US);
 	}
-	
+
 	assert(!info.old_exited_cs);
 	assert(!info.new_entered_cs);
 	assert(!info.new_exited_cs);
-	
+
 	printf("sync[");
 	info.synching = true;
 	rcu_synchronize();
 	printf(" ]");
-	
+
 	/* Load info.exited_cs */
 	memory_barrier();
-	
+
 	if (!info.old_exited_cs) {
 		printf("Error: rcu_sync() returned before preexisting reader exited.\n");
 		info.failed = 1;
 	}
-	
+
 	bool new_outside_cs = !info.new_entered_cs || info.new_exited_cs;
-	
+
 	/* Test if new reader is waiting in CS before setting synched. */
 	compiler_barrier();
 	info.synched = true;
-		
+
 	if (new_outside_cs) {
 		printf("Error: new reader CS held up rcu_sync(). (4)\n");
@@ -519,13 +519,13 @@
 		/* Wait for the new reader. */
 		rcu_synchronize();
-		
+
 		if (!info.new_exited_cs) {
 			printf("Error: 2nd rcu_sync() returned before new reader exited.\n");
 			info.failed = 1;
 		}
-		
+
 		printf("\n");
 	}
-	
+
 	if (info.failed) {
 		/*
@@ -535,5 +535,5 @@
 		async_usleep(WAIT_STEP_US);
 	}
-	
+
 	return 0 == info.failed;
 }
@@ -555,5 +555,5 @@
 {
 	rcu_register_fibril();
-	
+
 	printf("old-lock{");
 	rcu_read_lock();
@@ -561,5 +561,5 @@
 	rcu_read_lock();
 	arg->entered_cs = true;
-	
+
 	printf("wait-for-sync{");
 	/* Wait for rcu_sync() to start waiting for us. */
@@ -568,5 +568,5 @@
 	}
 	printf(" }");
-	
+
 	rcu_read_unlock();
 	printf(" }");
@@ -575,5 +575,5 @@
 	/* Store exited_cs before unlocking reader section in deregister. */
 	memory_barrier();
-	
+
 	/* Deregister forcefully unlocks the reader section. */
 	rcu_deregister_fibril();
@@ -585,15 +585,15 @@
 {
 	exit_reader_info_t info = { 0 };
-	
+
 	if (!create_fibril((fibril_func_t) exiting_locked_reader, &info))
 		return false;
-	
+
 	/* Waits for the preexisting_reader to enter its CS.*/
 	while (!info.entered_cs) {
 		async_usleep(WAIT_STEP_US);
 	}
-	
+
 	assert(!info.exited_cs);
-	
+
 	printf("sync[");
 	info.synching = true;
@@ -601,13 +601,13 @@
 	info.synched = true;
 	printf(" ]\n");
-	
+
 	/* Load info.exited_cs */
 	memory_barrier();
-	
+
 	if (!info.exited_cs) {
 		printf("Error: rcu_deregister_fibril did not unlock the CS.\n");
 		return false;
 	}
-	
+
 	return true;
 }
@@ -621,5 +621,5 @@
 	atomic_t time;
 	atomic_t max_start_time_of_done_sync;
-	
+
 	size_t total_workers;
 	size_t done_reader_cnt;
@@ -630,5 +630,5 @@
 	size_t read_iters;
 	size_t upd_iters;
-	
+
 	atomic_t seed;
 	int failed;
@@ -640,9 +640,9 @@
 	fibril_mutex_lock(&arg->done_cnt_mtx);
 	++*cnt;
-	
+
 	if (arg->total_workers == arg->done_reader_cnt + arg->done_updater_cnt) {
 		fibril_condvar_signal(&arg->done_cnt_changed);
 	}
-	
+
 	fibril_mutex_unlock(&arg->done_cnt_mtx);
 }
@@ -651,8 +651,8 @@
 {
 	rcu_register_fibril();
-	
+
 	size_t seed = (size_t) atomic_preinc(&arg->seed);
 	bool first = (seed == 1);
-	
+
 	for (size_t k = 0; k < arg->read_iters; ++k) {
 		/* Print progress if the first reader fibril. */
@@ -660,16 +660,16 @@
 			printf(".");
 		}
-		
+
 		rcu_read_lock();
 		atomic_count_t start_time = atomic_preinc(&arg->time);
-		
+
 		/* Do some work. */
 		seed = next_rand(seed);
 		size_t idle_iters = seed % 8;
-		
+
 		for (size_t i = 0; i < idle_iters; ++i) {
 			fibril_yield();
 		}
-		
+
 		/*
 		 * Check if the most recently started rcu_sync of the already
@@ -681,8 +681,8 @@
 			arg->failed = 1;
 		}
-		
+
 		rcu_read_unlock();
 	}
-	
+
 	rcu_deregister_fibril();
 
@@ -694,9 +694,9 @@
 {
 	rcu_register_fibril();
-	
+
 	for (size_t k = 0; k < arg->upd_iters; ++k) {
 		atomic_count_t start_time = atomic_get(&arg->time);
 		rcu_synchronize();
-		
+
 		/* This is prone to a race but if it happens it errs to the safe side.*/
 		if (atomic_get(&arg->max_start_time_of_done_sync) < start_time) {
@@ -704,7 +704,7 @@
 		}
 	}
-	
+
 	rcu_deregister_fibril();
-	
+
 	signal_seq_fibril_done(arg, &arg->done_updater_cnt);
 	return 0;
@@ -715,5 +715,5 @@
 	size_t reader_cnt = test_info->thread_cnt;
 	size_t updater_cnt = test_info->thread_cnt;
-		
+
 	seq_test_info_t info = {
 		.time = {0},
@@ -729,10 +729,10 @@
 		.failed = 0,
 	};
-	
+
 	/* Create and start worker fibrils. */
 	for (size_t k = 0; k + k < reader_cnt + updater_cnt; ++k) {
 		bool ok = create_fibril((fibril_func_t) seq_reader, &info);
 		ok = ok && create_fibril((fibril_func_t) seq_updater, &info);
-		
+
 		if (!ok) {
 			/* Let the already created fibrils corrupt the stack. */
@@ -740,18 +740,18 @@
 		}
 	}
-	
+
 	/* Wait for all worker fibrils to complete their work. */
 	fibril_mutex_lock(&info.done_cnt_mtx);
-	
+
 	while (info.total_workers != info.done_reader_cnt + info.done_updater_cnt) {
 		fibril_condvar_wait(&info.done_cnt_changed, &info.done_cnt_mtx);
 	}
-	
+
 	fibril_mutex_unlock(&info.done_cnt_mtx);
-	
+
 	if (info.failed) {
 		printf("Error: rcu_sync() did not wait for a preexisting reader.");
 	}
-	
+
 	return 0 == info.failed;
 }
@@ -772,12 +772,12 @@
 	/* Sanity check. */
 	assert(cnt < 1024);
-	
+
 	/* Keep this mutex locked so that dummy fibrils never exit. */
 	bool success = fibril_mutex_trylock(&blocking_mtx);
 	assert(success);
-	
+
 	for (size_t k = 0; k < cnt; ++k) {
 		thread_id_t tid;
-		
+
 		errno_t ret = thread_create(dummy_fibril, NULL, "urcu-test-worker", &tid);
 		if (EOK != ret) {
@@ -786,5 +786,5 @@
 		}
 	}
-	
+
 	return true;
 }
@@ -796,12 +796,12 @@
 	for (size_t k = 0; k < test_desc_cnt; ++k) {
 		test_desc_t *t = &test_desc[k];
-		
+
 		if (t->func && 0 == str_cmp(t->name, name))
 			return t;
 	}
-	
+
 	/* Try to match the test number. */
 	uint32_t test_num = 0;
-	
+
 	if (EOK == str_uint32_t(name, NULL, 0, true, &test_num)) {
 		if (test_num < test_desc_cnt && test_desc[test_num].func) {
@@ -809,5 +809,5 @@
 		}
 	}
-	
+
 	return NULL;
 }
@@ -816,13 +816,13 @@
 {
 	printf("Available tests: \n");
-	
+
 	for (size_t i = 0; i < test_desc_cnt; ++i) {
 		test_desc_t *t = &test_desc[i];
-		
+
 		if (!t->func)
 			continue;
-		
+
 		const char *type = "";
-		
+
 		if (t->type == T_SANITY)
 			type = " (sanity)";
@@ -839,5 +839,5 @@
 	printf("Usage: rcutest [test_name|test_number] {number_of_threads}\n");
 	list_tests();
-	
+
 	printf("\nExample usage:\n");
 	printf("\trcutest *\n");
@@ -852,5 +852,5 @@
 		return false;
 	}
-	
+
 	info->desc = find_test(argv[1]);
 
@@ -860,9 +860,9 @@
 		return false;
 	}
-	
+
 	if (argc == 3) {
 		uint32_t thread_cnt = 0;
 		errno_t ret = str_uint32_t(argv[2], NULL, 0, true, &thread_cnt);
-		
+
 		if (ret == EOK && 1 <= thread_cnt && thread_cnt <= 64) {
 			info->thread_cnt = thread_cnt;
@@ -874,5 +874,5 @@
 		info->thread_cnt = 1;
 	}
-	
+
 	return true;
 }
@@ -881,14 +881,14 @@
 {
 	rcu_register_fibril();
-	
+
 	test_info_t info;
-	
+
 	bool ok = parse_cmd_line(argc, argv, &info);
 	ok = ok && create_threads(info.thread_cnt - 1);
-	
+
 	if (ok) {
 		assert(1 <= info.thread_cnt);
 		test_desc_t *t = info.desc;
-		
+
 		printf("Running '%s' (in %zu threads)...\n", t->name, info.thread_cnt);
 		ok = t->func(&info);
@@ -897,5 +897,5 @@
 
 		rcu_deregister_fibril();
-		
+
 		/* Let the kernel clean up the created background threads. */
 		return ok ? 0 : 1;
