Skip to contentSkip to conversation

uuid updates for 4.13-rc

PATCH In review Christoph Hellwig 4 participants 9 messages Jul 20, 2017 – Jul 24, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

this series removes fixes a bug in the previous uuid pull request and removes the the uuid_be type. I had planned to send the last patch for -rc1 already but held off to avoid merge conflicts in linux-next.

In the meantime the thunderbolt code added a few new instances, so patch once removes them. I'd like to get this small series into 4.13-rc so that 4.13 is released without the uuid_be type.

#1 lore raw

PATCH 1/3 uuid: fix incorrect uuid_equal conversion in test_uuid_test

Fixes df33767d ("uuid: hoist helpers uuid_equal() and uuid_copy() from xfs")
---
 lib/test_uuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/test_uuid.c +1 -1
index 478c049630b5..cd819c397dc7 100644
@@ -82,7 +82,7 @@ static void __init test_uuid_test(const struct test_uuid_data *data)
 		test_uuid_failed("conversion", false, true, data->uuid, NULL);
 
 	total_tests++;
-	if (uuid_equal(&data->be, &be)) {
+	if (!uuid_equal(&data->be, &be)) {
 		sprintf(buf, "%pUb", &be);
 		test_uuid_failed("cmp", false, true, data->uuid, buf);
 	}
Signature · 1 line
2.11.0
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] uuid: fix incorrect uuid_equal conversion in test_uuid_test

Quoted 3 lines · Christoph Hellwig
Fixes df33767d ("uuid: hoist helpers uuid_equal() and uuid_copy() from xfs")

Oops

Quoted 20 lines
---
 lib/test_uuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/test_uuid.c +1 -2
index 478c049630b5..cd819c397dc7 100644
@@ -82,7 +82,7 @@ static void __init test_uuid_test(const struct test_uuid_data *data)
                test_uuid_failed("conversion", false, true, data->uuid, NULL);
 
        total_tests++;
