linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Niklas Schnelle <schnelle@linux.ibm.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	Pierre Morel <pmorel@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-s390@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH RESEND v5 1/4] PCI: Clean up pci_scan_slot()
Date: Thu, 12 May 2022 16:56:42 +0200	[thread overview]
Message-ID: <f34130034637278c9999cf6d430be558cb0c2318.camel@linux.ibm.com> (raw)
In-Reply-To: <20220505083839.1315705-2-schnelle@linux.ibm.com>

On Thu, 2022-05-05 at 10:38 +0200, Niklas Schnelle wrote:
> While determining the next PCI function is factored out of
> pci_scan_slot() into next_fn() the former still handles the first
> function as a special case. This duplicates the code from the scan loop.
> 
> Furthermore the non ARI branch of next_fn() is generally hard to
> understand and especially the check for multifunction devices is hidden
> in the handling of NULL devices for non-contiguous multifunction. It
> also signals that no further functions need to be scanned by returning
> 0 via wraparound and this is a valid function number.
> 
> Improve upon this by transforming the conditions in next_fn() to be
> easier to understand.
> 
> By changing next_fn() to return -ENODEV instead of 0 when there is no
> next function we can then handle the initial function inside the loop
> and deduplicate the shared handling. This also makes it more explicit
> that only function 0 must exist.
> 
> No functional change is intended.
> 
> Cc: Jan Kiszka <jan.kiszka@siemens.com>
> Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
> ---

Friendly ping :-)


  reply	other threads:[~2022-05-12 14:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05  8:38 [PATCH RESEND v5 0/4] PCI: Rework pci_scan_slot() and isolated PCI functions Niklas Schnelle
2022-05-05  8:38 ` [PATCH RESEND v5 1/4] PCI: Clean up pci_scan_slot() Niklas Schnelle
2022-05-12 14:56   ` Niklas Schnelle [this message]
2022-05-13 14:07     ` Bjorn Helgaas
2022-05-13 14:47       ` Niklas Schnelle
2022-05-23  8:40       ` Niklas Schnelle
2022-05-05  8:38 ` [PATCH RESEND v5 2/4] PCI: Move jailhouse's isolated function handling to pci_scan_slot() Niklas Schnelle
2022-05-05  8:38 ` [PATCH RESEND v5 3/4] PCI: Extend isolated function probing to s390 Niklas Schnelle
2022-05-05  8:38 ` [PATCH RESEND v5 4/4] s390/pci: allow zPCI zbus without a function zero Niklas Schnelle
2022-06-02 10:30 [PATCH RESEND v5 0/4] PCI: Rework pci_scan_slot() and isolated PCI functions Niklas Schnelle
2022-06-02 10:30 ` [PATCH RESEND v5 1/4] PCI: Clean up pci_scan_slot() Niklas Schnelle
2022-06-15 11:09   ` Niklas Schnelle

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=f34130034637278c9999cf6d430be558cb0c2318.camel@linux.ibm.com \
    --to=schnelle@linux.ibm.com \
    --cc=bhelgaas@google.com \
    --cc=jan.kiszka@siemens.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=pmorel@linux.ibm.com \
    --cc=virtualization@lists.linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).