Commit 59796edc authored by Prarit Bhargava's avatar Prarit Bhargava Committed by Greg Kroah-Hartman

mei: make modules.alias UUID information easier to read

scripts/mod/file2alias.c:add_uuid()  convert UUID into a single string
which does not conform to the standard little endian UUID formatting.
This patch changes add_uuid() to output same format as %pUL and modifies
the mei driver to match the change.
Signed-off-by: default avatarPrarit Bhargava <prarit@redhat.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6c56026b
...@@ -597,9 +597,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *a, ...@@ -597,9 +597,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *a,
const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl); const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);
size_t len; size_t len;
len = snprintf(buf, PAGE_SIZE, "mei:%s:" MEI_CL_UUID_FMT ":", len = snprintf(buf, PAGE_SIZE, "mei:%s:%pUl:", cldev->name, uuid);
cldev->name, MEI_CL_UUID_ARGS(uuid->b));
return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len; return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
} }
static DEVICE_ATTR_RO(modalias); static DEVICE_ATTR_RO(modalias);
...@@ -631,8 +629,7 @@ static int mei_cl_device_uevent(struct device *dev, struct kobj_uevent_env *env) ...@@ -631,8 +629,7 @@ static int mei_cl_device_uevent(struct device *dev, struct kobj_uevent_env *env)
if (add_uevent_var(env, "MEI_CL_NAME=%s", cldev->name)) if (add_uevent_var(env, "MEI_CL_NAME=%s", cldev->name))
return -ENOMEM; return -ENOMEM;
if (add_uevent_var(env, "MODALIAS=mei:%s:" MEI_CL_UUID_FMT ":", if (add_uevent_var(env, "MODALIAS=mei:%s:%pUl:", cldev->name, uuid))
cldev->name, MEI_CL_UUID_ARGS(uuid->b)))
return -ENOMEM; return -ENOMEM;
return 0; return 0;
......
...@@ -601,10 +601,6 @@ struct ipack_device_id { ...@@ -601,10 +601,6 @@ struct ipack_device_id {
#define MEI_CL_MODULE_PREFIX "mei:" #define MEI_CL_MODULE_PREFIX "mei:"
#define MEI_CL_NAME_SIZE 32 #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 * struct mei_cl_device_id - MEI client device identifier
......
...@@ -137,10 +137,12 @@ static inline void add_wildcard(char *str) ...@@ -137,10 +137,12 @@ static inline void add_wildcard(char *str)
static inline void add_uuid(char *str, uuid_le uuid) static inline void add_uuid(char *str, uuid_le uuid)
{ {
int len = strlen(str); int len = strlen(str);
int i;
for (i = 0; i < 16; i++) sprintf(str + len, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
sprintf(str + len + (i << 1), "%02x", uuid.b[i]); 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]);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment