From: Brian Behlendorf Date: Sun, 23 May 2010 16:51:17 +0000 (-0700) Subject: Minor 32-bit fix cast to hrtime_t before the mutliply. X-Git-Tag: spl-0.4.9^0 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a1c9a02fb66ac5885990ec4d82faf03f820085b;p=spl 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. --- diff --git a/module/spl/spl-time.c b/module/spl/spl-time.c index 4c08b75..6ef9b8f 100644 --- a/module/spl/spl-time.c +++ b/module/spl/spl-time.c @@ -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);