devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: unittest: Fix of_unittest_pci_node() kconfig dependencies
@ 2023-08-24 22:17 Rob Herring
  2023-08-25 18:55 ` Randy Dunlap
  2023-08-28 14:26 ` Rob Herring
  0 siblings, 2 replies; 3+ messages in thread
From: Rob Herring @ 2023-08-24 22:17 UTC (permalink / raw)
  To: Frank Rowand, Lizhi Hou; +Cc: kernel test robot, devicetree, linux-kernel

of_unittest_pci_node test depends on both CONFIG_PCI_DYNAMIC_OF_NODES
and CONFIG_OF_OVERLAY. Move the test into the existing
CONFIG_OF_OVERLAY ifdef and rework the CONFIG_PCI_DYNAMIC_OF_NODES
dependency to use IS_ENABLED() instead. This reduces the combinations to
build.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308241954.oRNfVqmB-lkp@intel.com/
Fixes: 26409dd04589 ("of: unittest: Add pci_dt_testdrv pci driver")
Cc: Lizhi Hou <lizhi.hou@amd.com>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/of/unittest.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 9c0f352cb241..ad2b7879cc67 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -3799,14 +3799,6 @@ static __init void of_unittest_overlay_high_level(void)
 	mutex_unlock(&of_mutex);
 }
 
-#else
-
-static inline __init void of_unittest_overlay_high_level(void) {}
-
-#endif
-
-#ifdef CONFIG_PCI_DYNAMIC_OF_NODES
-
 static int of_unittest_pci_dev_num;
 static int of_unittest_pci_child_num;
 
@@ -3954,6 +3946,9 @@ static void __init of_unittest_pci_node(void)
 	struct pci_dev *pdev = NULL;
 	int rc;
 
+	if (!IS_ENABLED(CONFIG_PCI_DYNAMIC_OF_NODES))
+		return;
+
 	rc = pci_register_driver(&testdrv_driver);
 	unittest(!rc, "Failed to register pci test driver; rc = %d\n", rc);
 	if (rc)
@@ -3987,7 +3982,10 @@ static void __init of_unittest_pci_node(void)
 		pci_dev_put(pdev);
 }
 #else
-static void __init of_unittest_pci_node(void) { }
+
+static inline __init void of_unittest_overlay_high_level(void) {}
+static inline __init void of_unittest_pci_node(void) { }
+
 #endif
 
 static int __init of_unittest(void)
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] of: unittest: Fix of_unittest_pci_node() kconfig dependencies
  2023-08-24 22:17 [PATCH] of: unittest: Fix of_unittest_pci_node() kconfig dependencies Rob Herring
@ 2023-08-25 18:55 ` Randy Dunlap
  2023-08-28 14:26 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2023-08-25 18:55 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand, Lizhi Hou
  Cc: kernel test robot, devicetree, linux-kernel



On 8/24/23 15:17, Rob Herring wrote:
> of_unittest_pci_node test depends on both CONFIG_PCI_DYNAMIC_OF_NODES
> and CONFIG_OF_OVERLAY. Move the test into the existing
> CONFIG_OF_OVERLAY ifdef and rework the CONFIG_PCI_DYNAMIC_OF_NODES
> dependency to use IS_ENABLED() instead. This reduces the combinations to
> build.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202308241954.oRNfVqmB-lkp@intel.com/
> Fixes: 26409dd04589 ("of: unittest: Add pci_dt_testdrv pci driver")
> Cc: Lizhi Hou <lizhi.hou@amd.com>
> Signed-off-by: Rob Herring <robh@kernel.org>


Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
>  drivers/of/unittest.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 

-- 
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] of: unittest: Fix of_unittest_pci_node() kconfig dependencies
  2023-08-24 22:17 [PATCH] of: unittest: Fix of_unittest_pci_node() kconfig dependencies Rob Herring
  2023-08-25 18:55 ` Randy Dunlap
@ 2023-08-28 14:26 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2023-08-28 14:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, kernel test robot, Lizhi Hou, Frank Rowand,
	linux-kernel


On Thu, 24 Aug 2023 17:17:34 -0500, Rob Herring wrote:
> of_unittest_pci_node test depends on both CONFIG_PCI_DYNAMIC_OF_NODES
> and CONFIG_OF_OVERLAY. Move the test into the existing
> CONFIG_OF_OVERLAY ifdef and rework the CONFIG_PCI_DYNAMIC_OF_NODES
> dependency to use IS_ENABLED() instead. This reduces the combinations to
> build.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202308241954.oRNfVqmB-lkp@intel.com/
> Fixes: 26409dd04589 ("of: unittest: Add pci_dt_testdrv pci driver")
> Cc: Lizhi Hou <lizhi.hou@amd.com>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/of/unittest.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 

Applied, thanks!


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-28 14:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-24 22:17 [PATCH] of: unittest: Fix of_unittest_pci_node() kconfig dependencies Rob Herring
2023-08-25 18:55 ` Randy Dunlap
2023-08-28 14:26 ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).