Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc: pvpanic: fix warning implicit declaration

When building and have fragment CONFIG_NO_IOPORT_MAP enabled then the
following warning:

../drivers/misc/pvpanic.c: In function ‘pvpanic_walk_resources’:
../drivers/misc/pvpanic.c:73:10: error: implicit declaration of
function ‘ioport_map’; did you mean ‘ioremap’?
[-Werror=implicit-function-declaration]
base = ioport_map(r.start, resource_size(&r));
^~~~~~~~~~

Since commmit 5d32a66541c4 ("PCI/ACPI: Allow ACPI to be built without
CONFIG_PCI set"), its now possible to have ACPI enabled without haveing
PCI enabled. However, the pvpanic driver depends on HAS_IOPORT_MAP or
HAVE_IOREMAP_PROT when ACPI is enabled. It was fine until
commit 725eba2928ad ("misc/pvpanic: add MMIO support") got added.
Rework so that we do a extra check ifdef CONFIG_HAS_IOPORT_MAP.

Fixes: 5d32a66541c4 ("PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set")
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Anders Roxell and committed by
Greg Kroah-Hartman
d8e346eb 701956d4

+4
+4
drivers/misc/pvpanic.c
··· 70 70 struct resource r; 71 71 72 72 if (acpi_dev_resource_io(res, &r)) { 73 + #ifdef CONFIG_HAS_IOPORT_MAP 73 74 base = ioport_map(r.start, resource_size(&r)); 74 75 return AE_OK; 76 + #else 77 + return AE_ERROR; 78 + #endif 75 79 } else if (acpi_dev_resource_memory(res, &r)) { 76 80 base = ioremap(r.start, resource_size(&r)); 77 81 return AE_OK;