From f79a334e33329168429e4cde5bc8541907e25847 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 2 Nov 2015 12:49:18 -0700 Subject: [PATCH] build: fix old-style declaration warnings Fix all of the uses of __thread so they are at the beginning (similar to e.g. static). Don't actually enable -Wold-style-declaration, since clang doesn't understand that. Change-Id: I0dcbb758143eab90fc978334c8f256c6602cc4cd Signed-off-by: Daniel Verkamp --- examples/nvme/perf/perf.c | 2 +- lib/nvme/nvme.c | 2 +- lib/nvme/nvme_internal.h | 2 +- test/lib/nvme/unit/nvme_ctrlr_c/nvme_ctrlr_ut.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index 28722e117..8d6f5588f 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -299,7 +299,7 @@ void task_ctor(struct rte_mempool *mp, void *arg, void *__task, unsigned id) static void io_complete(void *ctx, const struct nvme_completion *completion); -static unsigned int __thread seed = 0; +static __thread unsigned int seed = 0; static void submit_single_io(struct ns_entry *entry) diff --git a/lib/nvme/nvme.c b/lib/nvme/nvme.c index 64ff17aa8..213166bcc 100644 --- a/lib/nvme/nvme.c +++ b/lib/nvme/nvme.c @@ -43,7 +43,7 @@ struct nvme_driver g_nvme_driver = { }; int32_t nvme_retry_count; -int __thread nvme_thread_ioq_index = -1; +__thread int nvme_thread_ioq_index = -1; /** diff --git a/lib/nvme/nvme_internal.h b/lib/nvme/nvme_internal.h index 4c3dd3754..e62c6b5bd 100644 --- a/lib/nvme/nvme_internal.h +++ b/lib/nvme/nvme_internal.h @@ -283,7 +283,7 @@ struct nvme_controller { struct nvme_namespace_data *nsdata; }; -extern int __thread nvme_thread_ioq_index; +extern __thread int nvme_thread_ioq_index; struct nvme_driver { nvme_mutex_t lock; diff --git a/test/lib/nvme/unit/nvme_ctrlr_c/nvme_ctrlr_ut.c b/test/lib/nvme/unit/nvme_ctrlr_c/nvme_ctrlr_ut.c index 2937d2ec9..11d452827 100644 --- a/test/lib/nvme/unit/nvme_ctrlr_c/nvme_ctrlr_ut.c +++ b/test/lib/nvme/unit/nvme_ctrlr_c/nvme_ctrlr_ut.c @@ -42,7 +42,7 @@ struct nvme_driver g_nvme_driver = { char outbuf[OUTBUF_SIZE]; -int __thread nvme_thread_ioq_index = -1; +__thread int nvme_thread_ioq_index = -1; int nvme_qpair_construct(struct nvme_qpair *qpair, uint16_t id, uint16_t num_entries, uint16_t num_trackers,