Commit 5d4eeb8a authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'uuid-for-4.13-2' of git://git.infradead.org/users/hch/uuid

Pull uuid fixes from Christoph Hellwig:

 - add a missing "!" in the uuid tests

 - remove the last remaining user of the uuid_be type, and then the type
   and its helpers

* tag 'uuid-for-4.13-2' of git://git.infradead.org/users/hch/uuid:
  uuid: remove uuid_be
  thunderbolt: use uuid_t instead of uuid_be
  uuid: fix incorrect uuid_equal conversion in test_uuid_test
parents cef55b51 832e4c83
......@@ -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;
}
......@@ -1461,7 +1461,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)
......@@ -1518,7 +1518,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;
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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
......@@ -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);
}
......
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