--- cpukit/score/src/timespectoticks.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/cpukit/score/src/timespectoticks.c b/cpukit/score/src/timespectoticks.c index d02a350..61ee06d 100644 --- a/cpukit/score/src/timespectoticks.c +++ b/cpukit/score/src/timespectoticks.c @@ -30,8 +30,7 @@ uint32_t _Timespec_To_ticks( uint32_t ticks; uint32_t nanoseconds_per_tick; - if ( (time->tv_sec == 0) && (time->tv_nsec == 0) ) - return 0; + nanoseconds_per_tick = rtems_configuration_get_nanoseconds_per_tick(); /** * We should ensure the ticks not be truncated by integer division. We @@ -39,11 +38,7 @@ uint32_t _Timespec_To_ticks( * should not be shorter. */ ticks = time->tv_sec * rtems_configuration_get_ticks_per_second(); - nanoseconds_per_tick = rtems_configuration_get_nanoseconds_per_tick(); - ticks += time->tv_nsec / nanoseconds_per_tick; - - if ( (time->tv_nsec % nanoseconds_per_tick) != 0 ) - ticks += 1; + ticks += ( time->tv_nsec + nanoseconds_per_tick - 1 ) / nanoseconds_per_tick; return ticks; } -- 1.8.4.5 _______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel