[<prev] [next>] [day] [month] [year] [list]
Message-ID: <599e9acf-886b-4394-86bb-099e062c5b2c@web.de>
Date: Sat, 23 Aug 2025 09:51:57 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-pci@...r.kernel.org, Bjorn Helgaas <bhelgaas@...gle.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Subject: [PATCH] PCI: Reduce the scope for a variable in
pci_bridge_release_resources()
From: Markus Elfring <elfring@...rs.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@...rs.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
Powered by blists - more mailing lists