cangen: don't compare floating-point gap with ‘==’

Fixes the following warning:

| cangen.c:524:7: warning: comparing floating-point with ‘==’ or ‘!=’ is unsafe [-Wfloat-equal]
|   524 |   if (gap && burst_sent_count >= burst_count) /* gap == 0 => performance test :-] */
|       |       ^~~

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
pull/386/head
Marc Kleine-Budde 2022-12-07 15:26:42 +01:00
parent a18337b102
commit 213a814da6
1 changed files with 2 additions and 1 deletions

View File

@ -521,7 +521,8 @@ resend:
} }
burst_sent_count++; burst_sent_count++;
if (gap && burst_sent_count >= burst_count) /* gap == 0 => performance test :-] */ if ((ts.tv_sec || ts.tv_nsec) &&
burst_sent_count >= burst_count)
if (nanosleep(&ts, NULL)) if (nanosleep(&ts, NULL))
return 1; return 1;