[PATCH] fio: fix -W warnings
authorJens Axboe <axboe@suse.de>
Thu, 1 Dec 2005 08:43:17 +0000 (09:43 +0100)
committerJens Axboe <axboe@suse.de>
Thu, 1 Dec 2005 08:43:17 +0000 (09:43 +0100)
arch.h
fio.c
fio.h

diff --git a/arch.h b/arch.h
index 9245e181de5d5db07cfe9a78d99cca34fb841560..3138a8e937381fe922978ca2cf4ff4033bd8c4d1 100644 (file)
--- a/arch.h
+++ b/arch.h
@@ -12,7 +12,7 @@ enum {
 
 static inline unsigned long generic_ffz(unsigned long word)
 {
-       int i;
+       unsigned int i;
 
        for (i = 0; i < sizeof(word) * 8; i++)
                if ((word & (1UL << i)) == 0)
diff --git a/fio.c b/fio.c
index 1f0647e539911c2b93873ee62680aaff7c18edc4..9677cdf08a81ac4b5014adfb66d0e6b80b669e18 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -204,7 +204,7 @@ static void mark_random_map(struct thread_data *td, struct io_u *io_u)
        unsigned int blocks = 0;
 
        while (blocks < (io_u->buflen / td->min_bs)) {
-               int idx, bit;
+               unsigned int idx, bit;
 
                if (!random_map_free(td, block))
                        break;
@@ -272,8 +272,7 @@ static unsigned int get_next_buflen(struct thread_data *td)
        return buflen;
 }
 
-static inline void add_stat_sample(struct thread_data *td, struct io_stat *is,
-                                  unsigned long val)
+static inline void add_stat_sample(struct io_stat *is, unsigned long val)
 {
        if (val > is->max_val)
                is->max_val = val;
@@ -302,7 +301,7 @@ static void add_log_sample(struct thread_data *td, struct io_log *log,
 
 static void add_clat_sample(struct thread_data *td, unsigned long msec)
 {
-       add_stat_sample(td, &td->clat_stat, msec);
+       add_stat_sample(&td->clat_stat, msec);
 
        if (td->lat_log)
                add_log_sample(td, td->lat_log, msec);
@@ -310,7 +309,7 @@ static void add_clat_sample(struct thread_data *td, unsigned long msec)
 
 static void add_slat_sample(struct thread_data *td, unsigned long msec)
 {
-       add_stat_sample(td, &td->slat_stat, msec);
+       add_stat_sample(&td->slat_stat, msec);
 }
 
 static void add_bw_sample(struct thread_data *td)
@@ -322,7 +321,7 @@ static void add_bw_sample(struct thread_data *td)
                return;
 
        rate = (td->this_io_bytes - td->stat_io_bytes) / spent;
-       add_stat_sample(td, &td->bw_stat, rate);
+       add_stat_sample(&td->bw_stat, rate);
 
        if (td->bw_log)
                add_log_sample(td, td->bw_log, rate);
@@ -334,7 +333,7 @@ static void add_bw_sample(struct thread_data *td)
 /*
  * busy looping version for the last few usec
  */
-static void __usec_sleep(int usec)
+static void __usec_sleep(unsigned int usec)
 {
        struct timeval start;
 
@@ -1498,7 +1497,7 @@ static int setup_file(struct thread_data *td)
 
 static int check_dev_match(dev_t dev, char *path)
 {
-       int major, minor;
+       unsigned int major, minor;
        char line[256], *p;
        FILE *f;
 
@@ -1931,8 +1930,7 @@ static void show_thread_status(struct thread_data *td,
        printf("  cpu        : usr=%3.2f%%, sys=%3.2f%%, ctx=%lu\n", usr_cpu, sys_cpu, td->ctx);
 }
 
-static void print_thread_status(struct thread_data *td, int nr_running,
-                               int t_rate, int m_rate)
+static void print_thread_status(int nr_running, int t_rate, int m_rate)
 {
        printf("Threads now running: %d", nr_running);
        if (m_rate || t_rate)
@@ -1982,7 +1980,7 @@ static void check_str_update(struct thread_data *td, int n, int t, int m)
        }
 
        run_str[td->thread_number - 1] = c;
-       print_thread_status(td, n, t, m);
+       print_thread_status(n, t, m);
        td->old_runstate = td->runstate;
 }
 
@@ -2018,7 +2016,7 @@ static void reap_threads(int *nr_running, int *t_rate, int *m_rate)
        }
 }
 
-static void run_threads(char *argv[])
+static void run_threads(void)
 {
        struct timeval genesis;
        struct thread_data *td;
@@ -2259,7 +2257,7 @@ int main(int argc, char *argv[])
 
        disk_util_timer_arm();
 
-       run_threads(argv);
+       run_threads();
        show_run_stats();
 
        return 0;
diff --git a/fio.h b/fio.h
index 94165fcfbcf2521547e10cb3f5460bf29d095d4d..b1ceb24fb34dc3ef5075b90583258b19deac68bf 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -115,7 +115,7 @@ struct thread_data {
 
        int shm_id;
 
-       off_t cur_off;
+       unsigned long long cur_off;
 
        io_context_t aio_ctx;
        unsigned int aio_depth;