Fixup two compile warnings
authorJens Axboe <axboe@fb.com>
Fri, 16 Sep 2016 17:15:59 +0000 (11:15 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 16 Sep 2016 17:15:59 +0000 (11:15 -0600)
- Don't put code before variables.

- uintptr_t cast to fix a warning on 32-bit

Signed-off-by: Jens Axboe <axboe@fb.com>
init.c
iolog.c

diff --git a/init.c b/init.c
index bc17b40213a5bacdcecae2ca89e937ef86d6c8b8..6b6e386e398a04b4d8e27c7a034e6cd66e58025c 100644 (file)
--- 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 baa4b855d6a709131be83c1c68173c7af317c713..2b7b0babf085e6185e6a077464a27c23db1ca761 100644 (file)
--- 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);