Index: trunk/kernel/devices/dev_icu.c
===================================================================
--- trunk/kernel/devices/dev_icu.c	(revision 23)
+++ trunk/kernel/devices/dev_icu.c	(revision 128)
@@ -56,5 +56,5 @@
     icu->ext.icu.wti_bitmap = 0;
     spinlock_init( &icu->ext.icu.wti_lock );
-   
+
     // get implementation
     uint32_t impl = icu->impl;
@@ -73,5 +73,5 @@
         assert( false , __FUNCTION__ , "undefined ICU implementation" );
     }
-} // end dev_icu_init()
+}
 
 /////////////////////////////////////////////////////////////////////////////////////
@@ -83,9 +83,9 @@
                                       uint32_t   irq_index )
 {
-    if( irq_type == HWI_TYPE ) 
+    if( irq_type == HWI_TYPE )
     {
         if( irq_index >= icu->ext.icu.hwi_nr )
         {
-            printk("\n[PANIC] in %s : illegal HWI index = %d / max = %d\n", 
+            printk("\n[PANIC] in %s : illegal HWI index = %d / max = %d\n",
                    __FUNCTION__ , irq_index , icu->ext.icu.hwi_nr );
             hal_core_sleep();
@@ -96,10 +96,10 @@
         if( irq_index >= icu->ext.icu.wti_nr )
         {
-            printk("\n[PANIC] in %s : illegal WTI index = %d / max = %d\n", 
+            printk("\n[PANIC] in %s : illegal WTI index = %d / max = %d\n",
                    __FUNCTION__ , irq_index , icu->ext.icu.wti_nr );
             hal_core_sleep();
         }
     }
-    else  //  irq_type == PTI_TYPE 
+    else  //  irq_type == PTI_TYPE
     {
         if( irq_index >= icu->ext.icu.pti_nr )
@@ -110,5 +110,5 @@
         }
     }
-}  // end dev_icu_check_irq()
+}
 
 ////////////////////////////////////////
@@ -126,5 +126,5 @@
 
     // call implementation specific ICU driver to enable IRQ
-    if( icu->impl == IMPL_ICU_XCU ) 
+    if( icu->impl == IMPL_ICU_XCU )
     {
          soclib_xcu_enable_irq( icu , 1<<irq_index , irq_type , lid );
@@ -137,5 +137,5 @@
         // source chdev pointer in relevant interrupt vector
         core_t * core = &LOCAL_CLUSTER->core_tbl[lid];
-	    core_set_irq_vector_entry( core , irq_type , irq_index , src_chdev );
+        core_set_irq_vector_entry( core , irq_type , irq_index , src_chdev );
 
         // (3) register IRQ type and index in source chdev descriptor
@@ -143,5 +143,5 @@
         src_chdev->irq_id   = irq_index;
     }
-}  // end dev_icu_enable_irq()
+}
 
 /////////////////////////////////////////
@@ -157,6 +157,6 @@
     dev_icu_check_irq( icu , irq_type , irq_index );
 
-    // call the implementation specific ICU driver to disable IRQ 
-    if( icu->impl == IMPL_ICU_XCU ) 
+    // call the implementation specific ICU driver to disable IRQ
+    if( icu->impl == IMPL_ICU_XCU )
     {
         soclib_xcu_disable_irq( icu , 1<<irq_index , irq_type , lid );
@@ -169,7 +169,7 @@
         // the source chdev xptr from relevant interrupt vector
         core_t * core = &LOCAL_CLUSTER->core_tbl[lid];
-	    core_set_irq_vector_entry( core , irq_type , irq_index , NULL );
-    }
-} // end dev_icu_disable_irq()
+        core_set_irq_vector_entry( core , irq_type , irq_index , NULL );
+    }
+}
 
 ///////////////////////////////////////
@@ -198,12 +198,12 @@
 
     // check PTI index
-    assert( (pti_index < icu->ext.icu.pti_nr) , __FUNCTION__ , "illegal PTI index" ); 
-
-    // call the implementation specific driver ICU to set period 
-    if( icu->impl == IMPL_ICU_XCU ) 
+    assert( (pti_index < icu->ext.icu.pti_nr) , __FUNCTION__ , "illegal PTI index" );
+
+    // call the implementation specific driver ICU to set period
+    if( icu->impl == IMPL_ICU_XCU )
     {
         soclib_xcu_set_period( icu , pti_index , period );
     }
-}  // end dev_icu_set_period()
+}
 
 ////////////////////////////////////////////
@@ -215,12 +215,12 @@
 
     // check PTI index
-    assert( (pti_index < icu->ext.icu.pti_nr) , __FUNCTION__ , "illegal PTI index" ); 
+    assert( (pti_index < icu->ext.icu.pti_nr) , __FUNCTION__ , "illegal PTI index" );
 
     // call the implementation specific driver ICU to acknowledge PTI IRQ
-    if( icu->impl == IMPL_ICU_XCU ) 
+    if( icu->impl == IMPL_ICU_XCU )
     {
         soclib_xcu_ack_timer( icu , pti_index );
     }
-}  // end dev_icu_ack_timer()
+}
 
 ////////////////////////////////////
@@ -228,5 +228,5 @@
                        lid_t    lid )
 {
-    // check arguments 
+    // check arguments
     cluster_t * cluster  = LOCAL_CLUSTER;
     uint32_t    y_width  = cluster->y_width;
@@ -249,12 +249,12 @@
 
     // get implementation from remote ICU chdev
-    uint32_t impl = hal_remote_lw( XPTR( icu_cxy , &icu_ptr->impl ) );   
+    uint32_t impl = hal_remote_lw( XPTR( icu_cxy , &icu_ptr->impl ) );
 
     // call the implementation specific ICU driver to send IPI
-    if( impl == IMPL_ICU_XCU ) 
+    if( impl == IMPL_ICU_XCU )
     {
         soclib_xcu_send_ipi( icu_xp , lid );
     }
-}  // end dev_icu_send_ipi()
+}
 
 //////////////////////////
