All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] parse: simplify parse_is_percent()
@ 2021-02-22 13:20 Alexey Dobriyan
  2021-02-22 14:36 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2021-02-22 13:20 UTC (permalink / raw)
  To: axboe; +Cc: fio, dmitry.fomichev

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)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-22 16:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 13:20 [PATCH 1/4] parse: simplify parse_is_percent() Alexey Dobriyan
2021-02-22 14:36 ` Jens Axboe
2021-02-22 16:37   ` Alexey Dobriyan
2021-02-22 16:38     ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.