From 66da8a6041be849ef722f5cb9a6cd77db72b79cf Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 16 Sep 2016 11:15:59 -0600 Subject: [PATCH 1/1] Fixup two compile warnings - Don't put code before variables. - uintptr_t cast to fix a warning on 32-bit Signed-off-by: Jens Axboe --- init.c | 13 +++++++------ iolog.c | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/init.c b/init.c index bc17b402..6b6e386e 100644 --- a/init.c +++ b/init.c @@ -1426,12 +1426,6 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, } if (o->hist_log_file) { -#ifndef CONFIG_ZLIB - if (td->client_type) { - log_err("fio: --write_hist_log requires zlib in client/server mode\n"); - goto err; - } -#endif struct log_params p = { .td = td, .avg_msec = o->log_avg_msec, @@ -1444,6 +1438,13 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num, }; const char *suf; +#ifndef CONFIG_ZLIB + if (td->client_type) { + log_err("fio: --write_hist_log requires zlib in client/server mode\n"); + goto err; + } +#endif + if (p.log_gz_store) suf = "log.fz"; else diff --git a/iolog.c b/iolog.c index baa4b855..2b7b0bab 100644 --- a/iolog.c +++ b/iolog.c @@ -714,7 +714,7 @@ static void flush_hist_samples(FILE *f, int hist_coarseness, void *samples, for (i = 0; i < nr_samples; i++) { s = __get_sample(samples, log_offset, i); - entry = (struct io_u_plat_entry *) s->val; + entry = (struct io_u_plat_entry *) (uintptr_t) s->val; io_u_plat = entry->io_u_plat; entry_before = flist_first_entry(&entry->list, struct io_u_plat_entry, list); -- 2.25.1