From: Jens Axboe Date: Mon, 8 Aug 2016 13:48:33 +0000 (-0600) Subject: iolog: hist_sum() should return unsigned long X-Git-Tag: fio-2.14~53 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=f2c972cc39947abceb9245b31b4a76fee41aa638 iolog: hist_sum() should return unsigned long Signed-off-by: Jens Axboe --- diff --git a/iolog.c b/iolog.c index a9cbd5bd..8a216b25 100644 --- a/iolog.c +++ b/iolog.c @@ -661,9 +661,10 @@ void free_log(struct io_log *log) sfree(log); } -static inline int hist_sum(int j, int stride, unsigned int *io_u_plat) +static inline unsigned long hist_sum(int j, int stride, unsigned int *io_u_plat) { - int k, sum; + unsigned long sum; + int k; for (k = sum = 0; k < stride; k++) sum += io_u_plat[j + k]; @@ -695,7 +696,7 @@ void flush_hist_samples(FILE *f, int hist_coarseness, void *samples, fprintf(f, "%lu, %u, %u, ", (unsigned long)s->time, io_sample_ddir(s), s->bs); for (j = 0; j < FIO_IO_U_PLAT_NR - stride; j += stride) { - fprintf(f, "%lu, ", (unsigned long) hist_sum(j, stride, io_u_plat)); + fprintf(f, "%lu, ", hist_sum(j, stride, io_u_plat)); } fprintf(f, "%lu\n", (unsigned long) hist_sum(FIO_IO_U_PLAT_NR - stride, stride, io_u_plat));