All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] mei: Move uuid_le_cmp() to its only user
@ 2023-02-02 14:54 Andy Shevchenko
  2023-02-02 15:17 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2023-02-02 14:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Daniele Ceraolo Spurio, Alexander Usyskin,
	Andy Shevchenko, linux-kernel
  Cc: Tomas Winkler, Arnd Bergmann, Christoph Hellwig

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/misc/mei/mei_dev.h | 5 +++++
 include/linux/uuid.h       | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index 996b70a988be..895011b7a0bf 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -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"
 
diff --git a/include/linux/uuid.h b/include/linux/uuid.h
index 5be158a49e11..6b1a3efa1e0b 100644
--- a/include/linux/uuid.h
+++ b/include/linux/uuid.h
@@ -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
-- 
2.39.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] mei: Move uuid_le_cmp() to its only user
  2023-02-02 14:54 [PATCH v1 1/1] mei: Move uuid_le_cmp() to its only user Andy Shevchenko
@ 2023-02-02 15:17 ` Christoph Hellwig
  2023-02-02 15:21   ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2023-02-02 15:17 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Greg Kroah-Hartman, Daniele Ceraolo Spurio, Alexander Usyskin,
	linux-kernel, Tomas Winkler, Arnd Bergmann, Christoph Hellwig

On Thu, Feb 02, 2023 at 04:54:12PM +0200, Andy Shevchenko wrote:
> 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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] mei: Move uuid_le_cmp() to its only user
  2023-02-02 15:17 ` Christoph Hellwig
@ 2023-02-02 15:21   ` Andy Shevchenko
  2023-02-02 15:22     ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2023-02-02 15:21 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Greg Kroah-Hartman, Daniele Ceraolo Spurio, Alexander Usyskin,
	linux-kernel, Tomas Winkler, Arnd Bergmann

On Thu, Feb 02, 2023 at 04:17:59PM +0100, Christoph Hellwig wrote:
> On Thu, Feb 02, 2023 at 04:54:12PM +0200, Andy Shevchenko wrote:
> > 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.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] mei: Move uuid_le_cmp() to its only user
  2023-02-02 15:21   ` Andy Shevchenko
@ 2023-02-02 15:22     ` Christoph Hellwig
  2023-02-02 15:31       ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2023-02-02 15:22 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Christoph Hellwig, Greg Kroah-Hartman, Daniele Ceraolo Spurio,
	Alexander Usyskin, linux-kernel, Tomas Winkler, Arnd Bergmann

On Thu, Feb 02, 2023 at 05:21:52PM +0200, Andy Shevchenko wrote:
> On Thu, Feb 02, 2023 at 04:17:59PM +0100, Christoph Hellwig wrote:
> > On Thu, Feb 02, 2023 at 04:54:12PM +0200, Andy Shevchenko wrote:
> > > 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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/1] mei: Move uuid_le_cmp() to its only user
  2023-02-02 15:22     ` Christoph Hellwig
@ 2023-02-02 15:31       ` Andy Shevchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2023-02-02 15:31 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Greg Kroah-Hartman, Daniele Ceraolo Spurio, Alexander Usyskin,
	linux-kernel, Tomas Winkler, Arnd Bergmann

On Thu, Feb 02, 2023 at 04:22:34PM +0100, Christoph Hellwig wrote:
> On Thu, Feb 02, 2023 at 05:21:52PM +0200, Andy Shevchenko wrote:
> > On Thu, Feb 02, 2023 at 04:17:59PM +0100, Christoph Hellwig wrote:
> > > On Thu, Feb 02, 2023 at 04:54:12PM +0200, Andy Shevchenko wrote:
> > > > 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?

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.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-02 15:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02 14:54 [PATCH v1 1/1] mei: Move uuid_le_cmp() to its only user Andy Shevchenko
2023-02-02 15:17 ` Christoph Hellwig
2023-02-02 15:21   ` Andy Shevchenko
2023-02-02 15:22     ` Christoph Hellwig
2023-02-02 15:31       ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.