Re: [PATCH -next] efi: Do not include asm/efi.h if not needed

From: Guenter Roeck
Date: Sun Jan 10 2016 - 14:47:33 EST


On 01/10/2016 11:39 AM, Guenter Roeck wrote:
On 01/10/2016 09:31 AM, Ard Biesheuvel wrote:
On 10 January 2016 at 18:02, Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx> wrote:
On 10 January 2016 at 16:35, Guenter Roeck <linux@xxxxxxxxxxxx> wrote:
Commit f7d924894265 ("arm64/efi: refactor EFI init and runtime code
for reuse by 32-bit ARM") adds an include of asm/efi.h to efi.c.
This causes a build failure for ia64, where asm/efi.h does not exist.

drivers/firmware/efi/efi.c:28:21: fatal error:
asm/efi.h: No such file or directory

asm/efi.h does not define or declare anything used by efi.c, thus
including it should not be needed.

Fixes: f7d924894265 ("arm64/efi: refactor EFI init and runtime code for reuse by 32-bit ARM")
Cc: Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>
Cc: Will Deacon <will.deacon@xxxxxxx>
Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>

This fixes ia64 but breaks ARM

drivers/firmware/efi/efi.c: In function âefi_mem_desc_lookupâ:
drivers/firmware/efi/efi.c:291:3: error: implicit declaration of
function âearly_memremapâ [-Werror=implicit-function-declaration]
drivers/firmware/efi/efi.c:291:6: warning: assignment makes pointer
from integer without a cast [enabled by default]
drivers/firmware/efi/efi.c:301:4: error: implicit declaration of
function âearly_memunmapâ [-Werror=implicit-function-declaration]
drivers/firmware/efi/efi.c: In function âefi_config_parse_tablesâ:
drivers/firmware/efi/efi.c:404:7: warning: assignment makes pointer
from integer without a cast [enabled by default]
drivers/firmware/efi/efi.c: In function âefi_config_initâ:
drivers/firmware/efi/efi.c:433:16: warning: assignment makes pointer
from integer without a cast [enabled by default]


This means efi.c should include <asm/early_ioremap.h> but that does
not exist on ia64 either.
Perhaps add a #ifdef CONFIG_IA64?

#include <asm/io.h>

I'll check if that works for all architectures.


... and it doesn't.

Ok, I give up on that one. I don't know what a proper fix would be.
My argument would be that the arm changes broke the build for ia64,
are therefore the culprit and should either be reverted or dropped.
But I'll leave that to the ia64 and efi maintainers to sort out.

Thanks,
Guenter