merge -c1473 trunk: Avoided using #ifdef inside a macro. stable-1.4
authorFlorian Pose <fp@igh-essen.com>
Thu, 02 Oct 2008 07:06:37 +0000
branchstable-1.4
changeset 1642 9e1f528b8bdd
parent 1641 e260d76b9c70
child 1643 cf5a5c511408
merge -c1473 trunk: Avoided using #ifdef inside a macro.
master/master.c
--- a/master/master.c	Tue Sep 30 14:10:50 2008 +0000
+++ b/master/master.c	Thu Oct 02 07:06:37 2008 +0000
@@ -1375,16 +1375,15 @@
             ec_master_output_stats(master);
 
             if (unlikely(master->debug_level > 0)) {
+                unsigned int time_us;
+#ifdef EC_HAVE_CYCLES
+                time_us = (unsigned int) (master->main_device.cycles_poll -
+                        datagram->cycles_sent) * 1000 / cpu_khz;
+#else
+                time_us = (unsigned int) (diff_ms * 1000);
+#endif
                 EC_DBG("TIMED OUT datagram %08x, index %02X waited %u us.\n",
-                        (unsigned int) datagram, datagram->index,
-#ifdef EC_HAVE_CYCLES
-                        (unsigned int) (master->main_device.cycles_poll
-                            - datagram->cycles_sent) * 1000 / cpu_khz
-#else
-                        (unsigned int) (diff_ms * 1000)
-#endif
-                        );
-                
+                        (unsigned int) datagram, datagram->index, time_us);
             }
         }
     }