Declare 'prev' and 'this' outside the loop to avoid clang warning about 'prev' being...
authorBruce Cran <bruce@cran.org.uk>
Thu, 21 Feb 2013 13:16:17 +0000 (14:16 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 Feb 2013 13:16:17 +0000 (14:16 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
gettime.c

index cc9dcb7bea7ab28215e09304b3c32688be8d8f25..5b85a23b8519f3ca2bf1bde102972f4bf648377b 100644 (file)
--- a/gettime.c
+++ b/gettime.c
@@ -501,6 +501,7 @@ int fio_monotonic_clocktest(void)
        unsigned int nr_cpus = cpus_online();
        struct clock_entry *entries;
        unsigned long tentries, failed;
+       struct clock_entry *prev, *this;
        uint64_t seq = 0;
        int i;
 
@@ -558,7 +559,7 @@ int fio_monotonic_clocktest(void)
        qsort(entries, tentries, sizeof(struct clock_entry), clock_cmp);
 
        for (failed = i = 0; i < tentries; i++) {
-               struct clock_entry *prev, *this = &entries[i];
+               this = &entries[i];
 
                if (!i) {
                        prev = this;