Index: trunk/kernel/mm/ppm.c
===================================================================
--- trunk/kernel/mm/ppm.c	(revision 53)
+++ trunk/kernel/mm/ppm.c	(revision 160)
@@ -38,10 +38,8 @@
 #include <ppm.h>
 
-
-
 ////////////////////////////////////////////////
 inline bool_t ppm_page_is_valid( page_t * page )
 {
-    ppm_t    * ppm  = &LOCAL_CLUSTER->ppm;
+	ppm_t    * ppm  = &LOCAL_CLUSTER->ppm;
 	uint32_t   pgnr = (uint32_t)( page - ppm->pages_tbl );
 	return (pgnr <= ppm->pages_nr);
@@ -49,5 +47,4 @@
 
 
-
 /////////////////////////////////////////////
 inline void * ppm_page2vaddr( page_t * page )
@@ -64,10 +61,8 @@
 }
 
-
-
 //////////////////////////////////////////
 inline ppn_t ppm_page2ppn( page_t * page )
 {
-	ppm_t  * ppm  = &LOCAL_CLUSTER->ppm;
+	ppm_t  * ppm = &LOCAL_CLUSTER->ppm;
 	return (ppn_t)( page - ppm->pages_tbl );
 }
@@ -76,9 +71,7 @@
 inline page_t * ppm_ppn2page( ppn_t ppn )
 {
-	ppm_t  * ppm  = &LOCAL_CLUSTER->ppm;
+	ppm_t  * ppm = &LOCAL_CLUSTER->ppm;
 	return &ppm->pages_tbl[ppn];
 }
-
-
 
 ///////////////////////////////////////
@@ -93,7 +86,6 @@
 {
 	ppm_t  * ppm  = &LOCAL_CLUSTER->ppm;
-	return  ( (ppm->vaddr_base - vaddr) >> CONFIG_PPM_PAGE_SHIFT );
-}
-
+	return ( (ppm->vaddr_base - vaddr) >> CONFIG_PPM_PAGE_SHIFT );
+}
 
 
@@ -107,19 +99,19 @@
 	uint32_t   current_order;    // current (merged) page order
 
-    ppm_t    * ppm         = &LOCAL_CLUSTER->ppm;
-    page_t   * pages_tbl   = ppm->pages_tbl;
-
-    // update released page descriptor flags
+	ppm_t    * ppm         = &LOCAL_CLUSTER->ppm;
+	page_t   * pages_tbl   = ppm->pages_tbl;
+
+	// update released page descriptor flags
 	page_set_flag( page , PG_FREE );
 
-    // search the buddy page descriptor
-    // - merge with current page descriptor if found
-    // - exit to release the current page descriptor if not found
-    current       = page ,
-    current_index = (uint32_t)(page - ppm->pages_tbl);
+	// search the buddy page descriptor
+	// - merge with current page descriptor if found
+	// - exit to release the current page descriptor if not found
+	current       = page ,
+	current_index = (uint32_t)(page - ppm->pages_tbl);
 	for( current_order = page->order ;
-         current_order < CONFIG_PPM_MAX_ORDER ;
-         current_order++ )
-    {
+	     current_order < CONFIG_PPM_MAX_ORDER ;
+	     current_order++ )
+	{
 		buddy_index = current_index ^ (1 << current_order);
 		buddy       = pages_tbl + buddy_index;
@@ -127,31 +119,30 @@
 		if( !page_is_flag( buddy , PG_FREE ) || (buddy->order != current_order) ) break;
 
-        // remove buddy from free list
+		// remove buddy from free list
 		list_unlink( &buddy->list );
 		ppm->free_pages_nr[current_order] --;
 
-        // merge buddy with current
+		// merge buddy with current
 		buddy->order = 0;
 		current_index &= buddy_index;
 	}
 
-    // update merged page descriptor order
+	// update merged page descriptor order
 	current        = pages_tbl + current_index;
 	current->order = current_order;
 
-    // insert current in free list
+	// insert current in free list
 	list_add_first( &ppm->free_pages_root[current_order] , &current->list );
 	ppm->free_pages_nr[current_order] ++;
