summaryrefslogtreecommitdiffstats
path: root/runtime/stat-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/stat-common.c')
-rw-r--r--runtime/stat-common.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/runtime/stat-common.c b/runtime/stat-common.c
index ff19662b..55f2ad38 100644
--- a/runtime/stat-common.c
+++ b/runtime/stat-common.c
@@ -173,10 +173,8 @@ static void _stp_stat_print_valtype (char *fmt, Stat st, struct stat_data *sd, i
case 'A':
{
int64_t avg = 0;
- if (sd->count) {
- avg = sd->sum;
- do_div (avg, (int)sd->count); /* FIXME: check for overflow */
- }
+ if (sd->count)
+ avg = _stp_div64 (NULL, sd->sum, sd->count);
_stp_printf("%lld", avg);
break;
}