HID: intel_ish-hid: use %pUL for uuid formatting
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Wed, 30 Nov 2016 22:48:46 +0000 (23:48 +0100)
committerJiri Kosina <jkosina@suse.cz>
Fri, 2 Dec 2016 14:00:12 +0000 (15:00 +0100)
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>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/intel-ish-hid/ishtp/bus.c

index 256521509d200a4362df4a56467df5ccf261d837..f4cbc744e6571da94f5d0187ff4cf6e15a2fcd63 100644 (file)
@@ -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;