parse: fix parse_is_percent() warning
authorNiklas Cassel <niklas.cassel@wdc.com>
Tue, 13 Apr 2021 10:03:31 +0000 (12:03 +0200)
committerNiklas Cassel <niklas.cassel@wdc.com>
Tue, 13 Apr 2021 10:12:11 +0000 (12:12 +0200)
When compiling an out of tree ioengine, such as the SPDK fio plugin,
which has -Wextra in CFLAGS, the compiler gives the following warning:

parse.h: In function ‘parse_is_percent’:
parse.h:134:13: warning: comparison of integer expressions of different signedness: ‘long long unsigned int’ and ‘int’ [-Wsign-compare]

Since this warning was introduced recently by fio
commit b75c0fae6612 ("parse: simplify parse_is_percent()"),
and since this is the only warning seen when compiling the SPDK fio
plugin, readd the ULL prefix to parse_is_percent().

Fixes: b75c0fae6612 ("parse: simplify parse_is_percent()")
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
parse.h

diff --git a/parse.h b/parse.h
index 4cf08fd2cf924f84eebd4080709c1ae83246da87..d68484eaf0c65572352222297162ebd0d20cf7e7 100644 (file)
--- a/parse.h
+++ b/parse.h
@@ -131,7 +131,7 @@ static inline void *td_var(void *to, const struct fio_option *o,
 
 static inline int parse_is_percent(unsigned long long val)
 {
-       return val >= -101;
+       return val >= -101ULL;
 }
 
 #define ZONE_BASE_VAL ((-1ULL >> 1) + 1)