-       if (uuid_equal(&data->be, &be)) {
+       if (!uuid_equal(&data->be, &be)) {
                sprintf(buf, "%pUb", &be);
                test_uuid_failed("cmp", false, true, data->uuid, buf);
        }
--

2.11.0

#3 lore raw

PATCH 2/3 thunderbold: use uuid_t instead of uuid_be

In reply to Christoph Hellwig

Switch thunderbolt to the new uuid type.

---
 drivers/thunderbolt/switch.c  |  8 ++++----
 drivers/thunderbolt/tb.h      |  4 ++--
 drivers/thunderbolt/tb_msgs.h | 12 ++++++------
 3 files changed, 12 insertions(+), 12 deletions(-)
drivers/thunderbolt/switch.c +4 -4
index ab3e8f410444..c6f41b7d38b0 100644
@@ -30,7 +30,7 @@ static DEFINE_IDA(nvm_ida);
 
 struct nvm_auth_status {
 	struct list_head list;
-	uuid_be uuid;
+	uuid_t uuid;
 	u32 status;
 };
 
@@ -47,7 +47,7 @@ static struct nvm_auth_status *__nvm_get_auth_status(const struct tb_switch *sw)
 	struct nvm_auth_status *st;
 
 	list_for_each_entry(st, &nvm_auth_status_cache, list) {
-		if (!uuid_be_cmp(st->uuid, *sw->uuid))
+		if (uuid_equal(&st->uuid, sw->uuid))
 			return st;
 	}
 
@@ -1460,7 +1460,7 @@ struct tb_sw_lookup {
 	struct tb *tb;
 	u8 link;
 	u8 depth;
-	const uuid_be *uuid;
+	const uuid_t *uuid;
 };
 
 static int tb_switch_match(struct device *dev, void *data)
@@ -1517,7 +1517,7 @@ struct tb_switch *tb_switch_find_by_link_depth(struct tb *tb, u8 link, u8 depth)
  * Returned switch has reference count increased so the caller needs to
  * call tb_switch_put() when done with the switch.
  */
-struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_be *uuid)
+struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid)
 {
 	struct tb_sw_lookup lookup;
 	struct device *dev;
drivers/thunderbolt/tb.h +2 -2
index 3d9f64676e58..e0deee4f1eb0 100644
@@ -101,7 +101,7 @@ struct tb_switch {
 	struct tb_dma_port *dma_port;
 	struct tb *tb;
 	u64 uid;
-	uuid_be *uuid;
+	uuid_t *uuid;
 	u16 vendor;
 	u16 device;
 	const char *vendor_name;
@@ -407,7 +407,7 @@ void tb_sw_set_unplugged(struct tb_switch *sw);
 struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route);
 struct tb_switch *tb_switch_find_by_link_depth(struct tb *tb, u8 link,
 					       u8 depth);
-struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_be *uuid);
+struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid);
 
 static inline unsigned int tb_switch_phy_port_from_link(unsigned int link)
 {
drivers/thunderbolt/tb_msgs.h +6 -6
index 85b6d33c0919..de6441e4a060 100644
@@ -179,7 +179,7 @@ struct icm_fr_pkg_get_topology_response {
 
 struct icm_fr_event_device_connected {
 	struct icm_pkg_header hdr;
-	uuid_be ep_uuid;
+	uuid_t ep_uuid;
 	u8 connection_key;
 	u8 connection_id;
 	u16 link_info;
@@ -193,7 +193,7 @@ struct icm_fr_event_device_connected {
 
 struct icm_fr_pkg_approve_device {
 	struct icm_pkg_header hdr;
-	uuid_be ep_uuid;
+	uuid_t ep_uuid;
 	u8 connection_key;
 	u8 connection_id;
 	u16 reserved;
@@ -207,7 +207,7 @@ struct icm_fr_event_device_disconnected {
 
 struct icm_fr_pkg_add_device_key {
 	struct icm_pkg_header hdr;
-	uuid_be ep_uuid;
+	uuid_t ep_uuid;
 	u8 connection_key;
 	u8 connection_id;
 	u16 reserved;
@@ -216,7 +216,7 @@ struct icm_fr_pkg_add_device_key {
 
 struct icm_fr_pkg_add_device_key_response {
 	struct icm_pkg_header hdr;
-	uuid_be ep_uuid;
+	uuid_t ep_uuid;
 	u8 connection_key;
 	u8 connection_id;
 	u16 reserved;
@@ -224,7 +224,7 @@ struct icm_fr_pkg_add_device_key_response {
 
 struct icm_fr_pkg_challenge_device {
 	struct icm_pkg_header hdr;
-	uuid_be ep_uuid;
+	uuid_t ep_uuid;
 	u8 connection_key;
 	u8 connection_id;
 	u16 reserved;
@@ -233,7 +233,7 @@ struct icm_fr_pkg_challenge_device {
 
 struct icm_fr_pkg_challenge_device_response {
 	struct icm_pkg_header hdr;
-	uuid_be ep_uuid;
+	uuid_t ep_uuid;
 	u8 connection_key;
 	u8 connection_id;
 	u16 reserved;
Signature · 1 line
2.11.0
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] thunderbold: use uuid_t instead of uuid_be

Quoted 3 lines · Christoph Hellwig

Switch thunderbolt to the new uuid type.

Quoted 129 lines
---
 drivers/thunderbolt/switch.c  |  8 ++++----
 drivers/thunderbolt/tb.h      |  4 ++--
 drivers/thunderbolt/tb_msgs.h | 12 ++++++------
 3 files changed, 12 insertions(+), 12 deletions(-)
drivers/thunderbolt/switch.c +4 -4
index ab3e8f410444..c6f41b7d38b0 100644
@@ -30,7 +30,7 @@ static DEFINE_IDA(nvm_ida);
 
 struct nvm_auth_status {
        struct list_head list;
-       uuid_be uuid;
+       uuid_t uuid;
        u32 status;
 };
 
@@ -47,7 +47,7 @@ static struct nvm_auth_status *__nvm_get_auth_status(const struct tb_switch *sw)
        struct nvm_auth_status *st;
 
        list_for_each_entry(st, &nvm_auth_status_cache, list) {
-               if (!uuid_be_cmp(st->uuid, *sw->uuid))
+               if (uuid_equal(&st->uuid, sw->uuid))
                        return st;
        }
 
@@ -1460,7 +1460,7 @@ struct tb_sw_lookup {
        struct tb *tb;
        u8 link;
        u8 depth;
-       const uuid_be *uuid;
+       const uuid_t *uuid;
 };
 
 static int tb_switch_match(struct device *dev, void *data)
@@ -1517,7 +1517,7 @@ struct tb_switch *tb_switch_find_by_link_depth(struct tb *tb, u8 link, u8 depth)
  * Returned switch has reference count increased so the caller needs to
  * call tb_switch_put() when done with the switch.
  */
-struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_be *uuid)
+struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid)
 {
        struct tb_sw_lookup lookup;
        struct device *dev;
drivers/thunderbolt/tb.h +2 -2
index 3d9f64676e58..e0deee4f1eb0 100644
@@ -101,7 +101,7 @@ struct tb_switch {
        struct tb_dma_port *dma_port;
        struct tb *tb;
        u64 uid;
-       uuid_be *uuid;
+       uuid_t *uuid;
        u16 vendor;
        u16 device;
        const char *vendor_name;
@@ -407,7 +407,7 @@ void tb_sw_set_unplugged(struct tb_switch *sw);
 struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route);
 struct tb_switch *tb_switch_find_by_link_depth(struct tb *tb, u8 link,
                                               u8 depth);
-struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_be *uuid);
+struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid);
 
 static inline unsigned int tb_switch_phy_port_from_link(unsigned int link)
 {
drivers/thunderbolt/tb_msgs.h +6 -7
index 85b6d33c0919..de6441e4a060 100644
@@ -179,7 +179,7 @@ struct icm_fr_pkg_get_topology_response {
 
 struct icm_fr_event_device_connected {
        struct icm_pkg_header hdr;
-       uuid_be ep_uuid;
+       uuid_t ep_uuid;
        u8 connection_key;
        u8 connection_id;
        u16 link_info;
@@ -193,7 +193,7 @@ struct icm_fr_event_device_connected {
 
 struct icm_fr_pkg_approve_device {
        struct icm_pkg_header hdr;
-       uuid_be ep_uuid;
+       uuid_t ep_uuid;
        u8 connection_key;
        u8 connection_id;
        u16 reserved;
@@ -207,7 +207,7 @@ struct icm_fr_event_device_disconnected {
 
 struct icm_fr_pkg_add_device_key {
        struct icm_pkg_header hdr;
-       uuid_be ep_uuid;
+       uuid_t ep_uuid;
        u8 connection_key;
        u8 connection_id;
        u16 reserved;
@@ -216,7 +216,7 @@ struct icm_fr_pkg_add_device_key {
 
 struct icm_fr_pkg_add_device_key_response {
        struct icm_pkg_header hdr;
-       uuid_be ep_uuid;
+       uuid_t ep_uuid;
        u8 connection_key;
        u8 connection_id;
        u16 reserved;
@@ -224,7 +224,7 @@ struct icm_fr_pkg_add_device_key_response {
 
 struct icm_fr_pkg_challenge_device {
        struct icm_pkg_header hdr;
-       uuid_be ep_uuid;
+       uuid_t ep_uuid;
        u8 connection_key;
        u8 connection_id;
        u16 reserved;
@@ -233,7 +233,7 @@ struct icm_fr_pkg_challenge_device {
 
 struct icm_fr_pkg_challenge_device_response {
        struct icm_pkg_header hdr;
-       uuid_be ep_uuid;
+       uuid_t ep_uuid;
        u8 connection_key;
        u8 connection_id;
        u16 reserved;
--

2.11.0

#6 lore raw

Re: [PATCH 2/3] thunderbold: use uuid_t instead of uuid_be

Quoted 8 lines · Mika Westerberg
Quoted 3 lines · Christoph Hellwig

Switch thunderbolt to the new uuid type.

You have a typo in $subject: thunderbold -> thunderbolt.

Otherwise looks good and still works fine :)

Thanks, fixed.

#7 lore raw

PATCH 3/3 uuid: remove uuid_be

In reply to Christoph Hellwig

Everything uses uuid_t now.

---
 include/linux/uuid.h | 14 --------------
 1 file changed, 14 deletions(-)
include/linux/uuid.h +0 -14
index 2251e1925ea4..33b0bdbb613c 100644
@@ -84,26 +84,12 @@ int guid_parse(const char *uuid, guid_t *u);
 int uuid_parse(const char *uuid, uuid_t *u);
 
 /* backwards compatibility, don't use in new code */
-typedef uuid_t uuid_be;
-#define UUID_BE(a, _b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
-	UUID_INIT(a, _b, c, d0, d1, d2, d3, d4, d5, d6, d7)
-#define NULL_UUID_BE 							\
-	UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00,	\
-	     0x00, 0x00, 0x00, 0x00)
-
 #define uuid_le_gen(u)		guid_gen(u)
-#define uuid_be_gen(u)		uuid_gen(u)
 #define uuid_le_to_bin(guid, u)	guid_parse(guid, u)
-#define uuid_be_to_bin(uuid, u)	uuid_parse(uuid, u)
 
 static inline int uuid_le_cmp(const guid_t u1, const guid_t u2)
 {
 	return memcmp(&u1, &u2, sizeof(guid_t));
 }
 
-static inline int uuid_be_cmp(const uuid_t u1, const uuid_t u2)
-{
-	return memcmp(&u1, &u2, sizeof(uuid_t));
-}
-
 #endif
Signature · 1 line
2.11.0
reviewer Reviewed-by
#8 lore raw
In reply to Christoph Hellwig
Quoted 10 lines · Christoph Hellwig

Hi all,

this series removes fixes a bug in the previous uuid pull request and removes the the uuid_be type.  I had planned to send the last patch for -rc1 already but held off to avoid merge conflicts in linux-next.

In the meantime the thunderbolt code added a few new instances, so patch once removes them.  I'd like to get this small series into 4.13-rc so that 4.13 is released without the uuid_be type.

All patches in this series looks reasonable to me (1 is obvious bug fix, 2 is what we discussed with Mika, 3 obvious outcome).

I have sent uuid_le clean up, it looks I need to rebase it on top of this series. Though I'm still waiting for comments, tags there...

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy