[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1455711448-124103-2-git-send-email-andriy.shevchenko@linux.intel.com>
Date: Wed, 17 Feb 2016 14:17:19 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>,
"Theodore Ts'o" <tytso@....edu>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
David Airlie <airlied@...ux.ie>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Mathias Nyman <mathias.nyman@...el.com>,
Matt Fleming <matt@...eblueprint.co.uk>,
Lv Zheng <lv.zheng@...el.com>, Mark Brown <broonie@...nel.org>,
Zhang Rui <rui.zhang@...el.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org, linux-efi@...r.kernel.org,
linux-api@...r.kernel.org, linux-nvdimm@...ts.01.org
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v1 01/10] lib/vsprintf: simplify UUID printing
Since we have hex_byte_pack_upper() we may use it directly and avoid second
loop.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
lib/vsprintf.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 525c8e1..17d976b 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1324,7 +1324,10 @@ char *uuid_string(char *buf, char *end, const u8 *addr,
}
for (i = 0; i < 16; i++) {
- p = hex_byte_pack(p, addr[index[i]]);
+ if (uc)
+ p = hex_byte_pack_upper(p, addr[index[i]]);
+ else
+ p = hex_byte_pack(p, addr[index[i]]);
switch (i) {
case 3:
case 5:
@@ -1337,13 +1340,6 @@ char *uuid_string(char *buf, char *end, const u8 *addr,
*p = 0;
- if (uc) {
- p = uuid;
- do {
- *p = toupper(*p);
- } while (*(++p));
- }
-
return string(buf, end, uuid, spec);
}
--
2.7.0
Powered by blists - more mailing lists