[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87vbfy6nph.fsf@rasmusvillemoes.dk>
Date: Tue, 12 May 2015 13:26:50 +0200
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: "George Spelvin" <linux@...izon.com>
Cc: joe@...ches.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2 v2] lib/vsprintf.c: Further simplify uuid_string()
On Tue, May 12 2015, "George Spelvin" <linux@...izon.com> wrote:
> Make the endianness permutation table do double duty by having it
> list not source offsets, but destination offsets. Thus, it both puts
> the bytes in the right order and skips the hyphens.
>
> This further shrinks the code from 256 to 214 bytes. Eliminating
> erratic branches probably helps speed, too.
>
> Signed-off-by: George Spelvin <linux@...izon.com>
> ---
>> These might be better with a little comment/explanation
>> of the values as output offsets for each index.
>
> Like this? I had thought about it, and had decied not to change the
> existing lacomic code style, as it didn't seem any harder to understand
> than the original. But I'm happy to add comments.
>
With or without comments and the microscopic nit below:
Acked-by: Rasmus Villemoes <linux@...musvillemoes.dk>
You may want/need to include Andrew Morton in the cc-list to get these
picked up.
>
> lib/vsprintf.c | 32 ++++++++++++++------------------
> 1 file changed, 14 insertions(+), 18 deletions(-)
>
> + /* Insert the fixed punctuation */
> + uuid[23] = uuid[18] = uuid[13] = uuid[8] = '-';
> + uuid[36] = 0;
I think '\0' is more common.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists