[ofa-general] Re: [PATCH] infiniband-diags: eliminate compiler warnings

Jack Morgenstein jackm at dev.mellanox.co.il
Sat Sep 27 23:48:00 PDT 2008


On Saturday 27 September 2008 01:44, Sasha Khapyorsky wrote:
> I think instead of casting just removing 'ull' should solve the issue.
> Something like:
> 
> diff --git a/infiniband-diags/src/ibping.c b/infiniband-diags/src/ibping.c
> index e847f42..bc3bc84 100644
> --- a/infiniband-diags/src/ibping.c
> +++ b/infiniband-diags/src/ibping.c
> @@ -174,7 +174,7 @@ report(int sig)
>         printf("\n--- %s (%s) ibping statistics ---\n", last_host, portid2str(&portid));
>         printf("%" PRIu64 " packets transmitted, %" PRIu64 " received, %" PRIu64 "%% packet loss, time %" PRIu64 " ms\n",
>                 ntrans, replied,
> -               (lost != 0) ?  lost * 100ull / ntrans : 0ull, total_time / 1000ull);
> +               (lost != 0) ?  lost * 100 / ntrans : 0, total_time / 1000);
>         printf("rtt min/avg/max = %" PRIu64 ".%03" PRIu64 "/%" PRIu64 ".%03" PRIu64 "/%" PRIu64 ".%03" PRIu64 " ms\n",
>                 minrtt == ~0ull ? 0 : minrtt/1000,
>                 minrtt == ~0ull ? 0 : minrtt%1000,
> 
> Does it work for you?
> 
Yes, it does.

- Jack



More information about the general mailing list