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

Hal Rosenstock halr at voltaire.com
Thu Feb 9 07:28:32 PST 2006


Hi Yael,

On Mon, 2006-02-06 at 03:53, Yael Kalka wrote:
> 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);

Shouldn't this use the max 32 bit timeout here rather than the low 32
bits ?

-- Hal

>      if (cl_status != CL_SUCCESS)
>      {
> 




More information about the general mailing list