Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1533651 > unrolled thread

[PATCH] HID: intel_ish-hid: use %pUL for uuid formatting

Started byRasmus Villemoes <linux@rasmusvillemoes.dk>
First post2016-11-30 23:50 +0100
Last post2016-12-02 15:10 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] HID: intel_ish-hid: use %pUL for uuid formatting Rasmus Villemoes <linux@rasmusvillemoes.dk> - 2016-11-30 23:50 +0100
    Re: [PATCH] HID: intel_ish-hid: use %pUL for uuid formatting Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-12-01 15:30 +0100
      Re: [PATCH] HID: intel_ish-hid: use %pUL for uuid formatting Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2016-12-02 01:00 +0100
    Re: [PATCH] HID: intel_ish-hid: use %pUL for uuid formatting Jiri Kosina <jikos@kernel.org> - 2016-12-02 15:10 +0100

#1533651 — [PATCH] HID: intel_ish-hid: use %pUL for uuid formatting

FromRasmus Villemoes <linux@rasmusvillemoes.dk>
Date2016-11-30 23:50 +0100
Subject[PATCH] HID: intel_ish-hid: use %pUL for uuid formatting
Message-ID<sJlRo-3GR-9@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1534153

FromBenjamin Tissoires <benjamin.tissoires@redhat.com>
Date2016-12-01 15:30 +0100
Message-ID<sJAx4-50F-19@gated-at.bofh.it>
In reply to#1533651
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
> 

[toc] | [prev] | [next] | [standalone]


#1534557

FromSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date2016-12-02 01:00 +0100
Message-ID<sJJqF-43a-5@gated-at.bofh.it>
In reply to#1534153
On Thu, 2016-12-01 at 15:21 +0100, Benjamin Tissoires wrote:
> 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>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.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
> > 

[toc] | [prev] | [next] | [standalone]


#1534935

FromJiri Kosina <jikos@kernel.org>
Date2016-12-02 15:10 +0100
Message-ID<sJWHf-4R5-3@gated-at.bofh.it>
In reply to#1533651
On Wed, 30 Nov 2016, 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>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web