init: don't use void* for pointer arithmetic (gcc)
authorTomohiro Kusumi <tkusumi@tuxera.com>
Fri, 23 Jun 2017 22:07:58 +0000 (01:07 +0300)
committerJens Axboe <axboe@kernel.dk>
Fri, 23 Jun 2017 22:19:53 +0000 (16:19 -0600)
I think gcc extension should be avoided when it can be done by
just changing a pointer type.

(threads is a pointer to struct thread_data)

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
init.c

diff --git a/init.c b/init.c
index 2b7768ab8ce1f6d57e0e82eaf46854b993abbda5..6efa5c1ce307976c46569af957e19260bd1ac746 100644 (file)
--- a/init.c
+++ b/init.c
@@ -361,7 +361,7 @@ static int setup_thread_area(void)
 #endif
 
        memset(threads, 0, max_jobs * sizeof(struct thread_data));
-       fio_debug_jobp = (void *) threads + max_jobs * sizeof(struct thread_data);
+       fio_debug_jobp = (unsigned int *)(threads + max_jobs);
        *fio_debug_jobp = -1;
 
        flow_init();