From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Arnd Bergmann <arnd@arndb.de>, Theodore Ts'o <tytso@mit.edu>,
Matt Fleming <matt@codeblueprint.co.uk>,
Andrew Morton <akpm@linux-foundation.org>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org,
linux-api@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v2 7/8] efi: redefine type, constant, macro from generic code
Date: Mon, 4 Apr 2016 16:30:09 +0300 [thread overview]
Message-ID: <1459776610-68469-8-git-send-email-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <1459776610-68469-1-git-send-email-andriy.shevchenko@linux.intel.com>
Generic UUID library defines structure type, macro to define UUID, and the
length of the UUID string. This patch removes duplicate data structure
definition, UUID string length constant as well as macro for UUID handling.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
include/linux/efi.h | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 1626474..5b1d5c5 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -21,6 +21,7 @@
#include <linux/pfn.h>
#include <linux/pstore.h>
#include <linux/reboot.h>
+#include <linux/uuid.h>
#include <asm/page.h>
@@ -43,17 +44,10 @@ typedef u16 efi_char16_t; /* UNICODE character */
typedef u64 efi_physical_addr_t;
typedef void *efi_handle_t;
-
-typedef struct {
- u8 b[16];
-} efi_guid_t;
+typedef uuid_le efi_guid_t;
#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \
-((efi_guid_t) \
-{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
- (b) & 0xff, ((b) >> 8) & 0xff, \
- (c) & 0xff, ((c) >> 8) & 0xff, \
- (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
+ UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)
/*
* Generic EFI table header
@@ -1050,7 +1044,7 @@ efi_reboot(enum reboot_mode reboot_mode, const char *__unused) {}
* Length of a GUID string (strlen("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"))
* not including trailing NUL
*/
-#define EFI_VARIABLE_GUID_LEN 36
+#define EFI_VARIABLE_GUID_LEN UUID_STRING_LEN
/*
* The type of search to perform when calling boottime->locate_handle
--
2.8.0.rc3
next prev parent reply other threads:[~2016-04-04 13:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-04 13:30 [PATCH v2 0/8] uuid: convert users to generic UUID API Andy Shevchenko
2016-04-04 13:30 ` [PATCH v2 1/8] lib/vsprintf: simplify UUID printing Andy Shevchenko
2016-04-04 13:30 ` [PATCH v2 2/8] lib/uuid: move generate_random_uuid() to uuid.c Andy Shevchenko
2016-04-04 13:30 ` [PATCH v2 3/8] lib/uuid: introduce few more generic helpers for UUID Andy Shevchenko
2016-04-04 23:40 ` Andrew Morton
2016-04-04 23:55 ` Joe Perches
[not found] ` <20160404164029.9c72a93cb29d619766fbb2d2-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2016-04-05 0:48 ` Stephen Rothwell
2016-04-05 10:51 ` Andy Shevchenko
[not found] ` <1459776610-68469-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-04-04 13:30 ` [PATCH v2 4/8] lib/uuid: remove FSF address Andy Shevchenko
2016-04-04 13:30 ` [PATCH v2 5/8] sysctl: drop away useless label Andy Shevchenko
2016-04-04 13:30 ` [PATCH v2 6/8] sysctl: use generic UUID library Andy Shevchenko
2016-04-04 13:30 ` Andy Shevchenko [this message]
2016-04-04 13:30 ` [PATCH v2 8/8] efivars: " Andy Shevchenko
2016-04-04 23:40 ` [PATCH v2 0/8] uuid: convert users to generic UUID API Andrew Morton
[not found] ` <20160404164020.9a3529e6e247aac6ec114fff-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2016-04-05 11:07 ` Andy Shevchenko
2016-04-05 14:06 ` Matt Fleming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1459776610-68469-8-git-send-email-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=linux-api@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=matt@codeblueprint.co.uk \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).