Index: kernel/generic/src/proc/thread.c
===================================================================
--- kernel/generic/src/proc/thread.c	(revision 95155b0cd020d126e09ca42230ae0a4dce3f296c)
+++ kernel/generic/src/proc/thread.c	(revision d78d603c85e7ba2c4bf98203471b39311d240568)
@@ -81,11 +81,14 @@
 }; 
 
-/** Lock protecting the threads_btree B+tree. For locking rules, see declaration thereof. */
+/** Lock protecting the threads_btree B+tree.
+ *
+ * For locking rules, see declaration thereof.
+ */
 SPINLOCK_INITIALIZE(threads_lock);
 
 /** B+tree of all threads.
  *
- * When a thread is found in the threads_btree B+tree, it is guaranteed to exist as long
- * as the threads_lock is held.
+ * When a thread is found in the threads_btree B+tree, it is guaranteed to
+ * exist as long as the threads_lock is held.
  */
 btree_t threads_btree;		
@@ -99,9 +102,8 @@
 #endif
 
-/** Thread wrapper
- *
- * This wrapper is provided to ensure that every thread
- * makes a call to thread_exit() when its implementing
- * function returns.
+/** Thread wrapper.
+ *
+ * This wrapper is provided to ensure that every thread makes a call to
+ * thread_exit() when its implementing function returns.
  *
  * interrupts_disable() is assumed.
@@ -202,12 +204,10 @@
 	THREAD = NULL;
 	atomic_set(&nrdy,0);
-	thread_slab = slab_cache_create("thread_slab", 
-					sizeof(thread_t),0, 
-					thr_constructor, thr_destructor, 0);
+	thread_slab = slab_cache_create("thread_slab", sizeof(thread_t), 0,
+		thr_constructor, thr_destructor, 0);
+
 #ifdef ARCH_HAS_FPU
-	fpu_context_slab = slab_cache_create("fpu_slab",
-					     sizeof(fpu_context_t),
-					     FPU_CONTEXT_ALIGN,
-					     NULL, NULL, 0);
+	fpu_context_slab = slab_cache_create("fpu_slab", sizeof(fpu_context_t),
+		FPU_CONTEXT_ALIGN, NULL, NULL, 0);
 #endif
 
@@ -235,5 +235,5 @@
 	ASSERT(! (t->state == Ready));
 
-	i = (t->priority < RQ_COUNT -1) ? ++t->priority : t->priority;
+	i = (t->priority < RQ_COUNT - 1) ? ++t->priority : t->priority;
 	
 	cpu = CPU;
@@ -268,5 +268,5 @@
 void thread_destroy(thread_t *t)
 {
-	bool destroy_task = false;	
+	bool destroy_task = false;
 
 	ASSERT(t->state == Exiting || t->state == Undead);
@@ -275,6 +275,6 @@
 
 	spinlock_lock(&t->cpu->lock);
-	if(t->cpu->fpu_owner==t)
-		t->cpu->fpu_owner=NULL;
+	if(t->cpu->fpu_owner == t)
+		t->cpu->fpu_owner = NULL;
 	spinlock_unlock(&t->cpu->lock);
 
@@ -311,10 +311,12 @@
  * @param flags     Thread flags.
  * @param name      Symbolic name.
- * @param uncounted Thread's accounting doesn't affect accumulated task accounting.
+ * @param uncounted Thread's accounting doesn't affect accumulated task
+ * 	 accounting.
  *
  * @return New thread's structure on success, NULL on failure.
  *
  */
-thread_t *thread_create(void (* func)(void *), void *arg, task_t *task, int flags, char *name, bool uncounted)
+thread_t *thread_create(void (* func)(void *), void *arg, task_t *task,
+	int flags, char *name, bool uncounted)
 {
 	thread_t *t;
@@ -326,5 +328,6 @@
 	
 	/* Not needed, but good for debugging */
-	memsetb((uintptr_t) t->kstack, THREAD_STACK_SIZE * 1 << STACK_FRAMES, 0);
+	memsetb((uintptr_t) t->kstack, THREAD_STACK_SIZE * 1 << STACK_FRAMES,
+		0);
 	
 	ipl = interrupts_disable();
@@ -335,5 +338,6 @@
 	
 	context_save(&t->saved_context);
-	context_set(&t->saved_context, FADDR(cushion), (uintptr_t) t->kstack, THREAD_STACK_SIZE);
+	context_set(&t->saved_context, FADDR(cushion), (uintptr_t) t->kstack,
+		THREAD_STACK_SIZE);
 	
 	the_initialize((the_t *) t->kstack);
@@ -377,5 +381,6 @@
 	t->fpu_context_engaged = 0;
 
-	thread_create_arch(t);		/* might depend on previous initialization */
+	/* might depend on previous initialization */
+	thread_create_arch(t);	
 	
 	/*
@@ -399,5 +404,6 @@
 	 */
 	spinlock_lock(&threads_lock);
-	btree_insert(&threads_btree, (btree_key_t) ((uintptr_t) t), (void *) t, NULL);
+	btree_insert(&threads_btree, (btree_key_t) ((uintptr_t) t), (void *) t,
+		NULL);
 	spinlock_unlock(&threads_lock);
 	
@@ -409,7 +415,6 @@
 /** Terminate thread.
  *
- * End current thread execution and switch it to the exiting
- * state. All pending timeouts are executed.
- *
+ * End current thread execution and switch it to the exiting state. All pending
+ * timeouts are executed.
  */
 void thread_exit(void)
@@ -420,5 +425,6 @@
 	ipl = interrupts_disable();
 	spinlock_lock(&THREAD->lock);
-	if (THREAD->timeout_pending) { /* busy waiting for timeouts in progress */
+	if (THREAD->timeout_pending) { 
+		/* busy waiting for timeouts in progress */
 		spinlock_unlock(&THREAD->lock);
 		interrupts_restore(ipl);
@@ -444,5 +450,5 @@
 void thread_sleep(uint32_t sec)
 {
-	thread_usleep(sec*1000000);
+	thread_usleep(sec * 1000000);
 }
 
