Skip to contentSkip to conversation

efi: Fix TPM code build failure on ARM

PATCH In review Matthew Garrett 4 participants 5 messages Jun 5, 2019 – Jun 9, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: Fix TPM code build failure on ARM

asm/early_ioremap.h needs to be #included before tpm_eventlog.h in order to ensure that early_memremap is available.

---
 drivers/firmware/efi/tpm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/firmware/efi/tpm.c +1 -2
index 0bdceb5913aa..1d3f5ca3eaaf 100644
@@ -7,13 +7,12 @@
 #define TPM_MEMREMAP(start, size) early_memremap(start, size)
 #define TPM_MEMUNMAP(start, size) early_memunmap(start, size)
 
+#include <asm/early_ioremap.h>
 #include <linux/efi.h>
 #include <linux/init.h>
 #include <linux/memblock.h>
 #include <linux/tpm_eventlog.h>
 
-#include <asm/early_ioremap.h>
-
 int efi_tpm_final_log_size;
 EXPORT_SYMBOL(efi_tpm_final_log_size);
 
Signature · 1 line
2.22.0.rc1.311.g5d7573a151-goog
#1 lore raw
Quoted 4 lines · Matthew Garrett

asm/early_ioremap.h needs to be #included before tpm_eventlog.h in order to ensure that early_memremap is available.

Doesn't that make it tpm_eventlog.h's job to #include it?

Quoted 27 lines
---
 drivers/firmware/efi/tpm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/firmware/efi/tpm.c +1 -3
index 0bdceb5913aa..1d3f5ca3eaaf 100644
@@ -7,13 +7,12 @@
 #define TPM_MEMREMAP(start, size) early_memremap(start, size)
 #define TPM_MEMUNMAP(start, size) early_memunmap(start, size)
 
+#include <asm/early_ioremap.h>
 #include <linux/efi.h>
 #include <linux/init.h>
 #include <linux/memblock.h>
 #include <linux/tpm_eventlog.h>
 
-#include <asm/early_ioremap.h>
-
 int efi_tpm_final_log_size;
 EXPORT_SYMBOL(efi_tpm_final_log_size);
 
--

2.22.0.rc1.311.g5d7573a151-goog

#2 lore raw
Quoted 8 lines · Ard Biesheuvel
Quoted 4 lines · Matthew Garrett

asm/early_ioremap.h needs to be #included before tpm_eventlog.h in order to ensure that early_memremap is available.

Doesn't that make it tpm_eventlog.h's job to #include it?

tpm_eventlog.h doesn't use early_memremap directly, it's expanded from the macros declared in tpm.c .

#3 lore raw
Quoted 5 lines · Matthew Garrett
Quoted 3 lines · Ard Biesheuvel
Quoted 1 line · Matthew Garrett
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

asm/early_ioremap.h needs to be #included before tpm_eventlog.h in order to ensure that early_memremap is available.

Doesn't that make it tpm_eventlog.h's job to #include it?

tpm_eventlog.h doesn't use early_memremap directly, it's expanded from the macros declared in tpm.c .

Fair enough