[openib-general] [PATCH] Opensm - cl_event_wheel casting

Yael Kalka yael at mellanox.co.il
Mon Feb 6 00:53:48 PST 2006


Hi Hal,

The following patch adds the casting done in a clearer way - to avoid
compilation errors in windows. Also - added a clear message if the
timeout was trimmed (due to the casting).

Thanks,
Yael

Signed-off-by:  Yael Kalka <yael at mellanox.co.il>

Index: complib/cl_event_wheel.c
===================================================================
--- complib/cl_event_wheel.c    (revision 5307)
+++ complib/cl_event_wheel.c    (working copy)
@@ -426,8 +426,18 @@ cl_event_wheel_reg(
      * cl_timer_stop(&p_event_wheel->timer);
      */
 
+    /* The timeout for the cl_timer_start should be given as uint32_t.
+       if there is an overflow - warn about it. */
+    if ( timeout > (uint32_t)timeout )
+    {
+      osm_log (p_event_wheel->p_log, OSM_LOG_INFO,
+               "cl_event_wheel_reg: "
+               "timeout requested is too large. Using timeout: %u \n",
+               (uint32_t)timeout );
+    }
+
     /* start the timer to the timeout [msec] */
-    cl_status = cl_timer_start(&p_event_wheel->timer, timeout);
+    cl_status = cl_timer_start(&p_event_wheel->timer, (uint32_t)timeout);
 
     if (cl_status != CL_SUCCESS)
     {




More information about the general mailing list