RE: [PATCH] mei, make modules.alias UUID information easier to read

2015-09-21 Thread Winkler, Tomas


> -Original Message-
> From: Greg Kroah-Hartman [mailto:gre...@linuxfoundation.org]
> Sent: Monday, September 21, 2015 05:25
> To: Prarit Bhargava
> Cc: linux-kernel@vger.kernel.org; Winkler, Tomas; Joe Perches; David S. 
> Miller; Jiri
> Kosina; Sharon Dvir; Suthikulpanit, Suravee; Heikki Krogerus; James Hogan; 
> Daniel
> Thompson; Michael Opdenacker; David Cohen; Felipe Balbi; Ralf Baechle
> Subject: Re: [PATCH] mei, make modules.alias UUID information easier to read
> 
> On Fri, Aug 14, 2015 at 09:05:40AM -0400, Prarit Bhargava wrote:
> > 2nd try on this ...
> 
> What changed from the first patch?  I need some "version information" to
> figure out what is going on.
> 
> Can you resend it with that information?
> 
> thanks,

I saw you've already merged it to the testing branch so I'm not resending, 
Anyhow the original patch was done over Linus'  master branch instead of 
char-misc-next so it needed a rebase. 

Thanks.
Tomas

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] mei, make modules.alias UUID information easier to read

2015-09-21 Thread Winkler, Tomas


> -Original Message-
> From: Greg Kroah-Hartman [mailto:gre...@linuxfoundation.org]
> Sent: Monday, September 21, 2015 05:25
> To: Prarit Bhargava
> Cc: linux-kernel@vger.kernel.org; Winkler, Tomas; Joe Perches; David S. 
> Miller; Jiri
> Kosina; Sharon Dvir; Suthikulpanit, Suravee; Heikki Krogerus; James Hogan; 
> Daniel
> Thompson; Michael Opdenacker; David Cohen; Felipe Balbi; Ralf Baechle
> Subject: Re: [PATCH] mei, make modules.alias UUID information easier to read
> 
> On Fri, Aug 14, 2015 at 09:05:40AM -0400, Prarit Bhargava wrote:
> > 2nd try on this ...
> 
> What changed from the first patch?  I need some "version information" to
> figure out what is going on.
> 
> Can you resend it with that information?
> 
> thanks,

I saw you've already merged it to the testing branch so I'm not resending, 
Anyhow the original patch was done over Linus'  master branch instead of 
char-misc-next so it needed a rebase. 

Thanks.
Tomas

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mei, make modules.alias UUID information easier to read

2015-09-20 Thread Greg Kroah-Hartman
On Fri, Aug 14, 2015 at 09:05:40AM -0400, Prarit Bhargava wrote:
> 2nd try on this ...

What changed from the first patch?  I need some "version information" to
figure out what is going on.

Can you resend it with that information?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mei, make modules.alias UUID information easier to read

2015-09-20 Thread Greg Kroah-Hartman
On Fri, Aug 14, 2015 at 09:05:40AM -0400, Prarit Bhargava wrote:
> 2nd try on this ...

What changed from the first patch?  I need some "version information" to
figure out what is going on.

Can you resend it with that information?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mei, make modules.alias UUID information easier to read

2015-08-31 Thread Prarit Bhargava


On 08/29/2015 05:21 PM, Winkler, Tomas wrote:
>>
>> Hi Prarit,
>>
>> On Fri, Aug 28, 2015 at 07:50:52AM -0400, Prarit Bhargava wrote:
>>> Heikki, Tomas?
>>
>> I'm afraid I don't know much about Intel's Management Engine
>> Interface. Looks like the driver is from Samuel (CC'd) so I'm guessing
>> he is the person you wanted comments from and not me.
>>
> 
> The patch was done against the master branch instead of char-misc-next so it 
> doesn't apply. Anyhow I've rebased it already and I'm testing it. 
> I will probably re-post it, with your permission with my other mei bus fixes.
> 

Yep, only requires some minor adjustments in order to apply to char-misc-next.
Please repost when you can.  FYI: this is needed to bring drivers/staging/unisys
out of the staging directory.

> BTW, I took the inspiration from vmbus in regards to uuid  representation so 
> it if the uuid sting hurts you, you may fix vmbus as well.  I don't have any  
> vmbus setup and I try not to fix things I cannot check.
> 

I didn't recall other users of add_uuid() but took a look anway.

do_vmbus_entry() doesn't call add_uuid() like do_mei_entry() does.  However,
the vmbus code should also just simply use add_uuid().  I can do that after
this patch gets into the kernel, as it isn't absolutely necessary to fix like
do_mei_entry().  It should be a trivial drivers/hv patch to fix all
that up.

P.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] mei, make modules.alias UUID information easier to read

2015-08-31 Thread Winkler, Tomas

> On 08/29/2015 05:21 PM, Winkler, Tomas wrote:
> >>
> >> Hi Prarit,
> >>
> >> On Fri, Aug 28, 2015 at 07:50:52AM -0400, Prarit Bhargava wrote:
> >>> Heikki, Tomas?
> >>
> >> I'm afraid I don't know much about Intel's Management Engine
> >> Interface. Looks like the driver is from Samuel (CC'd) so I'm guessing
> >> he is the person you wanted comments from and not me.
> >>
> >
> > The patch was done against the master branch instead of char-misc-next so it
> doesn't apply. Anyhow I've rebased it already and I'm testing it.
> > I will probably re-post it, with your permission with my other mei bus 
> > fixes.
> 
> Tomas, can you send me a link to your tree?

Sorry, it is not public. But it is very close to what is on 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 
char-misc-next  branch
I will send new patches soon ... after 4.3-rc1 is out.
Thanks
Tomas


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] mei, make modules.alias UUID information easier to read

