lkml.org 
[lkml]   [2015]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2 v2] lib/vsprintf.c: Further simplify uuid_string()
Date
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.



\
 
 \ /
  Last update: 2015-05-12 14:01    [W:0.146 / U:1.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site