All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HID: intel_ish-hid: use %pUL for uuid formatting
@ 2016-11-30 22:48 Rasmus Villemoes
  2016-12-01 14:21 ` Benjamin Tissoires
  2016-12-02 14:04 ` Jiri Kosina
  0 siblings, 2 replies; 7+ messages in thread
From: Rasmus Villemoes @ 2016-11-30 22:48 UTC (permalink / raw)
  To: Srinivas Pandruvada, Jiri Kosina, Benjamin Tissoires
  Cc: Rasmus Villemoes, linux-input, linux-kernel

We have the %pU printf extension for doing exactly this. Saves some
.text, and is likely also a little faster.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/hid/intel-ish-hid/ishtp/bus.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
index 256521509d20..f4cbc744e657 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -585,14 +585,7 @@ int ishtp_bus_new_client(struct ishtp_device *dev)
 	 */
 	i = dev->fw_client_presentation_num - 1;
 	device_uuid = dev->fw_clients[i].props.protocol_name;
-	dev_name = kasprintf(GFP_KERNEL,
-		"{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
-		device_uuid.b[3], device_uuid.b[2], device_uuid.b[1],
-		device_uuid.b[0], device_uuid.b[5], device_uuid.b[4],
-		device_uuid.b[7], device_uuid.b[6], device_uuid.b[8],
-		device_uuid.b[9], device_uuid.b[10], device_uuid.b[11],
-		device_uuid.b[12], device_uuid.b[13], device_uuid.b[14],
-		device_uuid.b[15]);
+	dev_name = kasprintf(GFP_KERNEL, "{%pUL}", device_uuid.b);
 	if (!dev_name)
 		return	-ENOMEM;
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-12-14 20:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-30 22:48 [PATCH] HID: intel_ish-hid: use %pUL for uuid formatting Rasmus Villemoes
2016-12-01 14:21 ` Benjamin Tissoires
2016-12-01 23:51   ` Srinivas Pandruvada
2016-12-02 14:04 ` Jiri Kosina
2016-12-14 18:27   ` Issue in applying patch [hid-sensor-hub: clear memory to avoid random data] Srinivas Pandruvada
2016-12-14 20:33     ` Jiri Kosina
2016-12-14 20:42       ` Srinivas Pandruvada

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.