Index: kernel/test/mm/falloc1.c
===================================================================
--- kernel/test/mm/falloc1.c	(revision f97f1e51a29f20f8f26f381c9c84567e9a997538)
+++ kernel/test/mm/falloc1.c	(revision abfc9f3fe25d6b047d9f3199bff85443b03ecbc8)
@@ -37,32 +37,31 @@
 #include <align.h>
 
-#define MAX_FRAMES  1024
+#define MAX_FRAMES  1024U
 #define MAX_ORDER   8
 #define TEST_RUNS   2
 
-const char *test_falloc1(void) {
-	uintptr_t *frames
-	    = (uintptr_t *) malloc(MAX_FRAMES * sizeof(uintptr_t), 0);
-	int results[MAX_ORDER + 1];
-	
-	int i, order, run;
-	int allocated;
-	
+const char *test_falloc1(void)
+{
 	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";
 	
-	for (run = 0; run < TEST_RUNS; run++) {
-		for (order = 0; order <= MAX_ORDER; order++) {
-			TPRINTF("Allocating %d frames blocks ... ", 1 << order);
+	unsigned int results[MAX_ORDER + 1];
+	for (unsigned int run = 0; run < TEST_RUNS; run++) {
+		for (unsigned int order = 0; order <= MAX_ORDER; order++) {
+			TPRINTF("Allocating %u frames blocks ... ", 1 << order);
 			
-			allocated = 0;
-			for (i = 0; i < MAX_FRAMES >> order; i++) {
-				frames[allocated] = (uintptr_t) frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
+			unsigned int allocated = 0;
+			for (unsigned int i = 0; i < (MAX_FRAMES >> order); i++) {
+				frames[allocated] = (uintptr_t)
+				    frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
 				
-				if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
-					TPRINTF("Block at address %p (size %dK) is not aligned\n",
+				if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) !=
+				    frames[allocated]) {
+					TPRINTF("Block at address %p (size %u) is not aligned\n",
 					    (void *) frames[allocated], (FRAME_SIZE << order) >> 10);
 					return "Test failed";
@@ -87,5 +86,5 @@
 			TPRINTF("Deallocating ... ");
 			
-			for (i = 0; i < allocated; i++)
+			for (unsigned int i = 0; i < allocated; i++)
 				frame_free(KA2PA(frames[i]));
 			
Index: kernel/test/mm/falloc2.c
===================================================================
--- kernel/test/mm/falloc2.c	(revision f97f1e51a29f20f8f26f381c9c84567e9a997538)
+++ kernel/test/mm/falloc2.c	(revision abfc9f3fe25d6b047d9f3199bff85443b03ecbc8)
@@ -40,5 +40,5 @@
 #include <arch.h>
 
-#define MAX_FRAMES  256
+#define MAX_FRAMES  256U
 #define MAX_ORDER   8
 
@@ -51,11 +51,11 @@
 static void falloc(void *arg)
 {
-	int order, run, allocated, i;
 	uint8_t val = THREAD->tid % THREADS;
-	size_t k;
 	
-	void **frames =  (void **) malloc(MAX_FRAMES * sizeof(void *), FRAME_ATOMIC);
+	void **frames = (void **)
+	    malloc(MAX_FRAMES * sizeof(void *), FRAME_ATOMIC);
 	if (frames == NULL) {
-		TPRINTF("Thread #%" PRIu64 " (cpu%u): Unable to allocate frames\n", THREAD->tid, CPU->id);
+		TPRINTF("Thread #%" PRIu64 " (cpu%u): "
+		    "Unable to allocate frames\n", THREAD->tid, CPU->id);
 		atomic_inc(&thread_fail);
 		atomic_dec(&thread_count);
@@ -65,11 +65,14 @@
 	thread_detach(THREAD);
 	
-	for (run = 0; run < THREAD_RUNS; run++) {
-		for (order = 0; order <= MAX_ORDER; order++) {
-			TPRINTF("Thread #%" PRIu64 " (cpu%u): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order);
+	for (unsigned int run = 0; run < THREAD_RUNS; run++) {
+		for (unsigned int order = 0; order <= MAX_ORDER; order++) {
+			TPRINTF("Thread #%" PRIu64 " (cpu%u): "
+			    "Allocating %u frames blocks ... \n", THREAD->tid,
+			    CPU->id, 1 << order);
 			
-			allocated = 0;
-			for (i = 0; i < (MAX_FRAMES >> order); i++) {
-				frames[allocated] = frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
+			unsigned int allocated = 0;
+			for (unsigned int i = 0; i < (MAX_FRAMES >> order); i++) {
+				frames[allocated] =
+				    frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
 				if (frames[allocated]) {
 					memsetb(frames[allocated], FRAME_SIZE << order, val);
@@ -79,12 +82,18 @@
 			}
 			
-			TPRINTF("Thread #%" PRIu64 " (cpu%u): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);
-			TPRINTF("Thread #%" PRIu64 " (cpu%u): Deallocating ... \n", THREAD->tid, CPU->id);
+			TPRINTF("Thread #%" PRIu64 " (cpu%u): "
+			    "%u blocks allocated.\n", THREAD->tid, CPU->id,
+			    allocated);
+			TPRINTF("Thread #%" PRIu64 " (cpu%u): "
+			    "Deallocating ... \n", THREAD->tid, CPU->id);
 			
-			for (i = 0; i < allocated; i++) {
-				for (k = 0; k <= (((size_t) FRAME_SIZE << order) - 1); k++) {
+			for (unsigned int i = 0; i < allocated; i++) {
+				for (size_t k = 0; k <= (((size_t) FRAME_SIZE << order) - 1);
+				    k++) {
 					if (((uint8_t *) frames[i])[k] != val) {
-						TPRINTF("Thread #%" PRIu64 " (cpu%u): Unexpected data (%c) in block %p offset %zu\n",
-						    THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
+						TPRINTF("Thread #%" PRIu64 " (cpu%u): "
+						    "Unexpected data (%c) in block %p offset %zu\n",
+						    THREAD->tid, CPU->id, ((char *) frames[i])[k],
+						    frames[i], k);
 						atomic_inc(&thread_fail);
 						goto cleanup;
@@ -94,5 +103,6 @@
 			}
 			
-			TPRINTF("Thread #%" PRIu64 " (cpu%u): Finished run.\n", THREAD->tid, CPU->id);
+			TPRINTF("Thread #%" PRIu64 " (cpu%u): "
+			    "Finished run.\n", THREAD->tid, CPU->id);
 		}
 	}
@@ -101,5 +111,6 @@
 	free(frames);
 	
-	TPRINTF("Thread #%" PRIu64 " (cpu%u): Exiting\n", THREAD->tid, CPU->id);
+	TPRINTF("Thread #%" PRIu64 " (cpu%u): Exiting\n",
+	    THREAD->tid, CPU->id);
 	atomic_dec(&thread_count);
 }
@@ -107,11 +118,10 @@
 const char *test_falloc2(void)
 {
-	unsigned int i;
-	
 	atomic_set(&thread_count, THREADS);
 	atomic_set(&thread_fail, 0);
 	
-	for (i = 0; i < THREADS; i++) {
-		thread_t * thrd = thread_create(falloc, NULL, TASK, 0, "falloc", false);
+	for (unsigned int i = 0; i < THREADS; i++) {
+		thread_t *thrd =
+		    thread_create(falloc, NULL, TASK, 0, "falloc2", false);
 		if (!thrd) {
 			TPRINTF("Could not create thread %u\n", i);
@@ -122,5 +132,6 @@
 	
 	while (atomic_get(&thread_count) > 0) {
-		TPRINTF("Threads left: %" PRIua "\n", atomic_get(&thread_count));
+		TPRINTF("Threads left: %" PRIua "\n",
+		    atomic_get(&thread_count));
 		thread_sleep(1);
 	}
