Add a #define for the PCI resource type mask. We use this mask multiple times in the bus setup.
Unified · Split
| @@ -1518,13 +1518,16 @@ static void __pci_bridge_assign_resources(const struct pci_dev *bridge, · 1517 unmodified lines | ||
| 1518 | 1518 | break; |
| 1519 | 1519 | } |
| 1520 | 1520 | } |
| 1521 | + | |
| 1522 | +#define PCI_RES_TYPE_MASK \ | |
| 1523 | + (IORESOURCE_IO | IORESOURCE_MEM | IORESOURCE_PREFETCH |\ | |
| 1524 | + IORESOURCE_MEM_64) | |
| 1525 | + | |
| 1521 | 1526 | static void pci_bridge_release_resources(struct pci_bus *bus, |
| 1522 | 1527 | unsigned long type) |
| 1523 | 1528 | { |
| 1524 | 1529 | struct pci_dev *dev = bus->self; |
| 1525 | 1530 | struct resource *r; |
| 1526 | − unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM | | |
| 1527 | − IORESOURCE_PREFETCH | IORESOURCE_MEM_64; | |
| 1528 | 1531 | unsigned old_flags = 0; |
| 1529 | 1532 | struct resource *b_res; |
| 1530 | 1533 | int idx = 1; |
| @@ -1567,7 +1570,7 @@ static void pci_bridge_release_resources(struct pci_bus *bus, · 36 unmodified lines | ||
| 1567 | 1570 | */ |
| 1568 | 1571 | release_child_resources(r); |
| 1569 | 1572 | if (!release_resource(r)) { |
| 1570 | − type = old_flags = r->flags & type_mask; | |
| 1573 | + type = old_flags = r->flags & PCI_RES_TYPE_MASK; | |
| 1571 | 1574 | dev_printk(KERN_DEBUG, &dev->dev, "resource %d %pR released\n", |
| 1572 | 1575 | PCI_BRIDGE_RESOURCES + idx, r); |
| 1573 | 1576 | /* keep the old size */ |
| @@ -1758,8 +1761,6 @@ void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus) · 184 unmodified lines | ||
| 1758 | 1761 | enum release_type rel_type = leaf_only; |
| 1759 | 1762 | LIST_HEAD(fail_head); |
| 1760 | 1763 | struct pci_dev_resource *fail_res; |
| 1761 | − unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM | | |
| 1762 | − IORESOURCE_PREFETCH | IORESOURCE_MEM_64; | |
| 1763 | 1764 | int pci_try_num = 1; |
| 1764 | 1765 | enum enable_type enable_local; |
| 1765 | 1766 | |
| @@ -1818,7 +1819,7 @@ again: · 52 unmodified lines | ||
| 1818 | 1819 | */ |
| 1819 | 1820 | list_for_each_entry(fail_res, &fail_head, list) |
| 1820 | 1821 | pci_bus_release_bridge_resources(fail_res->dev->bus, |
| 1821 | − fail_res->flags & type_mask, | |
| 1822 | + fail_res->flags & PCI_RES_TYPE_MASK, | |
| 1822 | 1823 | rel_type); |
| 1823 | 1824 | |
| 1824 | 1825 | /* restore size and flags */ |
| @@ -1862,8 +1863,6 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge) · 37 unmodified lines | ||
| 1862 | 1863 | LIST_HEAD(fail_head); |
| 1863 | 1864 | struct pci_dev_resource *fail_res; |
| 1864 | 1865 | int retval; |
| 1865 | − unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM | | |
| 1866 | − IORESOURCE_PREFETCH | IORESOURCE_MEM_64; | |
| 1867 | 1866 | |
| 1868 | 1867 | again: |
| 1869 | 1868 | __pci_bus_size_bridges(parent, &add_list); |
| @@ -1889,7 +1888,7 @@ again: · 19 unmodified lines | ||
| 1889 | 1888 | */ |
| 1890 | 1889 | list_for_each_entry(fail_res, &fail_head, list) |
| 1891 | 1890 | pci_bus_release_bridge_resources(fail_res->dev->bus, |
| 1892 | − fail_res->flags & type_mask, | |
| 1891 | + fail_res->flags & PCI_RES_TYPE_MASK, | |
| 1893 | 1892 | whole_subtree); |
| 1894 | 1893 | |
| 1895 | 1894 | /* restore size and flags */ |