Index: trunk/kernel/mm/khm.c
===================================================================
--- trunk/kernel/mm/khm.c	(revision 18)
+++ trunk/kernel/mm/khm.c	(revision 20)
@@ -39,24 +39,24 @@
 void khm_init( khm_t * khm )
 {
-    // check config parameters
-    assert( ((CONFIG_PPM_PAGE_SHIFT + CONFIG_PPM_HEAP_ORDER) < 32 ) , __FUNCTION__ ,
-             "CONFIG_PPM_HEAP_ORDER too large" );
+	// check config parameters
+	assert( ((CONFIG_PPM_PAGE_SHIFT + CONFIG_PPM_HEAP_ORDER) < 32 ) , __FUNCTION__ ,
+	         "CONFIG_PPM_HEAP_ORDER too large" );
 
-    // initialize lock
+	// initialize lock
 	spinlock_init( &khm->lock );
 
-    // compute kernel heap size
-    intptr_t heap_size = (1 << CONFIG_PPM_HEAP_ORDER) << CONFIG_PPM_PAGE_SHIFT;
+	// compute kernel heap size
+	intptr_t heap_size = (1 << CONFIG_PPM_HEAP_ORDER) << CONFIG_PPM_PAGE_SHIFT;
 
-    // get kernel heap base from PPM
-    page_t * page      = ppm_alloc_pages( CONFIG_PPM_HEAP_ORDER );
-    void   * heap_base = ppm_page2base( page );
+	// get kernel heap base from PPM
+	page_t * page      = ppm_alloc_pages( CONFIG_PPM_HEAP_ORDER );
+	void   * heap_base = ppm_page2base( page );
 
-    // initializes first block == complete heap
+	// initialize first block (complete heap)
 	khm_block_t * block = (khm_block_t *)heap_base;
 	block->size = heap_size;
 	block->busy = 0;
 
-    // initializes KHM fields
+	// initialize KHM fields
 	khm->base    = (intptr_t)heap_base;
 	khm->size    = heap_size;
@@ -72,19 +72,19 @@
 	uint32_t       effective_size;
 
-    // compute actual block size
+	// compute actual block size
 	effective_size = size + sizeof(khm_block_t);
 	effective_size = ARROUND_UP( effective_size, CONFIG_CACHE_LINE_SIZE );
 
-    // get lock protecting heap
+	// get lock protecting heap
 	spinlock_lock( &khm->lock );
 
-    // define a starting block to scan existing blocks
-    if( ((khm_block_t*)khm->next)->size < effective_size ) current = (khm_block_t*)khm->base;
-    else                                                   current = (khm_block_t*)khm->next;
+	// define a starting block to scan existing blocks
+	if( ((khm_block_t*)khm->next)->size < effective_size ) current = (khm_block_t*)khm->base;
+	else                                                   current = (khm_block_t*)khm->next;
 
-    // scan all existing blocks to find a large enough free block
+	// scan all existing blocks to find a free block large enough
 	while( current->busy || (current->size < effective_size))
 	{
-        // get next block pointer
+		// get next block pointer
 		current = (khm_block_t*)((char*)current + current->size);
 
@@ -99,26 +99,26 @@
 	}
 
-    // split the current block if current block is too large
+	// split the current block if it is too large
 	if( (current->size - effective_size) >= CONFIG_CACHE_LINE_SIZE )
 	{
-        // update new free block features
+		// update new free block features
 		next           = (khm_block_t *)((char*)current + effective_size);
 		next->size     = current->size - effective_size;
 		next->busy     = 0;
 
-        // register new free block
+		// register new free block
 		khm->next = (intptr_t)next;
 
-        // update allocated block features
+		// update allocated block features
 		current->size  = effective_size;
 		current->busy  = 1;
 	}
 	else
-    {
-        // change block state
+	{
+		// change block state
 		current->busy  = 1;
-    }
+	}
 
-    // release lock protecting heap
+	// release lock protecting heap
 	spinlock_unlock( &khm->lock );
 
@@ -138,14 +138,14 @@
 	current = (khm_block_t *)((char*)ptr - sizeof(khm_block_t));
 
-    // get lock protecting heap
+	// get lock protecting heap
 	spinlock_lock(&khm->lock);
 
-    // release block
+	// release block
 	current->busy = 0;
 
-    // try to merge released block with the next
+	// try to merge released block with the next
 	while ( 1 )
 	{
-        next = (khm_block_t*)((char*)current + current->size);
+		next = (khm_block_t*)((char*)current + current->size);
 		if ( ((intptr_t)next >= (khm->base + khm->size)) || (next->busy == 1) ) break;
 		current->size += next->size;
@@ -154,5 +154,5 @@
 	if( (intptr_t)current < khm->next ) khm->next = (intptr_t)current;
 
-    // release lock protecting heap
+	// release lock protecting heap
 	spinlock_unlock( &khm->lock );
 }
