From: Markus Elfring <Markus.Elfring@web.de>
To: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH] PCI: Reduce the scope for a variable in pci_bridge_release_resources()
Date: Sat, 23 Aug 2025 09:51:57 +0200 [thread overview]
Message-ID: <599e9acf-886b-4394-86bb-099e062c5b2c@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 23 Aug 2025 09:40:13 +0200
* Move the definition for the local variable “old_flags”
into an if branch.
* Put the assignment for the local variable “type” on a separate line.
The source code was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/pci/setup-bus.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 119f97b96480..38bf4e673bd7 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1714,7 +1714,6 @@ static void pci_bridge_release_resources(struct pci_bus *bus,
{
struct pci_dev *dev = bus->self;
struct resource *r;
- unsigned int old_flags;
struct resource *b_res;
int idx = 1;
@@ -1751,7 +1750,9 @@ static void pci_bridge_release_resources(struct pci_bus *bus,
/* If there are children, release them all */
release_child_resources(r);
if (!release_resource(r)) {
- type = old_flags = r->flags & PCI_RES_TYPE_MASK;
+ unsigned int old_flags = r->flags & PCI_RES_TYPE_MASK;
+
+ type = old_flags;
pci_info(dev, "resource %d %pR released\n",
PCI_BRIDGE_RESOURCES + idx, r);
/* Keep the old size */
--
2.51.0
next reply other threads:[~2025-08-23 7:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-23 7:51 Markus Elfring [this message]
2025-08-25 10:13 ` Ilpo Järvinen
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=599e9acf-886b-4394-86bb-099e062c5b2c@web.de \
--to=markus.elfring@web.de \
--cc=bhelgaas@google.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.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
all inboxes | Powered by JetHome®