Minor 32-bit fix cast to hrtime_t before the mutliply.

It's important to cast to hrtime_t before doing the multiply because
the ts.tv_sec type is only 32-bits and we need to promote it to 64-bits.
This commit is contained in:
Brian Behlendorf 2010-05-23 09:51:17 -07:00
parent 49638d8388
commit 8a1c9a02fb

View File

@ -63,7 +63,7 @@ __gethrtime(void) {
struct timespec ts;
do_posix_clock_monotonic_gettime(&ts);
return (hrtime_t)((ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec);
return (((hrtime_t)ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec);
#endif
}
EXPORT_SYMBOL(__gethrtime);