Re: [PATCH v2] of_device: removed #include that caused a recursion in included headers
Hi Hadar, Thank you for the patch! Yet something to improve: [auto build test ERROR on stm32/stm32-next] [also build test ERROR on sunxi/sunxi/for-next linus/master v5.7-rc1 next-20200416] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Hadar-Gat/of_device-removed-include-that-caused-a-recursion-in-included-headers/20200417-155422 base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next config: sparc64-defconfig (attached as .config) compiler: sparc64-linux-gcc (GCC) 9.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=sparc64 If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot All errors (new ones prefixed by >>): arch/sparc/kernel/sbus.c: In function 'sbus_init': >> arch/sparc/kernel/sbus.c:669:32: error: implicit declaration of function >> 'of_find_device_by_node'; did you mean 'bus_find_device_by_fwnode'? >> [-Werror=implicit-function-declaration] 669 | struct platform_device *op = of_find_device_by_node(dp); |^~ |bus_find_device_by_fwnode >> arch/sparc/kernel/sbus.c:669:32: error: initialization of 'struct >> platform_device *' from 'int' makes pointer from integer without a cast >> [-Werror=int-conversion] cc1: all warnings being treated as errors -- arch/sparc/kernel/pci.c: In function 'of_create_pci_dev': >> arch/sparc/kernel/pci.c:276:7: error: implicit declaration of function >> 'of_find_device_by_node'; did you mean 'bus_find_device_by_fwnode'? >> [-Werror=implicit-function-declaration] 276 | op = of_find_device_by_node(node); | ^~ | bus_find_device_by_fwnode >> arch/sparc/kernel/pci.c:276:5: error: assignment to 'struct platform_device >> *' from 'int' makes pointer from integer without a cast >> [-Werror=int-conversion] 276 | op = of_find_device_by_node(node); | ^ cc1: all warnings being treated as errors -- arch/sparc/kernel/pci_sabre.c: In function 'sabre_register_error_handlers': >> arch/sparc/kernel/pci_sabre.c:324:7: error: implicit declaration of function >> 'of_find_device_by_node'; did you mean 'bus_find_device_by_fwnode'? >> [-Werror=implicit-function-declaration] 324 | op = of_find_device_by_node(dp); | ^~ | bus_find_device_by_fwnode arch/sparc/kernel/pci_sabre.c:324:5: error: assignment to 'struct platform_device *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion] 324 | op = of_find_device_by_node(dp); | ^ cc1: all warnings being treated as errors -- arch/sparc/kernel/pci_schizo.c: In function 'tomatillo_register_error_handlers': >> arch/sparc/kernel/pci_schizo.c:850:31: error: implicit declaration of >> function 'of_find_device_by_node'; did you mean 'bus_find_device_by_fwnode'? >> [-Werror=implicit-function-declaration] 850 | struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node); | ^~ | bus_find_device_by_fwnode arch/sparc/kernel/pci_schizo.c:850:31: error: initialization of 'struct platform_device *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion] arch/sparc/kernel/pci_schizo.c: In function 'schizo_register_error_handlers': arch/sparc/kernel/pci_schizo.c:945:31: error: initialization of 'struct platform_device *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion] 945 | struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node); | ^~ cc1: all warnings being treated as errors vim +669 arch/sparc/kernel/sbus.c 8fae097debdf8a arch/sparc64/kernel/sbus.c David S. Miller 2006-06-20 663 046e26a8ba10b8 arch/sparc64/kernel/sbus.c David S. Miller 2008-08-27 664 static int __init sbus_init(void) 576c352e89e57c arch/sparc64/kernel/sbus.c David S. Miller 2006-06-23 665 { 046e26a8ba10b8 arch/sparc64/kernel/sbus.c David S. Miller 2008-08-27 666 struct device_node *dp; 046e26a8ba10b8 arch/sparc64/kernel/sbus.c David S. Miller 2008-08-27 667 046e26a8ba10b8 arch/sparc64/kernel/sbus.c David S. Miller 2008-08-27 668 for_each_node_by_name(dp, "sbus") { cd4cd7306a403f arch/sparc/kernel/sbus.c Grant Likely2010-07-22 @669
Re: [PATCH v2] of_device: removed #include that caused a recursion in included headers
Hi Hadar, Thank you for the patch! Yet something to improve: [auto build test ERROR on stm32/stm32-next] [also build test ERROR on sunxi/sunxi/for-next linus/master v5.7-rc1 next-20200416] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Hadar-Gat/of_device-removed-include-that-caused-a-recursion-in-included-headers/20200417-155422 base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next config: arm-imx_v6_v7_defconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=arm If you fix the issue, kindly add following tag as appropriate Reported-by: kbuild test robot All errors (new ones prefixed by >>): drivers/media/platform/coda/coda-common.c: In function 'coda_get_vdoa_data': >> drivers/media/platform/coda/coda-common.c:385:14: error: implicit >> declaration of function 'of_find_device_by_node'; did you mean >> 'of_find_spi_device_by_node'? [-Werror=implicit-function-declaration] 385 | vdoa_pdev = of_find_device_by_node(vdoa_node); | ^~ | of_find_spi_device_by_node drivers/media/platform/coda/coda-common.c:385:12: warning: assignment to 'struct platform_device *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 385 | vdoa_pdev = of_find_device_by_node(vdoa_node); |^ cc1: some warnings being treated as errors vim +385 drivers/media/platform/coda/coda-common.c 927933f7b4b213 drivers/media/platform/coda.c Philipp Zabel 2013-09-30 374 e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 375 static struct vdoa_data *coda_get_vdoa_data(void) e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 376 { e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 377struct device_node *vdoa_node; e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 378struct platform_device *vdoa_pdev; e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 379struct vdoa_data *vdoa_data = NULL; e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 380 e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 381vdoa_node = of_find_compatible_node(NULL, NULL, "fsl,imx6q-vdoa"); e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 382if (!vdoa_node) e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 383return NULL; e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 384 e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 @385vdoa_pdev = of_find_device_by_node(vdoa_node); e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 386if (!vdoa_pdev) e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 387goto out; e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 388 e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 389vdoa_data = platform_get_drvdata(vdoa_pdev); e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 390if (!vdoa_data) e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 391vdoa_data = ERR_PTR(-EPROBE_DEFER); e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 392 e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 393 out: e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 394of_node_put(vdoa_node); e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 395 e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 396return vdoa_data; e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 397 } e7f3c548103508 drivers/media/platform/coda/coda-common.c Michael Tretter 2017-01-20 398 :: The code at line 385 was first introduced by commit :: e7f3c54810350827823d241905fb7823eee30c21 [media] coda: use VDOA for un-tiling
Re: [PATCH v2] of_device: removed #include that caused a recursion in included headers
Quoting Hadar Gat (2020-04-16 02:49:03) > Both of_platform.h and of_device.h were included each other. > In of_device.h, removed unneeded #include to of_platform.h > and added include to of_platform.h in the files that needs it. > > Signed-off-by: Hadar Gat > --- Acked-by: Stephen Boyd # clk ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH v2] of_device: removed #include that caused a recursion in included headers
On Thu, 16 Apr 2020 12:49:03 +0300 Hadar Gat wrote: > Both of_platform.h and of_device.h were included each other. > In of_device.h, removed unneeded #include to of_platform.h > and added include to of_platform.h in the files that needs it. > > Signed-off-by: Hadar Gat Hmm. I guess the chances of this causing merge problems are fairly low so perhaps not worth doing additions of headers via individual subsystems and actually dropping the header include after another cycle. So on that basis Acked-by: Jonathan Cameron #for-iio > --- > v2: add include to of_platform.h in more files. (reported due other builds) > > arch/sparc/mm/io-unit.c | 1 + > arch/sparc/mm/iommu.c | 1 + > drivers/base/platform.c | 1 + > drivers/bus/imx-weim.c| 1 + > drivers/bus/vexpress-config.c | 1 + > drivers/clk/mediatek/clk-mt7622-aud.c | 1 + > drivers/dma/at_hdmac.c| 1 + > drivers/dma/stm32-dmamux.c| 1 + > drivers/dma/ti/dma-crossbar.c | 1 + > drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 1 + > drivers/gpu/drm/msm/hdmi/hdmi.c | 1 + > drivers/gpu/drm/msm/msm_drv.c | 1 + > drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 1 + > drivers/gpu/drm/sun4i/sun4i_tcon.c| 1 + > drivers/iio/adc/stm32-adc-core.c | 1 + > drivers/iio/adc/stm32-dfsdm-adc.c | 1 + > drivers/iio/adc/stm32-dfsdm-core.c| 1 + > drivers/iommu/tegra-smmu.c| 1 + > drivers/memory/atmel-ebi.c| 1 + > drivers/mfd/palmas.c | 1 + > drivers/mfd/ssbi.c| 1 + > drivers/mtd/nand/raw/omap2.c | 1 + > drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 1 + > drivers/net/ethernet/ti/cpsw.c| 1 + > drivers/phy/tegra/xusb.c | 1 + > drivers/pinctrl/freescale/pinctrl-imx1-core.c | 1 + > drivers/pinctrl/nomadik/pinctrl-nomadik.c | 1 + > drivers/soc/samsung/exynos-pmu.c | 1 + > drivers/soc/sunxi/sunxi_sram.c| 1 + > include/linux/of_device.h | 2 -- > lib/genalloc.c| 1 + > 31 files changed, 30 insertions(+), 2 deletions(-) > > diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c > index 289276b..5638399 100644 > --- a/arch/sparc/mm/io-unit.c > +++ b/arch/sparc/mm/io-unit.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > > #include > #include > diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c > index b00dde1..9cbb2e7 100644 > --- a/arch/sparc/mm/iommu.c > +++ b/arch/sparc/mm/iommu.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > > #include > #include > diff --git a/drivers/base/platform.c b/drivers/base/platform.c > index 520..f549274b 100644 > --- a/drivers/base/platform.c > +++ b/drivers/base/platform.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > #include > #include > #include > diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c > index 28bb65a..8c786da 100644 > --- a/drivers/bus/imx-weim.c > +++ b/drivers/bus/imx-weim.c > @@ -11,6 +11,7 @@ > #include > #include > #include > +#include > #include > #include > #include > diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c > index ff70575..12b8b0b 100644 > --- a/drivers/bus/vexpress-config.c > +++ b/drivers/bus/vexpress-config.c > @@ -8,6 +8,7 @@ > #include > #include > #include > +#include > #include > > > diff --git a/drivers/clk/mediatek/clk-mt7622-aud.c > b/drivers/clk/mediatek/clk-mt7622-aud.c > index 2bd4295..8cbb68f 100644 > --- a/drivers/clk/mediatek/clk-mt7622-aud.c > +++ b/drivers/clk/mediatek/clk-mt7622-aud.c > @@ -9,6 +9,7 @@ > #include > #include > #include > +#include > #include > > #include "clk-mtk.h" > diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c > index 73a2078..388f8e10 100644 > --- a/drivers/dma/at_hdmac.c > +++ b/drivers/dma/at_hdmac.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > #include > > #include "at_hdmac_regs.h" > diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c > index 12f7637..b704896 100644 > --- a/drivers/dma/stm32-dmamux.c > +++ b/drivers/dma/stm32-dmamux.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > #include > #include > #include > diff --git a/drivers/dma/ti/dma-crossbar.c b/drivers/dma/ti/dma-crossbar.c > index 4ba8fa5..2c0fd44 100644 > --- a/drivers/dma/ti/dma-crossbar.c > +++ b/drivers/dma/ti/dma-crossbar.c > @@ -10,6 +10,7 @@ > #include > #include > #include > +#include
[PATCH v2] of_device: removed #include that caused a recursion in included headers
Both of_platform.h and of_device.h were included each other. In of_device.h, removed unneeded #include to of_platform.h and added include to of_platform.h in the files that needs it. Signed-off-by: Hadar Gat --- v2: add include to of_platform.h in more files. (reported due other builds) arch/sparc/mm/io-unit.c | 1 + arch/sparc/mm/iommu.c | 1 + drivers/base/platform.c | 1 + drivers/bus/imx-weim.c| 1 + drivers/bus/vexpress-config.c | 1 + drivers/clk/mediatek/clk-mt7622-aud.c | 1 + drivers/dma/at_hdmac.c| 1 + drivers/dma/stm32-dmamux.c| 1 + drivers/dma/ti/dma-crossbar.c | 1 + drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 1 + drivers/gpu/drm/msm/hdmi/hdmi.c | 1 + drivers/gpu/drm/msm/msm_drv.c | 1 + drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 1 + drivers/gpu/drm/sun4i/sun4i_tcon.c| 1 + drivers/iio/adc/stm32-adc-core.c | 1 + drivers/iio/adc/stm32-dfsdm-adc.c | 1 + drivers/iio/adc/stm32-dfsdm-core.c| 1 + drivers/iommu/tegra-smmu.c| 1 + drivers/memory/atmel-ebi.c| 1 + drivers/mfd/palmas.c | 1 + drivers/mfd/ssbi.c| 1 + drivers/mtd/nand/raw/omap2.c | 1 + drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 1 + drivers/net/ethernet/ti/cpsw.c| 1 + drivers/phy/tegra/xusb.c | 1 + drivers/pinctrl/freescale/pinctrl-imx1-core.c | 1 + drivers/pinctrl/nomadik/pinctrl-nomadik.c | 1 + drivers/soc/samsung/exynos-pmu.c | 1 + drivers/soc/sunxi/sunxi_sram.c| 1 + include/linux/of_device.h | 2 -- lib/genalloc.c| 1 + 31 files changed, 30 insertions(+), 2 deletions(-) diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c index 289276b..5638399 100644 --- a/arch/sparc/mm/io-unit.c +++ b/arch/sparc/mm/io-unit.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff --git a/arch/sparc/mm/iommu.c b/arch/sparc/mm/iommu.c index b00dde1..9cbb2e7 100644 --- a/arch/sparc/mm/iommu.c +++ b/arch/sparc/mm/iommu.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 520..f549274b 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c index 28bb65a..8c786da 100644 --- a/drivers/bus/imx-weim.c +++ b/drivers/bus/imx-weim.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c index ff70575..12b8b0b 100644 --- a/drivers/bus/vexpress-config.c +++ b/drivers/bus/vexpress-config.c @@ -8,6 +8,7 @@ #include #include #include +#include #include diff --git a/drivers/clk/mediatek/clk-mt7622-aud.c b/drivers/clk/mediatek/clk-mt7622-aud.c index 2bd4295..8cbb68f 100644 --- a/drivers/clk/mediatek/clk-mt7622-aud.c +++ b/drivers/clk/mediatek/clk-mt7622-aud.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "clk-mtk.h" diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 73a2078..388f8e10 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include "at_hdmac_regs.h" diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c index 12f7637..b704896 100644 --- a/drivers/dma/stm32-dmamux.c +++ b/drivers/dma/stm32-dmamux.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/dma/ti/dma-crossbar.c b/drivers/dma/ti/dma-crossbar.c index 4ba8fa5..2c0fd44 100644 --- a/drivers/dma/ti/dma-crossbar.c +++ b/drivers/dma/ti/dma-crossbar.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #define TI_XBAR_DRA7 0 diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index c4e71ab..f523254 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "a6xx_gpu.h" diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 737453b..5034d40 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -7,6 +7,7 @@ #include #include +#include #include #include