[PATCH 1/16 v6] PCI: remove unnecessary arg of pci_update_resource()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Yu Zhao
Date: Wednesday, October 22, 2008 - 1:40 am

This cleanup removes unnecessary argument 'struct resource *res' in
pci_update_resource(), so it takes same arguments as other companion
functions (pci_assign_resource(), etc.).

Cc: Alex Chiang <achiang@hp.com>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Greg KH <greg@kroah.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Roland Dreier <rdreier@cisco.com>
Signed-off-by: Yu Zhao <yu.zhao@intel.com>

---
 drivers/pci/pci.c       |    4 ++--
 drivers/pci/setup-res.c |    7 ++++---
 include/linux/pci.h     |    2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 4db261e..ae62f01 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -376,8 +376,8 @@ pci_restore_bars(struct pci_dev *dev)
 		return;
 	}
 
-	for (i = 0; i < numres; i ++)
-		pci_update_resource(dev, &dev->resource[i], i);
+	for (i = 0; i < numres; i++)
+		pci_update_resource(dev, i);
 }
 
 static struct pci_platform_pm_ops *pci_platform_pm;
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 2dbd96c..b7ca679 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -26,11 +26,12 @@
 #include "pci.h"
 
 
-void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
+void pci_update_resource(struct pci_dev *dev, int resno)
 {
 	struct pci_bus_region region;
 	u32 new, check, mask;
 	int reg;
+	struct resource *res = dev->resource + resno;
 
 	/*
 	 * Ignore resources for unimplemented BARs and unused resource slots
@@ -162,7 +163,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
 	} else {
 		res->flags &= ~IORESOURCE_STARTALIGN;
 		if (resno < PCI_BRIDGE_RESOURCES)
-			pci_update_resource(dev, res, resno);
+			pci_update_resource(dev, resno);
 	}
 
 	return ret;
@@ -197,7 +198,7 @@ int pci_assign_resource_fixed(struct pci_dev *dev, int resno)
 		dev_err(&dev->dev, "BAR %d: can't allocate %s resource %pR\n",
 			resno, res->flags & IORESOURCE_IO ? "I/O" : "mem", res);
 	} else if (resno < PCI_BRIDGE_RESOURCES) {
-		pci_update_resource(dev, res, resno);
+		pci_update_resource(dev, resno);
 	}
 
 	return ret;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 085187b..43e1fc1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -626,7 +626,7 @@ int pcix_get_mmrbc(struct pci_dev *dev);
 int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
 int pcie_get_readrq(struct pci_dev *dev);
 int pcie_set_readrq(struct pci_dev *dev, int rq);
-void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
+void pci_update_resource(struct pci_dev *dev, int resno);
 int __must_check pci_assign_resource(struct pci_dev *dev, int i);
 int pci_select_bars(struct pci_dev *dev, unsigned long flags);
 
-- 
1.5.6.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Yu Zhao, (Wed Oct 22, 1:38 am)
[PATCH 1/16 v6] PCI: remove unnecessary arg of pci_update_ ..., Yu Zhao, (Wed Oct 22, 1:40 am)
[PATCH 3/16 v6] PCI: export __pci_read_base, Yu Zhao, (Wed Oct 22, 1:41 am)
git repository for SR-IOV development?, H L, (Thu Nov 6, 9:51 am)
Re: git repository for SR-IOV development?, Greg KH, (Thu Nov 6, 9:59 am)
RE: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Fischer, Anna, (Thu Nov 6, 10:38 am)
Re: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Matthew Wilcox, (Thu Nov 6, 10:47 am)
Re: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Matthew Wilcox, (Thu Nov 6, 11:36 am)
Re: git repository for SR-IOV development?, H L, (Thu Nov 6, 12:58 pm)
RE: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Fischer, Anna, (Thu Nov 6, 1:04 pm)
RE: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Fischer, Anna, (Thu Nov 6, 2:35 pm)
Re: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Simon Horman, (Thu Nov 6, 3:24 pm)
Re: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Anthony Liguori, (Thu Nov 6, 3:38 pm)
Re: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Anthony Liguori, (Thu Nov 6, 3:40 pm)
Re: git repository for SR-IOV development?, Simon Horman, (Thu Nov 6, 3:56 pm)
Re: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Matthew Wilcox, (Thu Nov 6, 3:58 pm)
Re: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Chris Wright, (Thu Nov 6, 4:54 pm)
RE: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Dong, Eddie, (Thu Nov 6, 6:52 pm)
Re: git repository for SR-IOV development?, Greg KH, (Thu Nov 6, 6:58 pm)
RE: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Nakajima, Jun, (Thu Nov 6, 7:08 pm)
RE: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Leonid Grossman, (Fri Nov 7, 12:29 am)
Re: git repository for SR-IOV development?, Yu Zhao, (Fri Nov 7, 6:09 am)
RE: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Fischer, Anna, (Sat Nov 8, 4:09 am)
RE: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Leonid Grossman, (Sat Nov 8, 8:37 am)
Re: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Muli Ben-Yehuda, (Sat Nov 8, 11:41 pm)
Re: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Avi Kivity, (Sun Nov 9, 12:37 pm)
Re: [PATCH 0/16 v6] PCI: Linux kernel SR-IOV support, Avi Kivity, (Tue Nov 11, 2:00 am)