diff mbox series

[1/1] of: unittest: pci_dt_testdrv: Fix compile error

Message ID 1692896179-73192-1-git-send-email-lizhi.hou@amd.com
State Changes Requested, archived
Headers show
Series [1/1] of: unittest: pci_dt_testdrv: Fix compile error | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 1 warnings, 8 lines checked
robh/patch-applied fail build log

Commit Message

Lizhi Hou Aug. 24, 2023, 4:56 p.m. UTC
pci_dt_testdrv depends on both PCI_DYNAMIC_OF_NODES and OF_OVERLAY.
Add #if check for OF_OVERLAY.

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")
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
---
 drivers/of/unittest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rob Herring Aug. 24, 2023, 10:22 p.m. UTC | #1
On Thu, Aug 24, 2023 at 11:56 AM Lizhi Hou <lizhi.hou@amd.com> wrote:
>
> pci_dt_testdrv depends on both PCI_DYNAMIC_OF_NODES and OF_OVERLAY.
> Add #if check for OF_OVERLAY.

Thanks for the quick fix. I just sent an alternative which reduces the
ifdefs[1].

Rob

[1] https://lore.kernel.org/all/20230824221743.1581707-1-robh@kernel.org/
diff mbox series

Patch

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index fef46a9a5e81..beb75d3b33f8 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -3732,7 +3732,7 @@  static inline __init void of_unittest_overlay_high_level(void) {}
 
 #endif
 
-#ifdef CONFIG_PCI_DYNAMIC_OF_NODES
+#if defined(CONFIG_PCI_DYNAMIC_OF_NODES) && defined(CONFIG_OF_OVERLAY)
 
 static int of_unittest_pci_dev_num;
 static int of_unittest_pci_child_num;