2015-08-31 Thread Winkler, Tomas

> On 08/29/2015 05:21 PM, Winkler, Tomas wrote:
> >>
> >> Hi Prarit,
> >>
> >> On Fri, Aug 28, 2015 at 07:50:52AM -0400, Prarit Bhargava wrote:
> >>> Heikki, Tomas?
> >>
> >> I'm afraid I don't know much about Intel's Management Engine
> >> Interface. Looks like the driver is from Samuel (CC'd) so I'm guessing
> >> he is the person you wanted comments from and not me.
> >>
> >
> > The patch was done against the master branch instead of char-misc-next so it
> doesn't apply. Anyhow I've rebased it already and I'm testing it.
> > I will probably re-post it, with your permission with my other mei bus 
> > fixes.
> 
> Tomas, can you send me a link to your tree?

Sorry, it is not public. But it is very close to what is on 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 
char-misc-next  branch
I will send new patches soon ... after 4.3-rc1 is out.
Thanks
Tomas


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mei, make modules.alias UUID information easier to read

2015-08-31 Thread Prarit Bhargava


On 08/29/2015 05:21 PM, Winkler, Tomas wrote:
>>
>> Hi Prarit,
>>
>> On Fri, Aug 28, 2015 at 07:50:52AM -0400, Prarit Bhargava wrote:
>>> Heikki, Tomas?
>>
>> I'm afraid I don't know much about Intel's Management Engine
>> Interface. Looks like the driver is from Samuel (CC'd) so I'm guessing
>> he is the person you wanted comments from and not me.
>>
> 
> The patch was done against the master branch instead of char-misc-next so it 
> doesn't apply. Anyhow I've rebased it already and I'm testing it. 
> I will probably re-post it, with your permission with my other mei bus fixes.
> 

Yep, only requires some minor adjustments in order to apply to char-misc-next.
Please repost when you can.  FYI: this is needed to bring drivers/staging/unisys
out of the staging directory.

> BTW, I took the inspiration from vmbus in regards to uuid  representation so 
> it if the uuid sting hurts you, you may fix vmbus as well.  I don't have any  
> vmbus setup and I try not to fix things I cannot check.
> 

I didn't recall other users of add_uuid() but took a look anway.

do_vmbus_entry() doesn't call add_uuid() like do_mei_entry() does.  However,
the vmbus code should also just simply use add_uuid().  I can do that after
this patch gets into the kernel, as it isn't absolutely necessary to fix like
do_mei_entry().  It should be a trivial drivers/hv patch to fix all
that up.

P.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mei, make modules.alias UUID information easier to read

2015-08-30 Thread Prarit Bhargava


On 08/29/2015 05:21 PM, Winkler, Tomas wrote:
>>
>> Hi Prarit,
>>
>> On Fri, Aug 28, 2015 at 07:50:52AM -0400, Prarit Bhargava wrote:
>>> Heikki, Tomas?
>>
>> I'm afraid I don't know much about Intel's Management Engine
>> Interface. Looks like the driver is from Samuel (CC'd) so I'm guessing
>> he is the person you wanted comments from and not me.
>>
> 
> The patch was done against the master branch instead of char-misc-next so it 
> doesn't apply. Anyhow I've rebased it already and I'm testing it. 
> I will probably re-post it, with your permission with my other mei bus fixes.

Tomas, can you send me a link to your tree?


> 
> BTW, I took the inspiration from vmbus in regards to uuid  representation so 
> it if the uuid sting hurts you, you may fix vmbus as well.  I don't have any  
> vmbus setup and I try not to fix things I cannot check.
> 

I'll find a system that I can test vmbus on.

P.

> Thanks
> Tomas 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mei, make modules.alias UUID information easier to read

2015-08-30 Thread Prarit Bhargava


On 08/29/2015 05:21 PM, Winkler, Tomas wrote:

 Hi Prarit,

 On Fri, Aug 28, 2015 at 07:50:52AM -0400, Prarit Bhargava wrote:
 Heikki, Tomas?

 I'm afraid I don't know much about Intel's Management Engine
 Interface. Looks like the driver is from Samuel (CC'd) so I'm guessing
 he is the person you wanted comments from and not me.

 
 The patch was done against the master branch instead of char-misc-next so it 
 doesn't apply. Anyhow I've rebased it already and I'm testing it. 
 I will probably re-post it, with your permission with my other mei bus fixes.

Tomas, can you send me a link to your tree?


 
 BTW, I took the inspiration from vmbus in regards to uuid  representation so 
 it if the uuid sting hurts you, you may fix vmbus as well.  I don't have any  
 vmbus setup and I try not to fix things I cannot check.
 

I'll find a system that I can test vmbus on.

P.

 Thanks
 Tomas 
 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] mei, make modules.alias UUID information easier to read

2015-08-29 Thread Winkler, Tomas
> 
> Hi Prarit,
> 
> On Fri, Aug 28, 2015 at 07:50:52AM -0400, Prarit Bhargava wrote:
> > Heikki, Tomas?
> 
> I'm afraid I don't know much about Intel's Management Engine
> Interface. Looks like the driver is from Samuel (CC'd) so I'm guessing
> he is the person you wanted comments from and not me.
> 

The patch was done against the master branch instead of char-misc-next so it 
doesn't apply. Anyhow I've rebased it already and I'm testing it. 
I will probably re-post it, with your permission with my other mei bus fixes.

BTW, I took the inspiration from vmbus in regards to uuid  representation so it 
if the uuid sting hurts you, you may fix vmbus as well.  I don't have any  
vmbus setup and I try not to fix things I cannot check.

Thanks
Tomas 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] mei, make modules.alias UUID information easier to read

2015-08-29 Thread Winkler, Tomas
 
 Hi Prarit,
 
 On Fri, Aug 28, 2015 at 07:50:52AM -0400, Prarit Bhargava wrote:
  Heikki, Tomas?
 
 I'm afraid I don't know much about Intel's Management Engine
 Interface. Looks like the driver is from Samuel (CC'd) so I'm guessing
 he is the person you wanted comments from and not me.
 

The patch was done against the master branch instead of char-misc-next so it 
doesn't apply. Anyhow I've rebased it already and I'm testing it. 
I will probably re-post it, with your permission with my other mei bus fixes.

BTW, I took the inspiration from vmbus in regards to uuid  representation so it 
if the uuid sting hurts you, you may fix vmbus as well.  I don't have any  
vmbus setup and I try not to fix things I cannot check.

Thanks
Tomas 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mei, make modules.alias UUID information easier to read

2015-08-28 Thread Heikki Krogerus
Hi Prarit,

On Fri, Aug 28, 2015 at 07:50:52AM -0400, Prarit Bhargava wrote:
> Heikki, Tomas?

I'm afraid I don't know much about Intel's Management Engine
Interface. Looks like the driver is from Samuel (CC'd) so I'm guessing
he is the person you wanted comments from and not me.

cheers,

> On 08/14/2015 09:05 AM, Prarit Bhargava wrote:
> > 2nd try on this ...
> > 
> > P.
> > 
> > ---8<---
> > 
> > scripts/mod/file2alias.c:add_uuid() munges a UUID into a single string
> > which does not conform to the standard little endian UUID.  This patch
> > changes add_uuid() to use the UUID correctly so that future drivers which
> > use UUID matches can simply use the %pUL format, and modifies the mei
> > driver with those changes.
> > 
> > Cc: Tomas Winkler 
> > Cc: Greg Kroah-Hartman 
> > Cc: Joe Perches 
> > Cc: "David S. Miller" 
> > Cc: Jiri Kosina 
> > Cc: Sharon Dvir 
> > Cc: "Suthikulpanit, Suravee" 
> > Cc: Heikki Krogerus 
> > Cc: James Hogan 
> > Cc: Daniel Thompson 
> > Cc: Michael Opdenacker 
> > Cc: David Cohen 
> > Cc: Felipe Balbi 
> > Cc: Ralf Baechle 
> > 
> > Signed-off-by: Prarit Bhargava 
> > ---
> >  drivers/misc/mei/bus.c  |6 ++
> >  include/linux/mod_devicetable.h |4 
> >  scripts/mod/file2alias.c|9 ++---
> >  3 files changed, 8 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
> > index 458aa5a..457e132 100644
> > --- a/drivers/misc/mei/bus.c
> > +++ b/drivers/misc/mei/bus.c
> > @@ -141,8 +141,7 @@ static ssize_t modalias_show(struct device *dev, struct 
> > device_attribute *a,
> > const uuid_le *uuid = mei_me_cl_uuid(device->me_cl);
> > size_t len;
> >  
> > -   len = snprintf(buf, PAGE_SIZE, "mei:%s:" MEI_CL_UUID_FMT ":",
> > -   device->name, MEI_CL_UUID_ARGS(uuid->b));
> > +   len = snprintf(buf, PAGE_SIZE, "mei:%s:%pUl:", device->name, uuid);
> >  
> > return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
> >  }
> > @@ -167,8 +166,7 @@ static int mei_cl_uevent(struct device *dev, struct 
> > kobj_uevent_env *env)
> > if (add_uevent_var(env, "MEI_CL_NAME=%s", device->name))
> > return -ENOMEM;
> >  
> > -   if (add_uevent_var(env, "MODALIAS=mei:%s:" MEI_CL_UUID_FMT ":",
> > -   device->name, MEI_CL_UUID_ARGS(uuid->b)))
> > +   if (add_uevent_var(env, "MODALIAS=mei:%s:%pUl:", device->name, uuid))
> > return -ENOMEM;
> >  
> > return 0;
> > diff --git a/include/linux/mod_devicetable.h 
> > b/include/linux/mod_devicetable.h
> > index 34f25b7..becda6f 100644
> > --- a/include/linux/mod_devicetable.h
> > +++ b/include/linux/mod_devicetable.h
> > @@ -601,10 +601,6 @@ struct ipack_device_id {
> >  
> >  #define MEI_CL_MODULE_PREFIX "mei:"
> >  #define MEI_CL_NAME_SIZE 32
> > -#define MEI_CL_UUID_FMT 
> > "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
> > -#define MEI_CL_UUID_ARGS(_u) \
> > -   _u[0], _u[1], _u[2], _u[3], _u[4], _u[5], _u[6], _u[7], \
> > -   _u[8], _u[9], _u[10], _u[11], _u[12], _u[13], _u[14], _u[15]
> >  
> >  /**
> >   * struct mei_cl_device_id - MEI client device identifier
> > diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> > index 5f20882..8a46c60 100644
> > --- a/scripts/mod/file2alias.c
> > +++ b/scripts/mod/file2alias.c
> > @@ -137,10 +137,13 @@ static inline void add_wildcard(char *str)
> >  static inline void add_uuid(char *str, uuid_le uuid)
> >  {
> > int len = strlen(str);
> > -   int i;
> >  
> > -   for (i = 0; i < 16; i++)
> > -   sprintf(str + len + (i << 1), "%02x", uuid.b[i]);
> > +   sprintf(str + len,
> > +   
> > "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
> > +   uuid.b[3], uuid.b[2], uuid.b[1], uuid.b[0],
> > +   uuid.b[5], uuid.b[4], uuid.b[7], uuid.b[6],
> > +   uuid.b[8], uuid.b[9], uuid.b[10], uuid.b[11],
> > +   uuid.b[12], uuid.b[13], uuid.b[14], uuid.b[15]);
> >  }
> >  
> >  /**

-- 
heikki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mei, make modules.alias UUID information easier to read

2015-08-28 Thread Prarit Bhargava
Heikki, Tomas?

P.


On 08/14/2015 09:05 AM, Prarit Bhargava wrote:
> 2nd try on this ...
> 
> P.
> 
> ---8<---
> 
> scripts/mod/file2alias.c:add_uuid() munges a UUID into a single string
> which does not conform to the standard little endian UUID.  This patch
> changes add_uuid() to use the UUID correctly so that future drivers which
> use UUID matches can simply use the %pUL format, and modifies the mei
> driver with those changes.
> 
> Cc: Tomas Winkler 
> Cc: Greg Kroah-Hartman 
> Cc: Joe Perches 
> Cc: "David S. Miller" 
> Cc: Jiri Kosina 
> Cc: Sharon Dvir 
> Cc: "Suthikulpanit, Suravee" 
> Cc: Heikki Krogerus 
> Cc: James Hogan 
> Cc: Daniel Thompson 
> Cc: Michael Opdenacker 
> Cc: David Cohen 
> Cc: Felipe Balbi 
> Cc: Ralf Baechle 
> 
> Signed-off-by: Prarit Bhargava 
> ---
>  drivers/misc/mei/bus.c  |6 ++
>  include/linux/mod_devicetable.h |4 
>  scripts/mod/file2alias.c|9 ++---
>  3 files changed, 8 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
> index 458aa5a..457e132 100644
> --- a/drivers/misc/mei/bus.c
> +++ b/drivers/misc/mei/bus.c
> @@ -141,8 +141,7 @@ static ssize_t modalias_show(struct device *dev, struct 
> device_attribute *a,
>   const uuid_le *uuid = mei_me_cl_uuid(device->me_cl);
>   size_t len;
>  
> - len = snprintf(buf, PAGE_SIZE, "mei:%s:" MEI_CL_UUID_FMT ":",
> - device->name, MEI_CL_UUID_ARGS(uuid->b));
> + len = snprintf(buf, PAGE_SIZE, "mei:%s:%pUl:", device->name, uuid);
>  
>   return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
>  }
> @@ -167,8 +166,7 @@ static int mei_cl_uevent(struct device *dev, struct 
> kobj_uevent_env *env)
>   if (add_uevent_var(env, "MEI_CL_NAME=%s", device->name))
>   return -ENOMEM;
>  
> - if (add_uevent_var(env, "MODALIAS=mei:%s:" MEI_CL_UUID_FMT ":",
> - device->name, MEI_CL_UUID_ARGS(uuid->b)))
> + if (add_uevent_var(env, "MODALIAS=mei:%s:%pUl:", device->name, uuid))
>   return -ENOMEM;
>  
>   return 0;
> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
> index 34f25b7..becda6f 100644
> --- a/include/linux/mod_devicetable.h
> +++ b/include/linux/mod_devicetable.h
> @@ -601,10 +601,6 @@ struct ipack_device_id {
>  
>  #define MEI_CL_MODULE_PREFIX "mei:"
>  #define MEI_CL_NAME_SIZE 32
> -#define MEI_CL_UUID_FMT 
> "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
> -#define MEI_CL_UUID_ARGS(_u) \
> - _u[0], _u[1], _u[2], _u[3], _u[4], _u[5], _u[6], _u[7], \
> - _u[8], _u[9], _u[10], _u[11], _u[12], _u[13], _u[14], _u[15]
>  
>  /**
>   * struct mei_cl_device_id - MEI client device identifier
> diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> index 5f20882..8a46c60 100644
> --- a/scripts/mod/file2alias.c
> +++ b/scripts/mod/file2alias.c
> @@ -137,10 +137,13 @@ static inline void add_wildcard(char *str)
>  static inline void add_uuid(char *str, uuid_le uuid)
>  {
>   int len = strlen(str);
> - int i;
>  
> - for (i = 0; i < 16; i++)
> - sprintf(str + len + (i << 1), "%02x", uuid.b[i]);
> + sprintf(str + len,
> + 
> "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
> + uuid.b[3], uuid.b[2], uuid.b[1], uuid.b[0],
> + uuid.b[5], uuid.b[4], uuid.b[7], uuid.b[6],
> + uuid.b[8], uuid.b[9], uuid.b[10], uuid.b[11],
> + uuid.b[12], uuid.b[13], uuid.b[14], uuid.b[15]);
>  }
>  
>  /**
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mei, make modules.alias UUID information easier to read

2015-08-28 Thread Heikki Krogerus
Hi Prarit,

On Fri, Aug 28, 2015 at 07:50:52AM -0400, Prarit Bhargava wrote:
 Heikki, Tomas?

I'm afraid I don't know much about Intel's Management Engine
Interface. Looks like the driver is from Samuel (CC'd) so I'm guessing
he is the person you wanted comments from and not me.

cheers,

 On 08/14/2015 09:05 AM, Prarit Bhargava wrote:
  2nd try on this ...
  
  P.
  
  ---8---
  
  scripts/mod/file2alias.c:add_uuid() munges a UUID into a single string
  which does not conform to the standard little endian UUID.  This patch
  changes add_uuid() to use the UUID correctly so that future drivers which
  use UUID matches can simply use the %pUL format, and modifies the mei
  driver with those changes.
  
  Cc: Tomas Winkler tomas.wink...@intel.com
  Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
  Cc: Joe Perches j...@perches.com
  Cc: David S. Miller da...@davemloft.net
  Cc: Jiri Kosina jkos...@suse.cz
  Cc: Sharon Dvir sharon.dv...@mail.huji.ac.il
  Cc: Suthikulpanit, Suravee suravee.suthikulpa...@amd.com
  Cc: Heikki Krogerus heikki.kroge...@linux.intel.com
  Cc: James Hogan james.ho...@imgtec.com
  Cc: Daniel Thompson daniel.thomp...@linaro.org
  Cc: Michael Opdenacker michael.opdenac...@free-electrons.com
  Cc: David Cohen david.a.co...@linux.intel.com
  Cc: Felipe Balbi ba...@ti.com
  Cc: Ralf Baechle r...@linux-mips.org
  
  Signed-off-by: Prarit Bhargava pra...@redhat.com
  ---
   drivers/misc/mei/bus.c  |6 ++
   include/linux/mod_devicetable.h |4 
   scripts/mod/file2alias.c|9 ++---
   3 files changed, 8 insertions(+), 11 deletions(-)
  
  diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
  index 458aa5a..457e132 100644
  --- a/drivers/misc/mei/bus.c
  +++ b/drivers/misc/mei/bus.c
  @@ -141,8 +141,7 @@ static ssize_t modalias_show(struct device *dev, struct 
  device_attribute *a,
  const uuid_le *uuid = mei_me_cl_uuid(device-me_cl);
  size_t len;
   
  -   len = snprintf(buf, PAGE_SIZE, mei:%s: MEI_CL_UUID_FMT :,
  -   device-name, MEI_CL_UUID_ARGS(uuid-b));
  +   len = snprintf(buf, PAGE_SIZE, mei:%s:%pUl:, device-name, uuid);
   
  return (len = PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
   }
  @@ -167,8 +166,7 @@ static int mei_cl_uevent(struct device *dev, struct 
  kobj_uevent_env *env)
  if (add_uevent_var(env, MEI_CL_NAME=%s, device-name))
  return -ENOMEM;
   
  -   if (add_uevent_var(env, MODALIAS=mei:%s: MEI_CL_UUID_FMT :,
  -   device-name, MEI_CL_UUID_ARGS(uuid-b)))
  +   if (add_uevent_var(env, MODALIAS=mei:%s:%pUl:, device-name, uuid))
  return -ENOMEM;
   
  return 0;
  diff --git a/include/linux/mod_devicetable.h 
  b/include/linux/mod_devicetable.h
  index 34f25b7..becda6f 100644
  --- a/include/linux/mod_devicetable.h
  +++ b/include/linux/mod_devicetable.h
  @@ -601,10 +601,6 @@ struct ipack_device_id {
   
   #define MEI_CL_MODULE_PREFIX mei:
   #define MEI_CL_NAME_SIZE 32
  -#define MEI_CL_UUID_FMT 
  %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
  -#define MEI_CL_UUID_ARGS(_u) \
  -   _u[0], _u[1], _u[2], _u[3], _u[4], _u[5], _u[6], _u[7], \
  -   _u[8], _u[9], _u[10], _u[11], _u[12], _u[13], _u[14], _u[15]
   
   /**
* struct mei_cl_device_id - MEI client device identifier
  diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
  index 5f20882..8a46c60 100644
  --- a/scripts/mod/file2alias.c
  +++ b/scripts/mod/file2alias.c
  @@ -137,10 +137,13 @@ static inline void add_wildcard(char *str)
   static inline void add_uuid(char *str, uuid_le uuid)
   {
  int len = strlen(str);
  -   int i;
   
  -   for (i = 0; i  16; i++)
  -   sprintf(str + len + (i  1), %02x, uuid.b[i]);
  +   sprintf(str + len,
  +   
  %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x,
  +   uuid.b[3], uuid.b[2], uuid.b[1], uuid.b[0],
  +   uuid.b[5], uuid.b[4], uuid.b[7], uuid.b[6],
  +   uuid.b[8], uuid.b[9], uuid.b[10], uuid.b[11],
  +   uuid.b[12], uuid.b[13], uuid.b[14], uuid.b[15]);
   }
   
   /**

-- 
heikki
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mei, make modules.alias UUID information easier to read

2015-08-28 Thread Prarit Bhargava
Heikki, Tomas?

P.


On 08/14/2015 09:05 AM, Prarit Bhargava wrote:
 2nd try on this ...
 
 P.
 
 ---8---
 
 scripts/mod/file2alias.c:add_uuid() munges a UUID into a single string
 which does not conform to the standard little endian UUID.  This patch
 changes add_uuid() to use the UUID correctly so that future drivers which
 use UUID matches can simply use the %pUL format, and modifies the mei
 driver with those changes.
 
 Cc: Tomas Winkler tomas.wink...@intel.com
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Cc: Joe Perches j...@perches.com
 Cc: David S. Miller da...@davemloft.net
 Cc: Jiri Kosina jkos...@suse.cz
 Cc: Sharon Dvir sharon.dv...@mail.huji.ac.il
 Cc: Suthikulpanit, Suravee suravee.suthikulpa...@amd.com
 Cc: Heikki Krogerus heikki.kroge...@linux.intel.com
 Cc: James Hogan james.ho...@imgtec.com
 Cc: Daniel Thompson daniel.thomp...@linaro.org
 Cc: Michael Opdenacker michael.opdenac...@free-electrons.com
 Cc: David Cohen david.a.co...@linux.intel.com
 Cc: Felipe Balbi ba...@ti.com
 Cc: Ralf Baechle r...@linux-mips.org
 
 Signed-off-by: Prarit Bhargava pra...@redhat.com
 ---
  drivers/misc/mei/bus.c  |6 ++
  include/linux/mod_devicetable.h |4 
  scripts/mod/file2alias.c|9 ++---
  3 files changed, 8 insertions(+), 11 deletions(-)
 
 diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
 index 458aa5a..457e132 100644
 --- a/drivers/misc/mei/bus.c
 +++ b/drivers/misc/mei/bus.c
 @@ -141,8 +141,7 @@ static ssize_t modalias_show(struct device *dev, struct 
 device_attribute *a,
   const uuid_le *uuid = mei_me_cl_uuid(device-me_cl);
   size_t len;
  
 - len = snprintf(buf, PAGE_SIZE, mei:%s: MEI_CL_UUID_FMT :,
 - device-name, MEI_CL_UUID_ARGS(uuid-b));
 + len = snprintf(buf, PAGE_SIZE, mei:%s:%pUl:, device-name, uuid);
  
   return (len = PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
  }
 @@ -167,8 +166,7 @@ static int mei_cl_uevent(struct device *dev, struct 
 kobj_uevent_env *env)
   if (add_uevent_var(env, MEI_CL_NAME=%s, device-name))
   return -ENOMEM;
  
 - if (add_uevent_var(env, MODALIAS=mei:%s: MEI_CL_UUID_FMT :,
 - device-name, MEI_CL_UUID_ARGS(uuid-b)))
 + if (add_uevent_var(env, MODALIAS=mei:%s:%pUl:, device-name, uuid))
   return -ENOMEM;
  
   return 0;
 diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
 index 34f25b7..becda6f 100644
 --- a/include/linux/mod_devicetable.h
 +++ b/include/linux/mod_devicetable.h
 @@ -601,10 +601,6 @@ struct ipack_device_id {
  
  #define MEI_CL_MODULE_PREFIX mei:
  #define MEI_CL_NAME_SIZE 32
 -#define MEI_CL_UUID_FMT 
 %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
 -#define MEI_CL_UUID_ARGS(_u) \
 - _u[0], _u[1], _u[2], _u[3], _u[4], _u[5], _u[6], _u[7], \
 - _u[8], _u[9], _u[10], _u[11], _u[12], _u[13], _u[14], _u[15]
  
  /**
   * struct mei_cl_device_id - MEI client device identifier
 diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
 index 5f20882..8a46c60 100644
 --- a/scripts/mod/file2alias.c
 +++ b/scripts/mod/file2alias.c
 @@ -137,10 +137,13 @@ static inline void add_wildcard(char *str)
  static inline void add_uuid(char *str, uuid_le uuid)
  {
   int len = strlen(str);
 - int i;
  
 - for (i = 0; i  16; i++)
 - sprintf(str + len + (i  1), %02x, uuid.b[i]);
 + sprintf(str + len,
 + 
 %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x,
 + uuid.b[3], uuid.b[2], uuid.b[1], uuid.b[0],
 + uuid.b[5], uuid.b[4], uuid.b[7], uuid.b[6],
 + uuid.b[8], uuid.b[9], uuid.b[10], uuid.b[11],
 + uuid.b[12], uuid.b[13], uuid.b[14], uuid.b[15]);
  }
  
  /**
 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mei, make modules.alias UUID information easier to read

2015-08-14 Thread Prarit Bhargava
2nd try on this ...

P.

---8<---

scripts/mod/file2alias.c:add_uuid() munges a UUID into a single string
which does not conform to the standard little endian UUID.  This patch
changes add_uuid() to use the UUID correctly so that future drivers which
use UUID matches can simply use the %pUL format, and modifies the mei
driver with those changes.

Cc: Tomas Winkler 
Cc: Greg Kroah-Hartman 
Cc: Joe Perches 
Cc: "David S. Miller" 
Cc: Jiri Kosina 
Cc: Sharon Dvir 
Cc: "Suthikulpanit, Suravee" 
Cc: Heikki Krogerus 
Cc: James Hogan 
Cc: Daniel Thompson 
Cc: Michael Opdenacker 
Cc: David Cohen 
Cc: Felipe Balbi 
Cc: Ralf Baechle 

Signed-off-by: Prarit Bhargava 
---
 drivers/misc/mei/bus.c  |6 ++
 include/linux/mod_devicetable.h |4 
 scripts/mod/file2alias.c|9 ++---
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 458aa5a..457e132 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -141,8 +141,7 @@ static ssize_t modalias_show(struct device *dev, struct 
device_attribute *a,
const uuid_le *uuid = mei_me_cl_uuid(device->me_cl);
size_t len;
 
-   len = snprintf(buf, PAGE_SIZE, "mei:%s:" MEI_CL_UUID_FMT ":",
-   device->name, MEI_CL_UUID_ARGS(uuid->b));
+   len = snprintf(buf, PAGE_SIZE, "mei:%s:%pUl:", device->name, uuid);
 
return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
 }
@@ -167,8 +166,7 @@ static int mei_cl_uevent(struct device *dev, struct 
kobj_uevent_env *env)
if (add_uevent_var(env, "MEI_CL_NAME=%s", device->name))
return -ENOMEM;
 
-   if (add_uevent_var(env, "MODALIAS=mei:%s:" MEI_CL_UUID_FMT ":",
-   device->name, MEI_CL_UUID_ARGS(uuid->b)))
+   if (add_uevent_var(env, "MODALIAS=mei:%s:%pUl:", device->name, uuid))
return -ENOMEM;
 
return 0;
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 34f25b7..becda6f 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -601,10 +601,6 @@ struct ipack_device_id {
 
 #define MEI_CL_MODULE_PREFIX "mei:"
 #define MEI_CL_NAME_SIZE 32
-#define MEI_CL_UUID_FMT 
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
-#define MEI_CL_UUID_ARGS(_u) \
-   _u[0], _u[1], _u[2], _u[3], _u[4], _u[5], _u[6], _u[7], \
-   _u[8], _u[9], _u[10], _u[11], _u[12], _u[13], _u[14], _u[15]
 
 /**
  * struct mei_cl_device_id - MEI client device identifier
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 5f20882..8a46c60 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -137,10 +137,13 @@ static inline void add_wildcard(char *str)
 static inline void add_uuid(char *str, uuid_le uuid)
 {
int len = strlen(str);
-   int i;
 
-   for (i = 0; i < 16; i++)
-   sprintf(str + len + (i << 1), "%02x", uuid.b[i]);
+   sprintf(str + len,
+   
"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+   uuid.b[3], uuid.b[2], uuid.b[1], uuid.b[0],
+   uuid.b[5], uuid.b[4], uuid.b[7], uuid.b[6],
+   uuid.b[8], uuid.b[9], uuid.b[10], uuid.b[11],
+   uuid.b[12], uuid.b[13], uuid.b[14], uuid.b[15]);
 }
 
 /**
-- 
1.7.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mei, make modules.alias UUID information easier to read

2015-08-14 Thread Prarit Bhargava
2nd try on this ...

P.

---8---

scripts/mod/file2alias.c:add_uuid() munges a UUID into a single string
which does not conform to the standard little endian UUID.  This patch
changes add_uuid() to use the UUID correctly so that future drivers which
use UUID matches can simply use the %pUL format, and modifies the mei
driver with those changes.

Cc: Tomas Winkler tomas.wink...@intel.com
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
Cc: Joe Perches j...@perches.com
Cc: David S. Miller da...@davemloft.net
Cc: Jiri Kosina jkos...@suse.cz
Cc: Sharon Dvir sharon.dv...@mail.huji.ac.il
Cc: Suthikulpanit, Suravee suravee.suthikulpa...@amd.com
Cc: Heikki Krogerus heikki.kroge...@linux.intel.com
Cc: James Hogan james.ho...@imgtec.com
Cc: Daniel Thompson daniel.thomp...@linaro.org
Cc: Michael Opdenacker michael.opdenac...@free-electrons.com
Cc: David Cohen david.a.co...@linux.intel.com
Cc: Felipe Balbi ba...@ti.com
Cc: Ralf Baechle r...@linux-mips.org

Signed-off-by: Prarit Bhargava pra...@redhat.com
---
 drivers/misc/mei/bus.c  |6 ++
 include/linux/mod_devicetable.h |4 
 scripts/mod/file2alias.c|9 ++---
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 458aa5a..457e132 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -141,8 +141,7 @@ static ssize_t modalias_show(struct device *dev, struct 
device_attribute *a,
const uuid_le *uuid = mei_me_cl_uuid(device-me_cl);
size_t len;
 
-   len = snprintf(buf, PAGE_SIZE, mei:%s: MEI_CL_UUID_FMT :,
-   device-name, MEI_CL_UUID_ARGS(uuid-b));
+   len = snprintf(buf, PAGE_SIZE, mei:%s:%pUl:, device-name, uuid);
 
return (len = PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
 }
@@ -167,8 +166,7 @@ static int mei_cl_uevent(struct device *dev, struct 
kobj_uevent_env *env)
if (add_uevent_var(env, MEI_CL_NAME=%s, device-name))
return -ENOMEM;
 
-   if (add_uevent_var(env, MODALIAS=mei:%s: MEI_CL_UUID_FMT :,
-   device-name, MEI_CL_UUID_ARGS(uuid-b)))
+   if (add_uevent_var(env, MODALIAS=mei:%s:%pUl:, device-name, uuid))
return -ENOMEM;
 
return 0;
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 34f25b7..becda6f 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -601,10 +601,6 @@ struct ipack_device_id {
 
 #define MEI_CL_MODULE_PREFIX mei:
 #define MEI_CL_NAME_SIZE 32
-#define MEI_CL_UUID_FMT 
%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
-#define MEI_CL_UUID_ARGS(_u) \
-   _u[0], _u[1], _u[2], _u[3], _u[4], _u[5], _u[6], _u[7], \
-   _u[8], _u[9], _u[10], _u[11], _u[12], _u[13], _u[14], _u[15]
 
 /**
  * struct mei_cl_device_id - MEI client device identifier
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 5f20882..8a46c60 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -137,10 +137,13 @@ static inline void add_wildcard(char *str)
 static inline void add_uuid(char *str, uuid_le uuid)
 {
int len = strlen(str);
-   int i;
 
-   for (i = 0; i  16; i++)
-   sprintf(str + len + (i  1), %02x, uuid.b[i]);
+   sprintf(str + len,
+   
%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x,
+   uuid.b[3], uuid.b[2], uuid.b[1], uuid.b[0],
+   uuid.b[5], uuid.b[4], uuid.b[7], uuid.b[6],
+   uuid.b[8], uuid.b[9], uuid.b[10], uuid.b[11],
+   uuid.b[12], uuid.b[13], uuid.b[14], uuid.b[15]);
 }
 
 /**
-- 
1.7.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mei, make modules.alias UUID information easier to read

2015-08-07 Thread Prarit Bhargava
scripts/mod/file2alias.c:add_uuid() munges a UUID into a single string
which does not conform to the standard little endian UUID.  This patch
changes add_uuid() to use the UUID correctly so that future drivers which
use UUID matches can simply use the %pUL format, and modifies the mei
driver with those changes.

Cc: Tomas Winkler 
Cc: Greg Kroah-Hartman 
Signed-off-by: Prarit Bhargava 
---
 drivers/misc/mei/bus.c  |6 ++
 include/linux/mod_devicetable.h |4 
 scripts/mod/file2alias.c|9 ++---
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 458aa5a..457e132 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -141,8 +141,7 @@ static ssize_t modalias_show(struct device *dev, struct 
device_attribute *a,
const uuid_le *uuid = mei_me_cl_uuid(device->me_cl);
size_t len;
 
-   len = snprintf(buf, PAGE_SIZE, "mei:%s:" MEI_CL_UUID_FMT ":",
-   device->name, MEI_CL_UUID_ARGS(uuid->b));
+   len = snprintf(buf, PAGE_SIZE, "mei:%s:%pUl:", device->name, uuid);
 
return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
 }
@@ -167,8 +166,7 @@ static int mei_cl_uevent(struct device *dev, struct 
kobj_uevent_env *env)
if (add_uevent_var(env, "MEI_CL_NAME=%s", device->name))
return -ENOMEM;
 
-   if (add_uevent_var(env, "MODALIAS=mei:%s:" MEI_CL_UUID_FMT ":",
-   device->name, MEI_CL_UUID_ARGS(uuid->b)))
+   if (add_uevent_var(env, "MODALIAS=mei:%s:%pUl:", device->name, uuid))
return -ENOMEM;
 
return 0;
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 34f25b7..becda6f 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -601,10 +601,6 @@ struct ipack_device_id {
 
 #define MEI_CL_MODULE_PREFIX "mei:"
 #define MEI_CL_NAME_SIZE 32
-#define MEI_CL_UUID_FMT 
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x"
-#define MEI_CL_UUID_ARGS(_u) \
-   _u[0], _u[1], _u[2], _u[3], _u[4], _u[5], _u[6], _u[7], \
-   _u[8], _u[9], _u[10], _u[11], _u[12], _u[13], _u[14], _u[15]
 
 /**
  * struct mei_cl_device_id - MEI client device identifier
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 5f20882..8a46c60 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -137,10 +137,13 @@ static inline void add_wildcard(char *str)
 static inline void add_uuid(char *str, uuid_le uuid)
 {
int len = strlen(str);
-   int i;
 
-   for (i = 0; i < 16; i++)
-   sprintf(str + len + (i << 1), "%02x", uuid.b[i]);
+   sprintf(str + len,
+   
"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+   uuid.b[3], uuid.b[2], uuid.b[1], uuid.b[0],
+   uuid.b[5], uuid.b[4], uuid.b[7], uuid.b[6],
+   uuid.b[8], uuid.b[9], uuid.b[10], uuid.b[11],
+   uuid.b[12], uuid.b[13], uuid.b[14], uuid.b[15]);
 }
 
 /**
-- 
1.7.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mei, make modules.alias UUID information easier to read

2015-08-07 Thread Prarit Bhargava
scripts/mod/file2alias.c:add_uuid() munges a UUID into a single string
which does not conform to the standard little endian UUID.  This patch
changes add_uuid() to use the UUID correctly so that future drivers which
use UUID matches can simply use the %pUL format, and modifies the mei
driver with those changes.

Cc: Tomas Winkler tomas.wink...@intel.com
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
Signed-off-by: Prarit Bhargava pra...@redhat.com
---
 drivers/misc/mei/bus.c  |6 ++
 include/linux/mod_devicetable.h |4 
 scripts/mod/file2alias.c|9 ++---
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 458aa5a..457e132 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -141,8 +141,7 @@ static ssize_t modalias_show(struct device *dev, struct 
device_attribute *a,
const uuid_le *uuid = mei_me_cl_uuid(device-me_cl);
size_t len;
 
-   len = snprintf(buf, PAGE_SIZE, mei:%s: MEI_CL_UUID_FMT :,
-   device-name, MEI_CL_UUID_ARGS(uuid-b));
+   len = snprintf(buf, PAGE_SIZE, mei:%s:%pUl:, device-name, uuid);
 
return (len = PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
 }
@@ -167,8 +166,7 @@ static int mei_cl_uevent(struct device *dev, struct 
kobj_uevent_env *env)
if (add_uevent_var(env, MEI_CL_NAME=%s, device-name))
return -ENOMEM;
 
-   if (add_uevent_var(env, MODALIAS=mei:%s: MEI_CL_UUID_FMT :,
-   device-name, MEI_CL_UUID_ARGS(uuid-b)))
+   if (add_uevent_var(env, MODALIAS=mei:%s:%pUl:, device-name, uuid))
return -ENOMEM;
 
return 0;
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 34f25b7..becda6f 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -601,10 +601,6 @@ struct ipack_device_id {
 
 #define MEI_CL_MODULE_PREFIX mei:
 #define MEI_CL_NAME_SIZE 32
-#define MEI_CL_UUID_FMT 
%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x
-#define MEI_CL_UUID_ARGS(_u) \
-   _u[0], _u[1], _u[2], _u[3], _u[4], _u[5], _u[6], _u[7], \
-   _u[8], _u[9], _u[10], _u[11], _u[12], _u[13], _u[14], _u[15]
 
 /**
  * struct mei_cl_device_id - MEI client device identifier
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 5f20882..8a46c60 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -137,10 +137,13 @@ static inline void add_wildcard(char *str)
 static inline void add_uuid(char *str, uuid_le uuid)
 {
int len = strlen(str);
-   int i;
 
-   for (i = 0; i  16; i++)
-   sprintf(str + len + (i  1), %02x, uuid.b[i]);
+   sprintf(str + len,
+   
%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x,
+   uuid.b[3], uuid.b[2], uuid.b[1], uuid.b[0],
+   uuid.b[5], uuid.b[4], uuid.b[7], uuid.b[6],
+   uuid.b[8], uuid.b[9], uuid.b[10], uuid.b[11],
+   uuid.b[12], uuid.b[13], uuid.b[14], uuid.b[15]);
 }
 
 /**
-- 
1.7.9.3

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/