|
From: | Eric Blake |
Subject: | Re: [Qemu-devel] [PATCH v2 2/9] cutils: Fix qemu_strtosz() & friends to reject non-finite sizes |
Date: | Wed, 21 Nov 2018 11:25:04 -0600 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
On 11/21/18 4:44 AM, David Hildenbrand wrote:
@@ -206,20 +206,18 @@ static int64_t suffix_mul(char suffix, int64_t unit) * in *end, if not NULL. Return -ERANGE on overflow, Return -EINVAL onPre-existing, but since you're touching this area: the second 'Return' is unusual capitalization for being mid-sentence. You could even s/Return/of/"of"?"or" (ouch - wrong time for my fingers to be slipping on the keyboard)Shouldn't that be "and" and s/Return/Returns/ "Returns -ERANGE on overflow and -EINVAL on other errors". I can include that fixup (whetever version you guys prefer)
I was thinking: Return -ERANGE on overflow, or -EINVAL on other errors.'Return', not 'Returns', because of imperative mood. The choice of 'and' vs. 'or' is less of a sticking point; both sound fine to my native ear, especially since the word 'other' makes it apparent that you won't have both overflow and a conversion error at the same time (my initial choice of 'or' rather than 'and' was solely because you can't have two return values at once; but using 'and' seems okay at implying a sense of prioritization where overflow trumps other detected errors).
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |