[v1,4/6] lib/efi: Move magic to implementation

Message ID 0d5aac413ac04b15b64dee5ce4ad5490bc9d91e7.1533921283.git.geoff@infradead.org
State Accepted
Headers show
Series
  • [v1,1/6] lib/efi: Add EFI_DEFALT_ATTRIBUTES macro
Related show

Commit Message

Geoff Levand Aug. 10, 2018, 5:29 p.m.
efi_check_mount now does a magic number check by default, so
move the magic number related code from efivar.h to efivar.c.

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

Patch

diff --git a/lib/efi/efivar.c b/lib/efi/efivar.c
index f1dd002..37bb6d9 100644
--- a/lib/efi/efivar.c
+++ b/lib/efi/efivar.c
@@ -24,6 +24,7 @@ 
 #include <string.h>
 
 #include <linux/fs.h>
+#include <linux/magic.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
@@ -32,6 +33,10 @@ 
 #include "log/log.h"
 #include "talloc/talloc.h"
 
+#ifndef EFIVARFS_MAGIC
+#define EFIVARFS_MAGIC 0xde5e81e4
+#endif
+
 void efi_init_mount(struct efi_mount *efi_mount, const char *path,
 	const char *guid)
 {
diff --git a/lib/efi/efivar.h b/lib/efi/efivar.h
index b74ab64..9307d6c 100644
--- a/lib/efi/efivar.h
+++ b/lib/efi/efivar.h
@@ -22,8 +22,6 @@ 
 #include <stdbool.h>
 #include <stdint.h>
 
-#include <linux/magic.h>
-
 #define EFI_VARIABLE_NON_VOLATILE                           0x00000001
 #define EFI_VARIABLE_BOOTSERVICE_ACCESS                     0x00000002
 #define EFI_VARIABLE_RUNTIME_ACCESS                         0x00000004
@@ -38,10 +36,6 @@ 
 	EFI_VARIABLE_BOOTSERVICE_ACCESS \
 )
 
-#ifndef EFIVARFS_MAGIC
-#define EFIVARFS_MAGIC 0xde5e81e4
-#endif
-
 struct efi_data {
 	uint32_t attributes;
 	size_t data_size;