remoteproc: guard wc-ioremap helpers with HAS_IOMEM
PATCH 1/1 remoteproc: guard wc-ioremap helpers with HAS_IOMEM
The common wc-ioremap carveout callbacks live in remoteproc_internal.h, which is included by the remoteproc core. This means the helper bodies are parsed even for builds that do not enable any platform driver using those callbacks.
On s390, CONFIG_HAS_IOMEM and CONFIG_GENERIC_IOREMAP depend on CONFIG_PCI. A randconfig with CONFIG_REMOTEPROC=y and CONFIG_PCI=n therefore has no usable ioremap_wc() or iounmap() declarations, and fails to build the common remoteproc objects with implicit declarations from the helper bodies.
Only include linux/io.h and build the real wc-ioremap helpers when CONFIG_HAS_IOMEM is enabled. Provide no-IOMEM stubs so the internal header remains self-contained for randconfig and COMPILE_TEST coverage.
drivers/remoteproc/remoteproc_internal.h +16 -0
@@ -14,7 +14,9 @@#include <linux/irqreturn.h> #include <linux/firmware.h> +#ifdef CONFIG_HAS_IOMEM #include <linux/io.h> +#endif struct rproc ;
@@ -123,6 +125,7 @@ rproc_find_carveout_by_name(struct rproc *rproc, const char *name, ...);void rproc_add_rvdev (struct rproc *rproc,struct rproc_vdev *rvdev);void rproc_remove_rvdev (struct rproc_vdev *rvdev); +#ifdef CONFIG_HAS_IOMEM static inline int rproc_mem_entry_ioremap_wc (struct rproc *rproc,struct rproc_mem_entry *mem) {
@@ -148,6 +151,19 @@ static inline int rproc_mem_entry_iounmap(struct rproc *rproc,return 0 ; } +#else +static inline int rproc_mem_entry_ioremap_wc (struct rproc *rproc, +struct rproc_mem_entry *mem) +{ +return -EOPNOTSUPP ; +} + +static inline int rproc_mem_entry_iounmap (struct rproc *rproc, +struct rproc_mem_entry *mem) +{ +return 0 ; +} +#endif #define rproc_elf_load_rsc_table_optional (rproc, fw, dev_func, fmt, ...) \ ({ \
Signature · 1 line
2.34.1
Mathieu Poirier
maintainerQuoted 12 lines · Ben Levinsky
The common wc-ioremap carveout callbacks live in
remoteproc_internal.h, which is included by the remoteproc core. This means the helper bodies are parsed even for builds that do not enable any platform driver using those callbacks.On s390,
CONFIG_HAS_IOMEMandCONFIG_GENERIC_IOREMAPdepend onCONFIG_PCI. A randconfig withCONFIG_REMOTEPROC=yandCONFIG_PCI=ntherefore has no usableioremap_wc()oriounmap()declarations, and fails to build the common remoteproc objects with implicit declarations from the helper bodies.
Quoted 9 lines
Only include
linux/io.hand build the real wc-ioremap helpers whenCONFIG_HAS_IOMEMis enabled. Provide no-IOMEM stubs so the internal header remains self-contained for randconfig andCOMPILE_TESTcoverage.Fixes 50227acbf4e5 ("remoteproc: Add common wc-ioremap carveout callbacks")Reported-by kernel test robot <[email protected]>Signed-off-by Ben Levinsky <[email protected]>
Applied - let's see if that satisfies the bot.
Thanks,
Mathieu
Quoted 45 lines
drivers/remoteproc/remoteproc_internal.h +16
-1@@ -14,7 +14,9 @@#include <linux/irqreturn.h> #include <linux/firmware.h> +#ifdef CONFIG_HAS_IOMEM #include <linux/io.h> +#endif struct rproc ;@@ -123,6 +125,7 @@ rproc_find_carveout_by_name(struct rproc *rproc, const char *name, ...);void rproc_add_rvdev (struct rproc *rproc,struct rproc_vdev *rvdev);void rproc_remove_rvdev (struct rproc_vdev *rvdev); +#ifdef CONFIG_HAS_IOMEM static inline int rproc_mem_entry_ioremap_wc (struct rproc *rproc,struct rproc_mem_entry *mem) {@@ -148,6 +151,19 @@ static inline int rproc_mem_entry_iounmap(struct rproc *rproc,return 0 ; } +#else +static inline int rproc_mem_entry_ioremap_wc (struct rproc *rproc, +struct rproc_mem_entry *mem) +{ +return -EOPNOTSUPP ; +} + +static inline int rproc_mem_entry_iounmap (struct rproc *rproc, +struct rproc_mem_entry *mem) +{ +return 0 ; +} +#endif #define rproc_elf_load_rsc_table_optional (rproc, fw, dev_func, fmt, ...) \ ({ \ --2.34.1