-
-}  // end ppm_free_pages_nolock()
+}
 
 ////////////////////////////////////////////
 page_t * ppm_alloc_pages( uint32_t   order )
 {
-    uint32_t   current_order;
+	uint32_t   current_order;
 	page_t   * remaining_block;
 	uint32_t   current_size;
 
-    ppm_t    * ppm = &LOCAL_CLUSTER->ppm;
+	ppm_t    * ppm = &LOCAL_CLUSTER->ppm;
 
 	assert( (order < CONFIG_PPM_MAX_ORDER) , __FUNCTION__ , "illegal order argument" );
@@ -159,11 +150,11 @@
 	page_t * block = NULL;
 
-    ppm_dmsg("\n[INFO] %s : enters / order = %d\n",
-             __FUNCTION__ , order );
-
-    // take lock protecting free lists
+	ppm_dmsg("\n[INFO] %s : enters / order = %d\n",
+	         __FUNCTION__ , order );
+
+	// take lock protecting free lists
 	spinlock_lock( &ppm->free_lock );
 
-    // find a free block equal or larger to requested size
+	// find a free block equal or larger to requested size
 	for( current_order = order ; current_order < CONFIG_PPM_MAX_ORDER ; current_order ++ )
 	{
@@ -178,16 +169,16 @@
 	if( block == NULL ) // return failure
 	{
-        // release lock protecting free lists
-	    spinlock_unlock( &ppm->free_lock );
-
-        return NULL;
-    }
-
-    // update free-lists after removing a block
+		// release lock protecting free lists
+		spinlock_unlock( &ppm->free_lock );
+
+		return NULL;
+	}
+
+	// update free-lists after removing a block
 	ppm->free_pages_nr[current_order] --;
 	current_size = (1 << current_order);
 
-    // split the removed block in smaller sub-blocks if required
-    // and update the free-lists accordingly
+	// split the removed block in smaller sub-blocks if required
+	// and update the free-lists accordingly
 	while( current_order > order )
 	{
@@ -202,17 +193,17 @@
 	}
 
-    // update page descriptor
-    page_clear_flag( block , PG_FREE );
+	// update page descriptor
+	page_clear_flag( block , PG_FREE );
 	page_refcount_up( block );
 	block->order = order;
 
-    // release lock protecting free lists
+	// release lock protecting free lists
 	spinlock_unlock( &ppm->free_lock );
 
-    ppm_dmsg("\n[INFO] %s : base = %x / order = %d\n",
-             __FUNCTION__ , (uint32_t)ppm_page2base( block ) , order );
+	ppm_dmsg("\n[INFO] %s : base = %x / order = %d\n",
+	         __FUNCTION__ , (uint32_t)ppm_page2base( block ) , order );
 
 	return block;
-}  // end pmm_alloc-pages()
+}
 
 
@@ -222,10 +213,10 @@
 	ppm_t * ppm = &LOCAL_CLUSTER->ppm;
 
-    // get lock protecting free_pages[] array
+	// get lock protecting free_pages[] array
 	spinlock_lock( &ppm->free_lock );
 
 	ppm_free_pages_nolock( page );
 
-    // release lock protecting free_pages[] array
+	// release lock protecting free_pages[] array
 	spinlock_unlock( &ppm->free_lock );
 }
@@ -239,5 +230,5 @@
 	page_t       * page;
 
-    // get lock protecting free lists
+	// get lock protecting free lists
 	spinlock_lock( &ppm->free_lock );
 
@@ -248,5 +239,5 @@
 	{
 		printk("- order = %d / free_pages = %d  [",
-               order , ppm->free_pages_nr[order] );
+		       order , ppm->free_pages_nr[order] );
 
 		LIST_FOREACH( &ppm->free_pages_root[order] , iter )
@@ -259,8 +250,7 @@
 	}
 
-    // release lock protecting free lists
+	// release lock protecting free lists
 	spinlock_unlock( &ppm->free_lock );
-
-}  // end ppm_print()
+}
 
 ///////////////////////////////////////
@@ -279,10 +269,9 @@
 			page = LIST_ELEMENT( iter , page_t , list );
 
-			if( page->order != order )  return -1; 
+			if( page->order != order )  return -1;
 		}
 	}
 
-    return 0;
-
-}  // end ppm_assert_order()
-
+	return 0;
+}
+
