summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Fu <vincent.fu@wdc.com>2019-07-31 16:57:51 -0400
committerJens Axboe <axboe@kernel.dk>2019-07-31 15:16:39 -0600
commit82a90566caf08964064e74241e5eb5e42c6fb189 (patch)
tree5c33182741b79f0a90c8ca34c2449a5414e29028
parentcf408d71681396f9b2ac5b277e3849176378c78e (diff)
smalloc: fix compiler warning on Windows
firstfree() triggers a warning from the Windows compiler used by AppVeyor because it doesn't return a value if the for loop iterates to completion. This patch resolves the compiler warning. AppVeyor Windows build log: https://ci.appveyor.com/project/axboe/fio/builds/26381726 Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--smalloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/smalloc.c b/smalloc.c
index c97bcba..0d7054a 100644
--- a/smalloc.c
+++ b/smalloc.c
@@ -347,6 +347,9 @@ static unsigned int firstfree(struct pool *pool)
return i;
assert(0);
+
+ /* we will never get here but this fixes a compiler warning */
+ return -1U;
}
static void *__smalloc_pool(struct pool *pool, size_t size)