Messages in this thread | | | From | Rasmus Villemoes <> | Subject | Re: [PATCH 2/2 v2] lib/vsprintf.c: Further simplify uuid_string() | Date | Tue, 12 May 2015 13:26:50 +0200 |
| |
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.
| |