linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/8] lib/uuid: Introduce uuid_{be|le}_cmp_p{p}() helpers
@ 2017-04-21 14:46 Andy Shevchenko
  2017-04-21 14:46 ` [PATCH v1 2/8] ASoC: Intel: Skylake: Use recently introduced uuid_le_cmp_p{p}() Andy Shevchenko
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: Andy Shevchenko @ 2017-04-21 14:46 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel, Arnd Bergmann, Mika Westerberg,
	alsa-devel, linux-input, kvm, devel, linux-efi, linux-acpi
  Cc: Andy Shevchenko, Liam Girdwood, Mark Brown, Vinod Koul,
	Srinivas Pandruvada, Benjamin Tissoires, Kirti Wankhede,
	Alex Williamson, K. Y. Srinivasan, Haiyang Zhang,
	Stephen Hemminger, Tomas Winkler, Matt Fleming, Ard Biesheuvel,
	Rafael J. Wysocki

New helpers take pointers to uuid_{be|le} as parameters.

When using them on a raw data we don't need to do an ugly dereference
and, in some cases, a type casting.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Kirti Wankhede <kwankhede@nvidia.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Stephen Hemminger <sthemmin@microsoft.com>
Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/uuid.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/include/linux/uuid.h b/include/linux/uuid.h
index 4dff73a89758..45312cb5ac65 100644
--- a/include/linux/uuid.h
+++ b/include/linux/uuid.h
@@ -58,6 +58,26 @@ static inline int uuid_be_cmp(const uuid_be u1, const uuid_be u2)
 	return memcmp(&u1, &u2, sizeof(uuid_be));
 }
 
+static inline int uuid_le_cmp_p(const uuid_le *pu1, const uuid_le u2)
+{
+	return memcmp(pu1, &u2, sizeof(uuid_le));
+}
+
+static inline int uuid_be_cmp_p(const uuid_be *pu1, const uuid_be u2)
+{
+	return memcmp(pu1, &u2, sizeof(uuid_be));
+}
+
+static inline int uuid_le_cmp_pp(const uuid_le *pu1, const uuid_le *pu2)
+{
+	return memcmp(pu1, pu2, sizeof(uuid_le));
+}
+
+static inline int uuid_be_cmp_pp(const uuid_be *pu1, const uuid_be *pu2)
+{
+	return memcmp(pu1, pu2, sizeof(uuid_be));
+}
+
 void generate_random_uuid(unsigned char uuid[16]);
 
 extern void uuid_le_gen(uuid_le *u);
-- 
2.11.0

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

end of thread, other threads:[~2017-04-27 15:00 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-21 14:46 [PATCH v1 1/8] lib/uuid: Introduce uuid_{be|le}_cmp_p{p}() helpers Andy Shevchenko
2017-04-21 14:46 ` [PATCH v1 2/8] ASoC: Intel: Skylake: Use recently introduced uuid_le_cmp_p{p}() Andy Shevchenko
2017-04-24  4:51   ` Vinod Koul
2017-04-24  8:50     ` Andy Shevchenko
2017-04-21 14:46 ` [PATCH v1 3/8] HID: intel_ish-hid: " Andy Shevchenko
2017-04-21 14:46 ` [PATCH v1 4/8] vfio-mdev: " Andy Shevchenko
2017-04-21 14:46 ` [PATCH v1 5/8] vmbus: Use recently introduced uuid_le_cmp_p{p}() helpers Andy Shevchenko
2017-04-21 14:46 ` [PATCH v1 6/8] mei: " Andy Shevchenko
2017-04-21 14:46 ` [PATCH v1 7/8] efi: " Andy Shevchenko
2017-04-21 14:46 ` [PATCH v1 8/8] ACPI: " Andy Shevchenko
2017-04-21 21:22   ` Rafael J. Wysocki
2017-04-27 12:46     ` Borislav Petkov
2017-04-27 13:09       ` Andy Shevchenko
2017-04-27 15:00         ` Borislav Petkov
2017-04-23 10:29 ` [PATCH v1 1/8] lib/uuid: Introduce uuid_{be|le}_cmp_p{p}() helpers Winkler, Tomas
2017-04-23 12:42   ` Andy Shevchenko
2017-04-23 20:20     ` Winkler, Tomas
2017-04-24  8:53       ` Andy Shevchenko
2017-04-24 10:44   ` Lukas Wunner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).