Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1684322 > unrolled thread
| Started by | Christian König <deathsimple@vodafone.de> |
|---|---|
| First post | 2017-07-10 17:10 +0200 |
| Last post | 2017-07-10 23:50 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v8 1/6] PCI: add a define for the PCI resource type mask v2 Christian König <deathsimple@vodafone.de> - 2017-07-10 17:10 +0200
Re: [PATCH v8 1/6] PCI: add a define for the PCI resource type mask v2 Bjorn Helgaas <helgaas@kernel.org> - 2017-07-10 23:50 +0200
| From | Christian König <deathsimple@vodafone.de> |
|---|---|
| Date | 2017-07-10 17:10 +0200 |
| Subject | [PATCH v8 1/6] PCI: add a define for the PCI resource type mask v2 |
| Message-ID | <u1ItY-6DH-21@gated-at.bofh.it> |
From: Christian König <christian.koenig@amd.com>
We use this mask multiple times in the bus setup.
v2: fix some style nit picks
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
drivers/pci/pci.h | 3 +++
drivers/pci/setup-bus.c | 12 +++---------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 03e3d02..136a0f9 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -4,6 +4,9 @@
#define PCI_FIND_CAP_TTL 48
#define PCI_VSEC_ID_INTEL_TBT 0x1234 /* Thunderbolt */
+#define PCI_RES_TYPE_MASK \
+ (IORESOURCE_IO | IORESOURCE_MEM | IORESOURCE_PREFETCH |\
+ IORESOURCE_MEM_64)
extern const unsigned char pcie_link_speed[];
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 958da7d..37450d9 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1523,8 +1523,6 @@ static void pci_bridge_release_resources(struct pci_bus *bus,
{
struct pci_dev *dev = bus->self;
struct resource *r;
- unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM |
- IORESOURCE_PREFETCH | IORESOURCE_MEM_64;
unsigned old_flags = 0;
struct resource *b_res;
int idx = 1;
@@ -1567,7 +1565,7 @@ static void pci_bridge_release_resources(struct pci_bus *bus,
*/
release_child_resources(r);
if (!release_resource(r)) {
- type = old_flags = r->flags & type_mask;
+ type = old_flags = r->flags & PCI_RES_TYPE_MASK;
dev_printk(KERN_DEBUG, &dev->dev, "resource %d %pR released\n",
PCI_BRIDGE_RESOURCES + idx, r);
/* keep the old size */
@@ -1758,8 +1756,6 @@ void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)
enum release_type rel_type = leaf_only;
LIST_HEAD(fail_head);
struct pci_dev_resource *fail_res;
- unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM |
- IORESOURCE_PREFETCH | IORESOURCE_MEM_64;
int pci_try_num = 1;
enum enable_type enable_local;
@@ -1818,7 +1814,7 @@ void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)
*/
list_for_each_entry(fail_res, &fail_head, list)
pci_bus_release_bridge_resources(fail_res->dev->bus,
- fail_res->flags & type_mask,
+ fail_res->flags & PCI_RES_TYPE_MASK,
rel_type);
/* restore size and flags */
@@ -1862,8 +1858,6 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)
LIST_HEAD(fail_head);
struct pci_dev_resource *fail_res;
int retval;
- unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM |
- IORESOURCE_PREFETCH | IORESOURCE_MEM_64;
again:
__pci_bus_size_bridges(parent, &add_list);
@@ -1889,7 +1883,7 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)
*/
list_for_each_entry(fail_res, &fail_head, list)
pci_bus_release_bridge_resources(fail_res->dev->bus,
- fail_res->flags & type_mask,
+ fail_res->flags & PCI_RES_TYPE_MASK,
whole_subtree);
/* restore size and flags */
--
2.7.4
[toc] | [next] | [standalone]
| From | Bjorn Helgaas <helgaas@kernel.org> |
|---|---|
| Date | 2017-07-10 23:50 +0200 |
| Subject | Re: [PATCH v8 1/6] PCI: add a define for the PCI resource type mask v2 |
| Message-ID | <u1OJ3-1X8-5@gated-at.bofh.it> |
| In reply to | #1684322 |
If you post this again, you can drop the "v2", "v5", etc at the end of the subject lines. I don't think it's useful to merge those. On Mon, Jul 10, 2017 at 04:59:49PM +0200, Christian König wrote: > From: Christian König <christian.koenig@amd.com> > > We use this mask multiple times in the bus setup. > > v2: fix some style nit picks And you can put these "v2: ..." notes after the "---" because I don't think they're useful after merging either. > Signed-off-by: Christian König <christian.koenig@amd.com> > Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> > --- > drivers/pci/pci.h | 3 +++ > drivers/pci/setup-bus.c | 12 +++--------- > 2 files changed, 6 insertions(+), 9 deletions(-)
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web