From 8a1c9a02fb66ac5885990ec4d82faf03f820085b Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Sun, 23 May 2010 09:51:17 -0700 Subject: [PATCH] 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. --- module/spl/spl-time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/spl/spl-time.c b/module/spl/spl-time.c index 4c08b754dd1c..6ef9b8fc8e1d 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);