@@ -273,5 +273,5 @@
     chdev_t * icu    = (chdev_t *)GET_PTR( icu_xp );
 
-    // call the implementation specific ICU driver  
+    // call the implementation specific ICU driver
     // to return highest priority pending IRQ of each type
     if( icu->impl == IMPL_ICU_XCU )
@@ -282,6 +282,6 @@
     // analyse ICU status and handle up to 3 pending IRQ (one WTI, one HWI, one PTI)
 
-    if( wti_status )          // pending WTI 
-	{
+    if( wti_status )          // pending WTI
+    {
         index = wti_status - 1;
 
@@ -297,53 +297,53 @@
         {
             // get pointer on IRQ source chdev
-		    src_chdev = core->wti_vector[index];
-
-		    if( src_chdev == NULL )        // strange, but not fatal => disable IRQ
-		    {
+            src_chdev = core->wti_vector[index];
+
+            if( src_chdev == NULL )        // strange, but not fatal => disable IRQ
+            {
                 printk("\n[WARNING] in %s : no handler for WTI %d on core %d in cluster %x\n",
                        __FUNCTION__ , index , core->lid , local_cxy );
-	            core->spurious_irqs ++;
-                dev_icu_disable_irq( core->lid , WTI_TYPE , index ); 
+                core->spurious_irqs ++;
+                dev_icu_disable_irq( core->lid , WTI_TYPE , index );
             }
             else                                 // call relevant ISR
             {
-		        icu_dmsg("\n[INFO] %s received WTI : index = %d for cpu %d in cluster %d\n",
+                icu_dmsg("\n[INFO] %s received WTI : index = %d for cpu %d in cluster %d\n",
                          __FUNCTION__ , index , core->lid , local_cxy );
 
                 // call ISR
-	            src_chdev->isr( src_chdev );
+                src_chdev->isr( src_chdev );
             }
         }
-	}
-
-	if( hwi_status )      // pending HWI
-	{
+    }
+
+    if( hwi_status )      // pending HWI
+    {
         index = hwi_status - 1;
 
         // get pointer on IRQ source chdev
-		src_chdev = core->hwi_vector[index];
-
-		if( src_chdev == NULL )        // strange, but not fatal => disable IRQ
-		{
+        src_chdev = core->hwi_vector[index];
+
+        if( src_chdev == NULL )        // strange, but not fatal => disable IRQ
+        {
             printk("\n[WARNING] in %s : no handler for HWI %d on core %d in cluster %x\n",
                    __FUNCTION__ , index , core->lid , local_cxy );
-	        core->spurious_irqs ++;
-            dev_icu_disable_irq( core->lid , HWI_TYPE , index ); 
-		}
+            core->spurious_irqs ++;
+            dev_icu_disable_irq( core->lid , HWI_TYPE , index );
+        }
         else                    // call relevant ISR
         {
-		    icu_dmsg("\n[INFO] %s received HWI : index = %d for cpu %d in cluster %d\n",
+            icu_dmsg("\n[INFO] %s received HWI : index = %d for cpu %d in cluster %d\n",
                      __FUNCTION__ , index , core->lid , local_cxy );
 
             // call ISR
-		    src_chdev->isr( src_chdev );
-        }
-	}
+            src_chdev->isr( src_chdev );
+        }
+    }
 
     if( pti_status )      // pending PTI
-	{
+    {
         index = pti_status - 1;
 
-		icu_dmsg("\n[INFO] %s received PTI : index = %d for cpu %d in cluster %d\n",
+        icu_dmsg("\n[INFO] %s received PTI : index = %d for cpu %d in cluster %d\n",
                  __FUNCTION__ , index , core->lid , local_cxy );
 
@@ -360,9 +360,9 @@
             printk("\n[WARNING] in %s : no handler for PTI %d on core %d in cluster %x\n",
                    __FUNCTION__ , index , core->lid , local_cxy );
-	        core->spurious_irqs ++;
-            dev_icu_disable_irq( core->lid , PTI_TYPE , index ); 
-        }
-	}
-}  // end dev_icu_irq_handler()
+            core->spurious_irqs ++;
+            dev_icu_disable_irq( core->lid , PTI_TYPE , index );
+        }
+    }
+}
 
 ////////////////////////////
@@ -383,5 +383,5 @@
     // get first free mailbox index
     uint32_t index = (uint32_t)bitmap_ffc( bitmap , size );
-  
+
     // set bitmap entry if found
     if( index < size ) bitmap_set( bitmap , index );
@@ -389,7 +389,7 @@
     // release lock
     spinlock_unlock( lock );
- 
+
     return index;
-}  // end dev_icu_wti_alloc()
+}
 
 //////////////////////////////////////////
@@ -411,11 +411,10 @@
     spinlock_lock( lock );
 
-    // clear bitmap entry 
+    // clear bitmap entry
     bitmap_clear( bitmap , index );
 
     // release lock
     spinlock_unlock( lock );
-
-}  // end dev_icu_wti_release()
+}
 
 //////////////////////////////////////////////
@@ -431,9 +430,8 @@
     if( icu->impl == IMPL_ICU_XCU )
     {
-        wti_ptr = soclib_xcu_wti_ptr( icu , wti_id );   
+        wti_ptr = soclib_xcu_wti_ptr( icu , wti_id );
     }
 
     return wti_ptr;
-}   // end dev_icu_wti_xptr()
-
-
+}
+
