[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGt4E5uqxTkQHtaczim2BRijte3z5CVMoG172JaofL7Tf9HdbQ@mail.gmail.com>
Date: Wed, 13 Jul 2016 16:04:10 -0700
From: Markus Mayer <markus.mayer@...adcom.com>
To: Luis de Bethencourt <luisbg@....samsung.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Chris Metcalf <cmetcalf@...hip.com>,
Kees Cook <keescook@...omium.org>, devel@...verdev.osuosl.org,
linux-scsi@...r.kernel.org, linux-pm@...r.kernel.org,
nouveau@...ts.freedesktop.org, speakup@...ux-speakup.org,
Linux Kernel <linux-kernel@...r.kernel.org>,
dri-devel@...ts.freedesktop.org, linux-acpi@...r.kernel.org,
target-devel@...r.kernel.org
Subject: Re: [PATCH v3 1/7] lib: string: add functions to case-convert strings
On 13 July 2016 at 15:53, Luis de Bethencourt <luisbg@....samsung.com> wrote:
>
> Hi Markus,
>
> Thank you very much for the thorough testing and solution searching.
>
> Earlier today I sent a patch that removes dynamic_debug.h from
> include/linux/kernel.h, since it isn't really needed. Sorry about this
> since it changes what you were testing just a few hours later.
I did see at least some of the changes you posted. I was mostly
curious to see where the problem was coming from in the first place.
> I am starting to think that getting access to SIZE_MAX isn't worth the
> trouble, specially considering that moving an include out of the top
> of the file makes the code less readable. The Linux kernel is growing
> in complexity and trying to keep it readable for newcomers is very
> important IMHO.
I've been thinking the same thing. It seems to be turning into a huge
effort to make this simple constant available.
> The maintainers have the last word on this, but for now I remove my
> question about why use -1 instead of SIZE_MAX.
>
> Apologies for that, the silver lining was that at least for me it was
> interesting to explore this area of the code and its inclusions. I hope
> it was for you as well.
No need to apologize. It seemed like a no-brainer to use SIZE_MAX. :-)
And I am sure all the digging will come handy in some way.
> PD: just a small comment, in case you end up sending a new version of
> your patches. In the following documentation of your functions.
> * @len: Maximum string length. May be SIZE_MAX (-1) to set no limit.
>
> What do you think about "SIZE_MAX or -1" instead of "SIZE_MAX (-1)" to
> avoid confusing any readers who might think SIZE_MAX is a function? As
> I think you intend to mean your code accepts both -1 or SIZE_MAX, which
> is ~0.
>
> Just an idea, feel free to ignore it :)
I think I might use ~(size_t)0 directly instead of -1 (or SIZE_MAX).
Thanks,
-Markus
Powered by blists - more mailing lists