Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alex Elder" <elder@riscstar.com>
Cc: robh@kernel.org, conor+dt@kernel.org, linux-pci@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 4/4] PCI: of: introduce of_pci_verify_node()
Date: Fri, 07 Aug 2026 19:49:44 +0000	[thread overview]
Message-ID: <20260807194944.DEE001F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260807194100.455599-5-elder@riscstar.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The static DT node verification function `of_pci_verify_node()` is mistakenly placed under `#ifdef CONFIG_PCI_DYNAMIC_OF_NODES`, making it a silent no-op on systems that only use statically-defined nodes.
--

--- Patch [4]: [PATCH 4/4] PCI: of: introduce of_pci_verify_node() ---
commit 29170ab92dd207c740eed74438cd2e09bad49131
Author: Alex Elder <elder@riscstar.com>

PCI: of: introduce of_pci_verify_node()

This commit introduces a runtime check to verify that statically-defined
(pre-existing) devicetree nodes for non-bridge PCI endpoints do not
incorrectly contain the device_type = "pci" property. It adds a call to
of_pci_verify_node() during PCI bus device addition to catch these errors.

> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -1265,6 +1265,7 @@ static inline int of_pci_get_equalization_presets(struct device *dev,
>  struct of_changeset;
>  
>  #ifdef CONFIG_PCI_DYNAMIC_OF_NODES
> +void of_pci_verify_node(struct pci_dev *pdev);

[Severity: Medium]
Since the intent is to verify statically-defined devicetree nodes, will
placing this declaration inside the CONFIG_PCI_DYNAMIC_OF_NODES block
accidentally disable the check on platforms that only use static nodes?

If CONFIG_PCI_DYNAMIC_OF_NODES is disabled, this falls back to the empty
stub below, causing the verification to be silently skipped.

>  void of_pci_make_dev_node(struct pci_dev *pdev);
>  void of_pci_remove_node(struct pci_dev *pdev);

[ ... ]

>  #else
> +static inline void of_pci_verify_node(struct pci_dev *pdev) { }
>  static inline void of_pci_make_dev_node(struct pci_dev *pdev) { }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260807194100.455599-1-elder@riscstar.com?part=4

  reply	other threads:[~2026-08-07 19:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 19:40 [PATCH 0/4] PCI: of: warn on bogus device_type property Alex Elder
2026-08-07 19:40 ` [PATCH 1/4] PCI: of: drop the reg_num argument to of_pci_set_address() Alex Elder
2026-08-07 19:54   ` sashiko-bot
2026-08-07 20:58     ` Alex Elder
2026-08-07 19:40 ` [PATCH 2/4] PCI: of: don't zero flags in of_pci_get_addr_flags() Alex Elder
2026-08-07 19:56   ` sashiko-bot
2026-08-07 20:58     ` Alex Elder
2026-08-07 19:40 ` [PATCH 3/4] PCI: of: make a flags argument optional Alex Elder
2026-08-07 19:51   ` sashiko-bot
2026-08-07 19:40 ` [PATCH 4/4] PCI: of: introduce of_pci_verify_node() Alex Elder
2026-08-07 19:49   ` sashiko-bot [this message]
2026-08-07 20:58     ` Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260807194944.DEE001F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=elder@riscstar.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox