From: Alexey Dobriyan <adobriyan@gmail.com>
To: axboe@kernel.dk
Cc: fio@vger.kernel.org, dmitry.fomichev@wdc.com
Subject: [PATCH 1/4] parse: simplify parse_is_percent()
Date: Mon, 22 Feb 2021 16:20:03 +0300 [thread overview]
Message-ID: <YDOvg+OKTZhSoDce@localhost.localdomain> (raw)
Check "unsigned long long val <= -1ULL" is tautologically true
because of how value conversions work.
Signed-off-by: Alexey Dobriyan (SK hynix) <adobriyan@gmail.com>
---
parse.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/parse.h
+++ b/parse.h
@@ -130,7 +130,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 <= -1ULL && val >= (-1ULL - 100ULL);
+ return val >= -101;
}
static inline int parse_is_percent_uncapped(unsigned long long val)
next reply other threads:[~2021-02-22 13:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-22 13:20 Alexey Dobriyan [this message]
2021-02-22 14:36 ` [PATCH 1/4] parse: simplify parse_is_percent() Jens Axboe
2021-02-22 16:37 ` Alexey Dobriyan
2021-02-22 16:38 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YDOvg+OKTZhSoDce@localhost.localdomain \
--to=adobriyan@gmail.com \
--cc=axboe@kernel.dk \
--cc=dmitry.fomichev@wdc.com \
--cc=fio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox