lib/efi: Move magic to implementation
authorGeoff Levand <geoff@infradead.org>
Fri, 10 Aug 2018 17:29:15 +0000 (17:29 +0000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 14 Aug 2018 01:12:06 +0000 (11:12 +1000)
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>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
lib/efi/efivar.c
lib/efi/efivar.h

index f1dd0021cea0c8070a8da86ac303ac07723b82ee..37bb6d9468440d6d95ca56b88b87ed675b328007 100644 (file)
@@ -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>
 #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)
 {
index b74ab64d254c377d7da6b39766ba29fb398a3157..9307d6c1761156cc802f0f8692744e5592d17c46 100644 (file)
@@ -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
        EFI_VARIABLE_BOOTSERVICE_ACCESS \
 )
 
-#ifndef EFIVARFS_MAGIC
-#define EFIVARFS_MAGIC 0xde5e81e4
-#endif
-
 struct efi_data {
        uint32_t attributes;
        size_t data_size;