summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-12-01 09:43:17 +0100
committerJens Axboe <axboe@suse.de>2005-12-01 09:43:17 +0100
commite79c92594a4237f747740e1e97a98d294d80daee (patch)
tree461c3acfce9064ab42d81c9a2c127ce7305e7fad
parent4aa2ff86b196d31af972a5c2df6dc1882a377454 (diff)
[PATCH] fio: fix -W warnings
-rw-r--r--arch.h2
-rw-r--r--fio.c24
-rw-r--r--fio.h2
3 files changed, 13 insertions, 15 deletions
diff --git a/arch.h b/arch.h
index 9245e18..3138a8e 100644
--- 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 1f0647e..9677cdf 100644
--- 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 94165fc..b1ceb24 100644
--- 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;