Skip to contentSkip to conversation

mei: Move uuid_le_cmp() to its only user

PATCH In review Andy Shevchenko 2 participants 5 messages Feb 2, 2023

Subsystems (3)
lore
Share & tools
lore

Andy Shevchenko

author reviewer
#0 lore raw

PATCH 1/1 mei: Move uuid_le_cmp() to its only user

There is only a single user of uuid_le_cmp() API, let's make it private to that user.

---
 drivers/misc/mei/mei_dev.h | 5 +++++
 include/linux/uuid.h       | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/misc/mei/mei_dev.h +5 -0
index 996b70a988be..895011b7a0bf 100644
@@ -13,6 +13,11 @@
 #include <linux/mei.h>
 #include <linux/mei_cl_bus.h>
 
+static inline int uuid_le_cmp(const uuid_le u1, const uuid_le u2)
+{
+	return memcmp(&u1, &u2, sizeof(uuid_le));
+}
+
 #include "hw.h"
 #include "hbm.h"
 
include/linux/uuid.h +0 -5
index 5be158a49e11..6b1a3efa1e0b 100644
@@ -110,9 +110,4 @@ int uuid_parse(const char *uuid, uuid_t *u);
 /* MEI UUID type, don't use anywhere else */
 #include <uapi/linux/uuid.h>
 
-static inline int uuid_le_cmp(const uuid_le u1, const uuid_le u2)
-{
-	return memcmp(&u1, &u2, sizeof(uuid_le));
-}
-
 #endif
Signature · 1 line
2.39.1
#1 lore raw
Quoted 2 lines · Andy Shevchenko

There is only a single user of uuid_le_cmp() API, let's make it private to that user.

Any reason this code can't just use guid_t and guid_equal?

author reviewer
#2 lore raw
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Andy Shevchenko

There is only a single user of uuid_le_cmp() API, let's make it private to that user.

Any reason this code can't just use guid_t and guid_equal?

It's part of ABI, while guid_* are for the internal use.

Eventually they may switch to the internal types, but it's up to MEI.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 10 lines · Andy Shevchenko
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Andy Shevchenko

There is only a single user of uuid_le_cmp() API, let's make it private to that user.

Any reason this code can't just use guid_t and guid_equal?

It's part of ABI, while guid_* are for the internal use.

Eventually they may switch to the internal types, but it's up to MEI.

How can a type name be part of a binary interface?

author reviewer
#4 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · Andy Shevchenko
Quoted 4 lines · Christoph Hellwig
Quoted 2 lines · Andy Shevchenko

There is only a single user of uuid_le_cmp() API, let's make it private to that user.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Any reason this code can't just use guid_t and guid_equal?

It's part of ABI, while guid_* are for the internal use.

Eventually they may switch to the internal types, but it's up to MEI.

How can a type name be part of a binary interface?

If I'm not mistaken there is a difference between simple __u8[16] and struct { __u8[16] } due to alignment. But data wise it's the same, of course. That said, it depends on how this type is being used in the any of ABI.

From the API perspective the guid_* are not visible to uAPI.

Signature · 2 lines
With Best Regards,
Andy Shevchenko