From 685c3dfee3c1b7933addcadf47af36e580901f03 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 8 Feb 2019 03:42:15 +0000 Subject: [PATCH] scst: Avoid using 64-bit divisions on 32-bit systems See also https://sourceforge.net/p/scst/tickets/17/. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7909 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index e55cc87f4..4952ca481 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -15841,7 +15841,7 @@ static void __scst_update_latency_stats(struct scst_cmd *cmd, cmd->state, delta); delta = 0; } - delta /= 100; + do_div(delta, 100); #ifdef SCST_MEASURE_CLOCK_CYCLES deltac = nowc - stat->last_update_tsc; if (deltac < 0 || deltac > tsc_khz * 1000) { @@ -15849,7 +15849,7 @@ static void __scst_update_latency_stats(struct scst_cmd *cmd, cmd->state, deltac); deltac = 0; } - deltac /= 100; + do_div(deltac, 100); #endif if (stat->count++ > 0) { if (delta < stat->min)