Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "David Matlack" <dmatlack@google.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v8 06/12] PCI: liveupdate: Auto-preserve upstream bridges across Live Update
Date: Tue, 28 Jul 2026 22:18:52 +0000	[thread overview]
Message-ID: <20260728221853.4C0F01F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260728221007.2098560-7-dmatlack@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The `for_each_pci_dev_in_path` macro violates standard kernel iterator conventions by not initializing its iterator variable, creating a confusing API that may lead to misuse.
--

--- Patch [6]: [PATCH v8 06/12] PCI: liveupdate: Auto-preserve upstream bridges across Live Update ---
commit 5f902c08492796d638f5197db23659b872ce5e10
Author: David Matlack <dmatlack@google.com>

PCI: liveupdate: Auto-preserve upstream bridges across Live Update

This commit updates the PCI Live Update mechanism to automatically preserve
upstream PCI-to-PCI bridges when a downstream device is preserved. It tracks
the number of downstream devices preserved under each bridge using a
reference count in struct pci_dev_ser.

> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index b41dd572a2d6b..6267c83813d55 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -829,6 +829,9 @@ static inline struct pci_dev *pci_upstream_bridge(struct pci_dev *dev)
>  	return dev->bus->self;
>  }
>  
> +#define for_each_pci_dev_in_path(dev) \
> +	for (; dev; dev = pci_upstream_bridge(dev))

[Severity: Low]
Does this macro violate standard kernel iterator conventions by not
initializing its iterator variable?

Standard Linux kernel for_each iterators typically initialize their loop
variables. By omitting the initialization here, the macro expects the caller
to pre-initialize the variable and then mutates it in place. 

While the current usages in this patch are functionally correct, could this
unexpected behavior lead to confusion and API misuse for future callers?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260728221007.2098560-1-dmatlack@google.com?part=6

  reply	other threads:[~2026-07-28 22:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 22:09 [PATCH v8 00/12] PCI: liveupdate: PCI core support for Live Update David Matlack
2026-07-28 22:09 ` [PATCH v8 01/12] PCI: liveupdate: Set up FLB handler for the PCI core David Matlack
2026-07-28 22:19   ` sashiko-bot
2026-07-28 22:09 ` [PATCH v8 02/12] PCI: liveupdate: Track outgoing preserved PCI devices David Matlack
2026-07-28 22:19   ` sashiko-bot
2026-07-28 22:09 ` [PATCH v8 03/12] PCI: liveupdate: Track incoming " David Matlack
     [not found]   ` <20260728222257.56AD41F000E9@smtp.kernel.org>
2026-07-28 23:37     ` David Matlack
2026-07-28 22:09 ` [PATCH v8 04/12] PCI: liveupdate: Document driver binding responsibilities David Matlack
2026-07-28 22:12   ` sashiko-bot
2026-07-28 22:09 ` [PATCH v8 05/12] PCI: liveupdate: Preserve bus numbers during Live Update David Matlack
2026-07-28 22:19   ` sashiko-bot
2026-07-28 22:10 ` [PATCH v8 06/12] PCI: liveupdate: Auto-preserve upstream bridges across " David Matlack
2026-07-28 22:18   ` sashiko-bot [this message]
2026-07-28 22:10 ` [PATCH v8 07/12] PCI: Refactor matching logic for pci_dev_acs_ops David Matlack
2026-07-28 22:18   ` sashiko-bot
2026-07-28 22:10 ` [PATCH v8 08/12] PCI: liveupdate: Adopt ACS controls in incoming preserved devices David Matlack
2026-07-28 22:22   ` sashiko-bot
2026-07-28 22:10 ` [PATCH v8 09/12] PCI: liveupdate: Adopt ARI Forwarding Enable on preserved bridges David Matlack
2026-07-28 22:19   ` sashiko-bot
2026-07-28 22:10 ` [PATCH v8 10/12] PCI: liveupdate: Freeze preservation status during shutdown David Matlack
2026-07-28 22:21   ` sashiko-bot
2026-07-28 22:10 ` [PATCH v8 11/12] PCI: liveupdate: Do not disable bus mastering on preserved devices during kexec David Matlack
2026-07-28 22:18   ` sashiko-bot
2026-07-28 22:10 ` [PATCH v8 12/12] Documentation: PCI: Add documentation for Live Update David Matlack
2026-07-28 22:19   ` sashiko-bot

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=20260728221853.4C0F01F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmatlack@google.com \
    --cc=linux-pci@vger.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