diff mbox series

[v1,1/6] lib/efi: Add EFI_DEFALT_ATTRIBUTES macro

Message ID 14e587d6127aad17d1951156c2fff625e1177ccd.1533921283.git.geoff@infradead.org
State Accepted
Headers show
Series [v1,1/6] lib/efi: Add EFI_DEFALT_ATTRIBUTES macro | expand

Commit Message

Geoff Levand Aug. 10, 2018, 5:29 p.m. UTC
For convenience, add a new efi data attributes macro
EFI_DEFALT_ATTRIBUTES.

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 discover/platform-arm64.c | 5 +----
 lib/efi/efivar.h          | 6 ++++++
 2 files changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/discover/platform-arm64.c b/discover/platform-arm64.c
index a70298a..0eb2579 100644
--- a/discover/platform-arm64.c
+++ b/discover/platform-arm64.c
@@ -70,10 +70,7 @@  static void write_nvram(const struct param_list *pl)
 	struct efi_data efi_data;
 	struct param *param;
 
-	efi_data.attributes =
-		EFI_VARIABLE_NON_VOLATILE |
-		EFI_VARIABLE_RUNTIME_ACCESS |
-		EFI_VARIABLE_BOOTSERVICE_ACCESS;
+	efi_data.attributes = EFI_DEFALT_ATTRIBUTES;
 
 	param_list_for_each(pl, param) {
 		if (!param->modified)
diff --git a/lib/efi/efivar.h b/lib/efi/efivar.h
index 0d44100..48edd17 100644
--- a/lib/efi/efivar.h
+++ b/lib/efi/efivar.h
@@ -30,6 +30,12 @@ 
 #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS  0x00000020
 #define EFI_VARIABLE_APPEND_WRITE                           0x00000040
 
+#define EFI_DEFALT_ATTRIBUTES ( \
+	EFI_VARIABLE_NON_VOLATILE | \
+	EFI_VARIABLE_RUNTIME_ACCESS | \
+	EFI_VARIABLE_BOOTSERVICE_ACCESS \
+)
+
 #ifndef EFIVARFS_MAGIC
 #define EFIVARFS_MAGIC 0xde5e81e4
 #endif