From: Jens Axboe Date: Tue, 13 Nov 2012 15:31:24 +0000 (-0700) Subject: Get rid of uninitialized_var() X-Git-Tag: fio-2.0.11~8 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=24d23ca76f9be4500270e7074a1dab038e3a4a2b Get rid of uninitialized_var() It causes complaints on other compilers (clang). One case was actually not used at all, initialize the rest to 0. Signed-off-by: Jens Axboe --- diff --git a/compiler/compiler.h b/compiler/compiler.h index 8dec350b..8923f9a6 100644 --- a/compiler/compiler.h +++ b/compiler/compiler.h @@ -13,8 +13,6 @@ #define __must_check #endif -#define uninitialized_var(x) x = x - #ifndef _weak #ifndef __CYGWIN__ #define _weak __attribute__((weak)) diff --git a/engines/splice.c b/engines/splice.c index aa00234e..ca7997b7 100644 --- a/engines/splice.c +++ b/engines/splice.c @@ -204,7 +204,7 @@ static int fio_splice_write(struct thread_data *td, struct io_u *io_u) static int fio_spliceio_queue(struct thread_data *td, struct io_u *io_u) { struct spliceio_data *sd = td->io_ops->data; - int uninitialized_var(ret); + int ret = 0; fio_ro_check(td, io_u); diff --git a/io_u.c b/io_u.c index 119dd651..d81fefde 100644 --- a/io_u.c +++ b/io_u.c @@ -413,7 +413,7 @@ static inline int io_u_fits(struct thread_data *td, struct io_u *io_u, static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u) { const int ddir = io_u->ddir; - unsigned int uninitialized_var(buflen); + unsigned int buflen = 0; unsigned int minbs, maxbs; unsigned long r, rand_max; @@ -1345,7 +1345,7 @@ static void account_io_completion(struct thread_data *td, struct io_u *io_u, struct io_completion_data *icd, const enum fio_ddir idx, unsigned int bytes) { - unsigned long uninitialized_var(lusec); + unsigned long lusec = 0; if (!td->o.disable_clat || !td->o.disable_bw) lusec = utime_since(&io_u->issue_time, &icd->time); @@ -1388,11 +1388,6 @@ static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir) static void io_completed(struct thread_data *td, struct io_u *io_u, struct io_completion_data *icd) { - /* - * Older gcc's are too dumb to realize that usec is always used - * initialized, silence that warning. - */ - unsigned long uninitialized_var(usec); struct fio_file *f; dprint_io_u(io_u, "io complete");