HRT: Drop volatile specifier from function call for non-atomic mode

This allows the compiler to optimize better without loosing any performance / accuracy.
This commit is contained in:
Lorenz Meier
2019-01-22 22:29:39 +01:00
parent 502cd987ee
commit 46390a1508
4 changed files with 4 additions and 4 deletions

View File

@@ -98,7 +98,7 @@ __EXPORT extern void abstime_to_ts(struct timespec *ts, hrt_abstime abstime);
*
* This function is not interrupt save.
*/
__EXPORT extern hrt_abstime hrt_elapsed_time(const volatile hrt_abstime *then);
__EXPORT extern hrt_abstime hrt_elapsed_time(const hrt_abstime *then);
/**
* Compute the delta between a timestamp taken in the past

View File

@@ -598,7 +598,7 @@ abstime_to_ts(struct timespec *ts, hrt_abstime abstime)
* Compare a time value with the current time.
*/
hrt_abstime
hrt_elapsed_time(const volatile hrt_abstime *then)
hrt_elapsed_time(const hrt_abstime *then)
{
hrt_abstime delta = hrt_absolute_time() - *then;

View File

@@ -679,7 +679,7 @@ abstime_to_ts(struct timespec *ts, hrt_abstime abstime)
* Compare a time value with the current time.
*/
hrt_abstime
hrt_elapsed_time(const volatile hrt_abstime *then)
hrt_elapsed_time(const hrt_abstime *then)
{
hrt_abstime delta = hrt_absolute_time() - *then;

View File

@@ -719,7 +719,7 @@ abstime_to_ts(struct timespec *ts, hrt_abstime abstime)
* Compare a time value with the current time.
*/
hrt_abstime
hrt_elapsed_time(const volatile hrt_abstime *then)
hrt_elapsed_time(const hrt_abstime *then)
{
hrt_abstime delta = hrt_absolute_time() - *then;