summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2017-09-17 18:58:11 +0200
committerJohannes Berg <johannes.berg@intel.com>2017-09-21 15:17:35 +0200
commitb2e0254f82e24f83c54f9a5e5fdb579569ab46a5 (patch)
treef242b74cee794595d4e6104632c348811c4ec73c
parent0acb6552992e7fb62b24a5ed48f46250fdff0494 (diff)
header: add uuid backports
This backports the following upstream commits: f9727a17db9: ("uuid: rename uuid types") df33767d9fe: ("uuid: hoist helpers uuid_equal() and uuid_copy() from xfs") ath10k now makes use of them. Some parts should go into the uapi/linux/uuid.h file, but then #include_next hack is not working correctly any more, so place it all into the normal file. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--backport/backport-include/linux/uuid.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/backport/backport-include/linux/uuid.h b/backport/backport-include/linux/uuid.h
new file mode 100644
index 00000000..5ffe225b
--- /dev/null
+++ b/backport/backport-include/linux/uuid.h
@@ -0,0 +1,25 @@
+#ifndef __BACKPORT_LINUX_UUID_H_
+#define __BACKPORT_LINUX_UUID_H_
+#include <linux/version.h>
+#include_next <linux/uuid.h>
+
+#if LINUX_VERSION_IS_LESS(4,13,0)
+#define guid_t uuid_le
+#define uuid_t uuid_be
+
+static inline void guid_gen(guid_t *u)
+{
+ return uuid_le_gen(u);
+}
+static inline void uuid_gen(uuid_t *u)
+{
+ return uuid_be_gen(u);
+}
+
+static inline void guid_copy(guid_t *dst, const guid_t *src)
+{
+ memcpy(dst, src, sizeof(guid_t));
+}
+#endif
+
+#endif /* __BACKPORT_LINUX_UUID_H_ */