From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: "George Spelvin" <linux@horizon.com>
Cc: joe@perches.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2 v2] lib/vsprintf.c: Further simplify uuid_string()
Date: Tue, 12 May 2015 13:26:50 +0200 [thread overview]
Message-ID: <87vbfy6nph.fsf@rasmusvillemoes.dk> (raw)
In-Reply-To: <20150512091036.5773.qmail@ns.horizon.com> (George Spelvin's message of "12 May 2015 05:10:36 -0400")
On Tue, May 12 2015, "George Spelvin" <linux@horizon.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@horizon.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@rasmusvillemoes.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.
next prev parent reply other threads:[~2015-05-12 11:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 16:32 [RFC PATCH] lib/vsprintf.c: Simplify uuid_string() George Spelvin
2015-05-11 16:49 ` Joe Perches
2015-05-11 16:55 ` George Spelvin
2015-05-11 19:53 ` [PATCH 1/2] " George Spelvin
2015-05-11 19:55 ` [PATCH 2/2] lib/vsprintf.c: Further simplify uuid_string() George Spelvin
2015-05-12 2:14 ` Joe Perches
2015-05-12 9:10 ` [PATCH 2/2 v2] " George Spelvin
2015-05-12 11:26 ` Rasmus Villemoes [this message]
2015-05-12 13:57 ` George Spelvin
2015-05-12 16:59 ` Joe Perches
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=87vbfy6nph.fsf@rasmusvillemoes.dk \
--to=linux@rasmusvillemoes.dk \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@horizon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.