Skip to content

Commit 5d4eeb8

Browse files
committed
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
2 parents cef55b5 + 832e4c8 commit 5d4eeb8

File tree

5 files changed

+13
-27
lines changed

5 files changed

+13
-27
lines changed

drivers/thunderbolt/switch.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static DEFINE_IDA(nvm_ida);
3030

3131
struct nvm_auth_status {
3232
struct list_head list;
33-
uuid_be uuid;
33+
uuid_t uuid;
3434
u32 status;
3535
};
3636

@@ -47,7 +47,7 @@ static struct nvm_auth_status *__nvm_get_auth_status(const struct tb_switch *sw)
4747
struct nvm_auth_status *st;
4848

4949
list_for_each_entry(st, &nvm_auth_status_cache, list) {
50-
if (!uuid_be_cmp(st->uuid, *sw->uuid))
50+
if (uuid_equal(&st->uuid, sw->uuid))
5151
return st;
5252
}
5353

@@ -1461,7 +1461,7 @@ struct tb_sw_lookup {
14611461
struct tb *tb;
14621462
u8 link;
14631463
u8 depth;
1464-
const uuid_be *uuid;
1464+
const uuid_t *uuid;
14651465
};
14661466

14671467
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)
15181518
* Returned switch has reference count increased so the caller needs to
15191519
* call tb_switch_put() when done with the switch.
15201520
*/
1521-
struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_be *uuid)
1521+
struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid)
15221522
{
15231523
struct tb_sw_lookup lookup;
15241524
struct device *dev;

drivers/thunderbolt/tb.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ struct tb_switch {
101101
struct tb_dma_port *dma_port;
102102
struct tb *tb;
103103
u64 uid;
104-
uuid_be *uuid;
104+
uuid_t *uuid;
105105
u16 vendor;
106106
u16 device;
107107
const char *vendor_name;
@@ -407,7 +407,7 @@ void tb_sw_set_unplugged(struct tb_switch *sw);
407407
struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route);
408408
struct tb_switch *tb_switch_find_by_link_depth(struct tb *tb, u8 link,
409409
u8 depth);
410-
struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_be *uuid);
410+
struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid);
411411

412412
static inline unsigned int tb_switch_phy_port_from_link(unsigned int link)
413413
{

drivers/thunderbolt/tb_msgs.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ struct icm_fr_pkg_get_topology_response {
179179

180180
struct icm_fr_event_device_connected {
181181
struct icm_pkg_header hdr;
182-
uuid_be ep_uuid;
182+
uuid_t ep_uuid;
183183
u8 connection_key;
184184
u8 connection_id;
185185
u16 link_info;
@@ -193,7 +193,7 @@ struct icm_fr_event_device_connected {
193193

194194
struct icm_fr_pkg_approve_device {
195195
struct icm_pkg_header hdr;
196-
uuid_be ep_uuid;
196+
uuid_t ep_uuid;
197197
u8 connection_key;
198198
u8 connection_id;
199199
u16 reserved;
@@ -207,7 +207,7 @@ struct icm_fr_event_device_disconnected {
207207

208208
struct icm_fr_pkg_add_device_key {
209209
struct icm_pkg_header hdr;
210-
uuid_be ep_uuid;
210+
uuid_t ep_uuid;
211211
u8 connection_key;
212212
u8 connection_id;
213213
u16 reserved;
@@ -216,15 +216,15 @@ struct icm_fr_pkg_add_device_key {
216216

217217
struct icm_fr_pkg_add_device_key_response {
218218
struct icm_pkg_header hdr;
219-
uuid_be ep_uuid;
219+
uuid_t ep_uuid;
220220
u8 connection_key;
221221
u8 connection_id;
222222
u16 reserved;
223223
} __packed;
224224

225225
struct icm_fr_pkg_challenge_device {
226226
struct icm_pkg_header hdr;
227-
uuid_be ep_uuid;
227+
uuid_t ep_uuid;
228228
u8 connection_key;
229229
u8 connection_id;
230230
u16 reserved;
@@ -233,7 +233,7 @@ struct icm_fr_pkg_challenge_device {
233233

234234
struct icm_fr_pkg_challenge_device_response {
235235
struct icm_pkg_header hdr;
236-
uuid_be ep_uuid;
236+
uuid_t ep_uuid;
237237
u8 connection_key;
238238
u8 connection_id;
239239
u16 reserved;

include/linux/uuid.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,26 +84,12 @@ int guid_parse(const char *uuid, guid_t *u);
8484
int uuid_parse(const char *uuid, uuid_t *u);
8585

8686
/* backwards compatibility, don't use in new code */
87-
typedef uuid_t uuid_be;
88-
#define UUID_BE(a, _b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
89-
UUID_INIT(a, _b, c, d0, d1, d2, d3, d4, d5, d6, d7)
90-
#define NULL_UUID_BE \
91-
UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
92-
0x00, 0x00, 0x00, 0x00)
93-
9487
#define uuid_le_gen(u) guid_gen(u)
95-
#define uuid_be_gen(u) uuid_gen(u)
9688
#define uuid_le_to_bin(guid, u) guid_parse(guid, u)
97-
#define uuid_be_to_bin(uuid, u) uuid_parse(uuid, u)
9889

9990
static inline int uuid_le_cmp(const guid_t u1, const guid_t u2)
10091
{
10192
return memcmp(&u1, &u2, sizeof(guid_t));
10293
}
10394

104-
static inline int uuid_be_cmp(const uuid_t u1, const uuid_t u2)
105-
{
106-
return memcmp(&u1, &u2, sizeof(uuid_t));
107-
}
108-
10995
#endif

lib/test_uuid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static void __init test_uuid_test(const struct test_uuid_data *data)
8282
test_uuid_failed("conversion", false, true, data->uuid, NULL);
8383

8484
total_tests++;
85-
if (uuid_equal(&data->be, &be)) {
85+
if (!uuid_equal(&data->be, &be)) {
8686
sprintf(buf, "%pUb", &be);
8787
test_uuid_failed("cmp", false, true, data->uuid, buf);
8888
}

0 commit comments

Comments
 (0)