summaryrefslogtreecommitdiff
path: root/gettime.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-11-06 09:21:10 -0700
committerJens Axboe <axboe@fb.com>2014-11-06 09:21:10 -0700
commit8a1db9a16e1075498e5d6166fa46b419cecd8af8 (patch)
treefdf212c4be45849b2647945c566c9afb7b765212 /gettime.c
parentd6b72507e72d3f2ed334fa5665880b0ab59dbfdd (diff)
downloadfio-8a1db9a16e1075498e5d6166fa46b419cecd8af8.tar.gz
fio-8a1db9a16e1075498e5d6166fa46b419cecd8af8.tar.bz2
Make fio -Wshadow clean
Found a few issues, actually. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'gettime.c')
-rw-r--r--gettime.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gettime.c b/gettime.c
index 9f836209..6a7e35f8 100644
--- a/gettime.c
+++ b/gettime.c
@@ -531,7 +531,7 @@ static int clock_cmp(const void *p1, const void *p2)
int fio_monotonic_clocktest(void)
{
- struct clock_thread *threads;
+ struct clock_thread *cthreads;
unsigned int nr_cpus = cpus_online();
struct clock_entry *entries;
unsigned long tentries, failed = 0;
@@ -549,14 +549,14 @@ int fio_monotonic_clocktest(void)
fio_debug &= ~(1U << FD_TIME);
#endif
- threads = malloc(nr_cpus * sizeof(struct clock_thread));
+ cthreads = malloc(nr_cpus * sizeof(struct clock_thread));
tentries = CLOCK_ENTRIES * nr_cpus;
entries = malloc(tentries * sizeof(struct clock_entry));
log_info("cs: Testing %u CPUs\n", nr_cpus);
for (i = 0; i < nr_cpus; i++) {
- struct clock_thread *t = &threads[i];
+ struct clock_thread *t = &cthreads[i];
t->cpu = i;
t->seq = &seq;
@@ -572,26 +572,26 @@ int fio_monotonic_clocktest(void)
}
for (i = 0; i < nr_cpus; i++) {
- struct clock_thread *t = &threads[i];
+ struct clock_thread *t = &cthreads[i];
pthread_mutex_lock(&t->started);
}
for (i = 0; i < nr_cpus; i++) {
- struct clock_thread *t = &threads[i];
+ struct clock_thread *t = &cthreads[i];
pthread_mutex_unlock(&t->lock);
}
for (i = 0; i < nr_cpus; i++) {
- struct clock_thread *t = &threads[i];
+ struct clock_thread *t = &cthreads[i];
void *ret;
pthread_join(t->thread, &ret);
if (ret)
failed++;
}
- free(threads);
+ free(cthreads);
if (failed) {
log_err("Clocksource test: %lu threads failed\n", failed);