Index: kernel/test/mm/slab2.c
===================================================================
--- kernel/test/mm/slab2.c	(revision 08a19ba655441635df46ca12a53414694005e074)
+++ kernel/test/mm/slab2.c	(revision cb01e1ee9f069d7d14148e3efc3cb37d1011b8de)
@@ -37,5 +37,5 @@
 #include <synch/mutex.h>
 
-#define ITEM_SIZE 256
+#define ITEM_SIZE  256
 
 /** Fill memory with 2 caches, when allocation fails,
@@ -43,10 +43,10 @@
  *  now allocation should clean magazines and allow for full allocation.
  */
-static void totalmemtest(bool quiet)
+static void totalmemtest(void)
 {
 	slab_cache_t *cache1;
 	slab_cache_t *cache2;
 	int i;
-
+	
 	void *data1, *data2;
 	void *olddata1 = NULL, *olddata2 = NULL;
@@ -55,6 +55,5 @@
 	cache2 = slab_cache_create("cache2_tst", ITEM_SIZE, 0, NULL, NULL, 0);
 	
-	if (!quiet)
-		printf("Allocating...");
+	TPRINTF("Allocating...");
 	
 	/* Use atomic alloc, so that we find end of memory */
@@ -75,10 +74,9 @@
 		olddata1 = data1;
 		olddata2 = data2;
-	} while (1);
-	
-	if (!quiet) {
-		printf("done.\n");
-		printf("Deallocating cache2...");
-	}
+	} while (true);
+	
+	TPRINTF("done.\n");
+	
+	TPRINTF("Deallocating cache2...");
 	
 	/* We do not have memory - now deallocate cache2 */
@@ -89,14 +87,12 @@
 	}
 	
-	if (!quiet) {
-		printf("done.\n");
-		printf("Allocating to cache1...\n");
-	}
+	TPRINTF("done.\n");
+	
+	TPRINTF("Allocating to cache1...\n");
 	
 	for (i = 0; i < 30; i++) {
 		data1 = slab_alloc(cache1, FRAME_ATOMIC);
 		if (!data1) {
-			if (!quiet)
-				printf("Incorrect memory size - use another test.");
+			TPRINTF("Incorrect memory size - use another test.");
 			return;
 		}
@@ -105,5 +101,5 @@
 		olddata1 = data1;
 	}
-	while (1) {
+	while (true) {
 		data1 = slab_alloc(cache1, FRAME_ATOMIC);
 		if (!data1)
@@ -114,6 +110,5 @@
 	}
 	
-	if (!quiet)
-		printf("Deallocating cache1...");
+	TPRINTF("Deallocating cache1...");
 	
 	while (olddata1) {
@@ -123,8 +118,7 @@
 	}
 	
-	if (!quiet) {
-		printf("done.\n");
-		slab_print_list();
-	}
+	TPRINTF("done.\n");
+	
+	slab_print_list();
 	
 	slab_cache_destroy(cache1);
@@ -136,7 +130,6 @@
 static condvar_t thread_starter;
 static mutex_t starter_mutex;
-static bool sh_quiet;
-
-#define THREADS 8
+
+#define THREADS  8
 
 static void slabtest(void *priv)
@@ -150,12 +143,10 @@
 	mutex_unlock(&starter_mutex);
 	
-	if (!sh_quiet)
-		printf("Starting thread #%" PRIu64 "...\n", THREAD->tid);
+	TPRINTF("Starting thread #%" PRIu64 "...\n", THREAD->tid);
 
 	/* Alloc all */
-	if (!sh_quiet)
-		printf("Thread #%" PRIu64 " allocating...\n", THREAD->tid);
-	
-	while (1) {
+	TPRINTF("Thread #%" PRIu64 " allocating...\n", THREAD->tid);
+	
+	while (true) {
 		/* Call with atomic to detect end of memory */
 		new = slab_alloc(thr_cache, FRAME_ATOMIC);
@@ -166,6 +157,5 @@
 	}
 	
-	if (!sh_quiet)
-		printf("Thread #%" PRIu64 " releasing...\n", THREAD->tid);
+	TPRINTF("Thread #%" PRIu64 " releasing...\n", THREAD->tid);
 	
 	while (data) {
@@ -176,8 +166,7 @@
 	}
 	
-	if (!sh_quiet)
-		printf("Thread #%" PRIu64 " allocating...\n", THREAD->tid);
-	
-	while (1) {
+	TPRINTF("Thread #%" PRIu64 " allocating...\n", THREAD->tid);
+	
+	while (true) {
 		/* Call with atomic to detect end of memory */
 		new = slab_alloc(thr_cache, FRAME_ATOMIC);
@@ -188,6 +177,5 @@
 	}
 	
-	if (!sh_quiet)
-		printf("Thread #%" PRIu64 " releasing...\n", THREAD->tid);
+	TPRINTF("Thread #%" PRIu64 " releasing...\n", THREAD->tid);
 	
 	while (data) {
@@ -198,6 +186,5 @@
 	}
 	
-	if (!sh_quiet)
-		printf("Thread #%" PRIu64 " finished\n", THREAD->tid);
+	TPRINTF("Thread #%" PRIu64 " finished\n", THREAD->tid);
 	
 	slab_print_list();
@@ -205,5 +192,5 @@
 }
 
-static void multitest(int size, bool quiet)
+static void multitest(int size)
 {
 	/* Start 8 threads that just allocate as much as possible,
@@ -213,16 +200,14 @@
 	int i;
 	
-	if (!quiet)
-		printf("Running stress test with size %d\n", size);
+	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);
 	for (i = 0; i < THREADS; i++) {  
 		if (!(t = thread_create(slabtest, NULL, TASK, 0, "slabtest", false))) {
-			if (!quiet)
-				printf("Could not create thread %d\n", i);
+			TPRINTF("Could not create thread %d\n", i);
 		} else
 			thread_ready(t);
@@ -230,29 +215,25 @@
 	thread_sleep(1);
 	condvar_broadcast(&thread_starter);
-
+	
 	for (i = 0; i < THREADS; i++)
 		semaphore_down(&thr_sem);
 	
 	slab_cache_destroy(thr_cache);
-	if (!quiet)
-		printf("Stress test complete.\n");
-}
-
-char * test_slab2(bool quiet)
-{
-	sh_quiet = quiet;
-	
-	if (!quiet)
-		printf("Running reclaim single-thread test .. pass 1\n");
-	totalmemtest(quiet);
-	if (!quiet)
-		printf("Running reclaim single-thread test .. pass 2\n");
-	totalmemtest(quiet);
-	if (!quiet)
-		printf("Reclaim test OK.\n");
-	
-	multitest(128, quiet);
-	multitest(2048, quiet);
-	multitest(8192, quiet);
+	TPRINTF("Stress test complete.\n");
+}
+
+char *test_slab2(void)
+{
+	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;
