diff mbox series

efi: Fix TPM code build failure on ARM

Message ID 20190605181140.35559-1-matthewgarrett@google.com (mailing list archive)
State New, archived
Headers show
Series efi: Fix TPM code build failure on ARM | expand

Commit Message

Matthew Garrett June 5, 2019, 6:11 p.m. UTC
asm/early_ioremap.h needs to be #included before tpm_eventlog.h in order
to ensure that early_memremap is available.

Signed-off-by: Matthew Garrett <mjg59@google.com>
---
 drivers/firmware/efi/tpm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Ard Biesheuvel June 6, 2019, 11:39 a.m. UTC | #1
On Wed, 5 Jun 2019 at 20:11, Matthew Garrett <matthewgarrett@google.com> wrote:
>
> 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?


> Signed-off-by: Matthew Garrett <mjg59@google.com>
> ---
>  drivers/firmware/efi/tpm.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c
> index 0bdceb5913aa..1d3f5ca3eaaf 100644
> --- a/drivers/firmware/efi/tpm.c
> +++ b/drivers/firmware/efi/tpm.c
> @@ -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
>
Matthew Garrett June 6, 2019, 4:03 p.m. UTC | #2
On Thu, Jun 6, 2019 at 4:39 AM Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>
> On Wed, 5 Jun 2019 at 20:11, Matthew Garrett <matthewgarrett@google.com> wrote:
> >
> > 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 .
Ard Biesheuvel June 7, 2019, 10:03 a.m. UTC | #3
On Thu, 6 Jun 2019 at 18:04, Matthew Garrett <mjg59@google.com> wrote:
>
> On Thu, Jun 6, 2019 at 4:39 AM Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> >
> > On Wed, 5 Jun 2019 at 20:11, Matthew Garrett <matthewgarrett@google.com> wrote:
> > >
> > > 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

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Jarkko Sakkinen June 9, 2019, 7:53 p.m. UTC | #4
On Wed, Jun 05, 2019 at 11:11:40AM -0700, Matthew Garrett wrote:
> asm/early_ioremap.h needs to be #included before tpm_eventlog.h in order
> to ensure that early_memremap is available.
> 
> Signed-off-by: Matthew Garrett <mjg59@google.com>

Thanks, squashed to "tpm: Reserve the TPM final events table".

/Jarkko
diff mbox series

Patch

diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c
index 0bdceb5913aa..1d3f5ca3eaaf 100644
--- a/drivers/firmware/efi/tpm.c
+++ b/drivers/firmware/efi/tpm.c
@@ -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);