From: "Jason A. Donenfeld" <Jason@zx2c4•com>
To: Theodore Ts'o <tytso@mit•edu>
Cc: "Kees Cook" <kees@kernel•org>,
"Kees Cook" <keescook@chromium•org>,
linux-kernel@vger•kernel.org, patches@lists•linux.dev,
"Greg Kroah-Hartman" <gregkh@linuxfoundation•org>,
"Jakub Kicinski" <kuba@kernel•org>,
"Russell King" <linux@armlinux•org.uk>,
"Catalin Marinas" <catalin.marinas@arm•com>,
"Thomas Bogendoerfer" <tsbogend@alpha•franken.de>,
"Heiko Carstens" <hca@linux•ibm.com>,
"Herbert Xu" <herbert@gondor•apana.org.au>,
"Christoph Böhmwalder" <christoph.boehmwalder@linbit•com>,
"Jani Nikula" <jani.nikula@linux•intel.com>,
"Jason Gunthorpe" <jgg@nvidia•com>,
"Sakari Ailus" <sakari.ailus@linux•intel.com>,
"Martin K . Petersen" <martin.petersen@oracle•com>,
"Andreas Dilger" <adilger.kernel@dilger•ca>,
"Jaegeuk Kim" <jaegeuk@kernel•org>,
"Richard Weinberger" <richard@nod•at>,
"Darrick J . Wong" <djwong@kernel•org>,
"SeongJae Park" <sj@kernel•org>,
"Thomas Gleixner" <tglx@linutronix•de>,
"Andrew Morton" <akpm@linux-foundation•org>,
"Michael Ellerman" <mpe@ellerman•id.au>,
"Helge Deller" <deller@gmx•de>,
netdev@vger•kernel.org, linux-crypto@vger•kernel.org,
linux-block@vger•kernel.org, linux-fsdevel@vger•kernel.org,
linux-media@vger•kernel.org,
linux-arm-kernel@lists•infradead.org, loongarch@lists•linux.dev,
linux-mips@vger•kernel.org, linuxppc-dev@lists•ozlabs.org,
linux-mmc@vger•kernel.org, linux-parisc@vger•kernel.org,
ydroneaud@opteya•com
Subject: Re: [PATCH v2 3/3] treewide: use get_random_u32_between() when possible
Date: Thu, 17 Nov 2022 17:19:52 +0100 [thread overview]
Message-ID: <Y3ZfKHTHWUkdZIMt@zx2c4.com> (raw)
In-Reply-To: <Y3ZWbcoGOdFjlPhS@mit.edu>
On Thu, Nov 17, 2022 at 10:42:37AM -0500, Theodore Ts'o wrote:
> On Wed, Nov 16, 2022 at 04:47:27PM -0800, Kees Cook wrote:
> > >> > - between
> > >> > - ranged
> > >> > - spanning
> > >> >
> > >> > https://www.thefreedictionary.com/List-of-prepositions.htm
> > >> > - amid
> > >> >
> > >> > Sigh, names.
> > >>
> > >> I think "inclusive" is best.
> > >
> > >I find it not very descriptive of what the function does. Is there one
> > >you like second best? Or are you convinced they're all much much much
> > >worse than "inclusive" that they shouldn't be considered?
> >
> > Right, I don't think any are sufficiently descriptive. "Incluisve"
> > with two arguments seems unambiguous and complete to me. :)
>
> The problem with "between", "ranged", "spanning" is that they don't
> tell the reader whether we're dealing with an "open interval" or a
> "closed interval". They are just different ways of saying that it's a
> range between, say, 0 and 20. But it doesn't tell you whether it
> includes 0 or 20 or not.
>
> The only way I can see for making it ambiguous is either to use the
> terminology "closed interval" or "inclusive". And "open" and "closed"
> can have other meanings, so get_random_u32_inclusive() is going to be
> less confusing than get_random_u32_closed().
Alright, that about settles it then. I'll re-roll.
Jason
next prev parent reply other threads:[~2022-11-17 16:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 16:45 [PATCH v2 0/3] convert tree to get_random_u32_{below,above,between}() Jason A. Donenfeld
2022-11-14 16:45 ` [PATCH v2 1/3] treewide: use get_random_u32_below() instead of deprecated function Jason A. Donenfeld
2022-11-14 17:35 ` Russell King (Oracle)
2022-11-14 16:45 ` [PATCH v2 2/3] treewide: use get_random_u32_{above,below}() instead of manual loop Jason A. Donenfeld
2022-11-14 16:45 ` [PATCH v2 3/3] treewide: use get_random_u32_between() when possible Jason A. Donenfeld
2022-11-16 22:43 ` Kees Cook
2022-11-16 23:55 ` Jason A. Donenfeld
2022-11-17 0:03 ` Jason A. Donenfeld
2022-11-17 0:31 ` Kees Cook
2022-11-17 0:43 ` Jason A. Donenfeld
2022-11-17 0:47 ` Kees Cook
2022-11-17 15:42 ` Theodore Ts'o
2022-11-17 16:19 ` Jason A. Donenfeld [this message]
2022-11-17 22:15 ` David Laight
2022-11-17 2:05 ` Jason A. Donenfeld
2022-11-17 10:32 ` Russell King (Oracle)
2022-11-17 20:29 ` [PATCH v3 0/3] convert tree to get_random_u32_{below,above,inclusive}() Jason A. Donenfeld
2022-11-17 20:29 ` [PATCH v3 1/3] treewide: use get_random_u32_below() instead of deprecated function Jason A. Donenfeld
2022-11-17 21:59 ` Kees Cook
2022-11-17 20:29 ` [PATCH v3 2/3] treewide: use get_random_u32_{above,below}() instead of manual loop Jason A. Donenfeld
2022-11-17 21:58 ` Kees Cook
2022-11-17 20:29 ` [PATCH v3 3/3] treewide: use get_random_u32_inclusive() when possible Jason A. Donenfeld
2022-11-17 21:57 ` Kees Cook
2022-11-17 22:10 ` Jason A. Donenfeld
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=Y3ZfKHTHWUkdZIMt@zx2c4.com \
--to=jason@zx2c4$(echo .)com \
--cc=adilger.kernel@dilger$(echo .)ca \
--cc=akpm@linux-foundation$(echo .)org \
--cc=catalin.marinas@arm$(echo .)com \
--cc=christoph.boehmwalder@linbit$(echo .)com \
--cc=deller@gmx$(echo .)de \
--cc=djwong@kernel$(echo .)org \
--cc=gregkh@linuxfoundation$(echo .)org \
--cc=hca@linux$(echo .)ibm.com \
--cc=herbert@gondor$(echo .)apana.org.au \
--cc=jaegeuk@kernel$(echo .)org \
--cc=jani.nikula@linux$(echo .)intel.com \
--cc=jgg@nvidia$(echo .)com \
--cc=kees@kernel$(echo .)org \
--cc=keescook@chromium$(echo .)org \
--cc=kuba@kernel$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-block@vger$(echo .)kernel.org \
--cc=linux-crypto@vger$(echo .)kernel.org \
--cc=linux-fsdevel@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-media@vger$(echo .)kernel.org \
--cc=linux-mips@vger$(echo .)kernel.org \
--cc=linux-mmc@vger$(echo .)kernel.org \
--cc=linux-parisc@vger$(echo .)kernel.org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=loongarch@lists$(echo .)linux.dev \
--cc=martin.petersen@oracle$(echo .)com \
--cc=mpe@ellerman$(echo .)id.au \
--cc=netdev@vger$(echo .)kernel.org \
--cc=patches@lists$(echo .)linux.dev \
--cc=richard@nod$(echo .)at \
--cc=sakari.ailus@linux$(echo .)intel.com \
--cc=sj@kernel$(echo .)org \
--cc=tglx@linutronix$(echo .)de \
--cc=tsbogend@alpha$(echo .)franken.de \
--cc=tytso@mit$(echo .)edu \
--cc=ydroneaud@opteya$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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