diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2016-11-30 17:48:46 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2016-12-02 09:00:12 -0500 |
commit | 608ad1848b417f4b5771573ca9bfb811fcda3536 (patch) | |
tree | 4fc921fbe2ffef18fed754c2af95d12470ae5d88 | |
parent | 6d290391be9233349345d49f4539a87f8cb31c30 (diff) |
HID: intel_ish-hid: use %pUL for uuid formatting
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>
-rw-r--r-- | drivers/hid/intel-ish-hid/ishtp/bus.c | 9 |
1 files changed, 1 insertions, 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) | |||
585 | */ | 585 | */ |
586 | i = dev->fw_client_presentation_num - 1; | 586 | i = dev->fw_client_presentation_num - 1; |
587 | device_uuid = dev->fw_clients[i].props.protocol_name; | 587 | device_uuid = dev->fw_clients[i].props.protocol_name; |
588 | dev_name = kasprintf(GFP_KERNEL, | 588 | dev_name = kasprintf(GFP_KERNEL, "{%pUL}", device_uuid.b); |
589 | "{%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X}", | ||
590 | device_uuid.b[3], device_uuid.b[2], device_uuid.b[1], | ||
591 | device_uuid.b[0], device_uuid.b[5], device_uuid.b[4], | ||
592 | device_uuid.b[7], device_uuid.b[6], device_uuid.b[8], | ||
593 | device_uuid.b[9], device_uuid.b[10], device_uuid.b[11], | ||
594 | device_uuid.b[12], device_uuid.b[13], device_uuid.b[14], | ||
595 | device_uuid.b[15]); | ||
596 | if (!dev_name) | 589 | if (!dev_name) |
597 | return -ENOMEM; | 590 | return -ENOMEM; |
598 | 591 | ||