* [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
* Re: [PATCH 1/4] parse: simplify parse_is_percent()
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
0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2021-02-22 14:36 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: fio, dmitry.fomichev
On 2/22/21 6:20 AM, Alexey Dobriyan wrote:
> Check "unsigned long long val <= -1ULL" is tautologically true
> because of how value conversions work.
Thanks, applied this and the other 3 patches. Note for future
patch series you should use git send-email and provide a small cover
letter for the series. Also avoids typos like 2/5 for patch 2, and
it gives the reviewer a sense of the whole series.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/4] parse: simplify parse_is_percent()
2021-02-22 14:36 ` Jens Axboe
@ 2021-02-22 16:37 ` Alexey Dobriyan
2021-02-22 16:38 ` Jens Axboe
0 siblings, 1 reply; 4+ messages in thread
From: Alexey Dobriyan @ 2021-02-22 16:37 UTC (permalink / raw)
To: Jens Axboe; +Cc: fio, dmitry.fomichev
On Mon, Feb 22, 2021 at 07:36:42AM -0700, Jens Axboe wrote:
> On 2/22/21 6:20 AM, Alexey Dobriyan wrote:
> > Check "unsigned long long val <= -1ULL" is tautologically true
> > because of how value conversions work.
>
> Thanks, applied this and the other 3 patches. Note for future
> patch series you should use git send-email and provide a small cover
> letter for the series. Also avoids typos like 2/5 for patch 2, and
> it gives the reviewer a sense of the whole series.
Oh well, still can't get used to bulk emailing.
These patches are independent in fact.
There is textual dependency between parse_is_percent() and main 'z'
suffix patch.
And the rest was found while reading code for 'z' suffix.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/4] parse: simplify parse_is_percent()
2021-02-22 16:37 ` Alexey Dobriyan
@ 2021-02-22 16:38 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2021-02-22 16:38 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: fio, dmitry.fomichev
On 2/22/21 9:37 AM, Alexey Dobriyan wrote:
> On Mon, Feb 22, 2021 at 07:36:42AM -0700, Jens Axboe wrote:
>> On 2/22/21 6:20 AM, Alexey Dobriyan wrote:
>>> Check "unsigned long long val <= -1ULL" is tautologically true
>>> because of how value conversions work.
>>
>> Thanks, applied this and the other 3 patches. Note for future
>> patch series you should use git send-email and provide a small cover
>> letter for the series. Also avoids typos like 2/5 for patch 2, and
>> it gives the reviewer a sense of the whole series.
>
> Oh well, still can't get used to bulk emailing.
>
> These patches are independent in fact.
> There is textual dependency between parse_is_percent() and main 'z'
> suffix patch.
>
> And the rest was found while reading code for 'z' suffix.
Even if they are independent, it's easier to organize if you send
it out as a series :-)
--
Jens Axboe
^ 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.