From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Jiri Kosina <jikos@kernel.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HID: intel_ish-hid: use %pUL for uuid formatting
Date: Thu, 1 Dec 2016 15:21:10 +0100 [thread overview]
Message-ID: <20161201142110.GB1280@mail.corp.redhat.com> (raw)
In-Reply-To: <1480546127-3539-1-git-send-email-linux@rasmusvillemoes.dk>
On Nov 30 2016 or thereabouts, Rasmus Villemoes wrote:
> 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>
> ---
> 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
>
next prev parent reply other threads:[~2016-12-01 14:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-30 22:48 Rasmus Villemoes
2016-12-01 14:21 ` Benjamin Tissoires [this message]
2016-12-01 23:51 ` Srinivas Pandruvada
2016-12-02 14:04 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161201142110.GB1280@mail.corp.redhat.com \
--to=benjamin.tissoires@redhat.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=srinivas.pandruvada@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®