Skip to content

Commit 6eaa83e

Browse files
ij-intelbjorn-helgaas
authored andcommitted
PCI: Remove unused PCI_SUBTRACTIVE_DECODE
2fe2abf ("PCI: augment bus resource table with a list") added PCI_SUBTRACTIVE_DECODE which is put into the struct pci_bus_resource flags field but is never read. There seems to never have been users for it. Remove both PCI_SUBTRACTIVE_DECODE and the flags field from the struct pci_bus_resource. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]>
1 parent 9852d85 commit 6eaa83e

File tree

5 files changed

+6
-19
lines changed

5 files changed

+6
-19
lines changed

arch/s390/pci/pci_bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int zpci_bus_prepare_device(struct zpci_dev *zdev)
5353
zpci_setup_bus_resources(zdev);
5454
for (i = 0; i < PCI_STD_NUM_BARS; i++) {
5555
if (zdev->bars[i].res)
56-
pci_bus_add_resource(zdev->zbus->bus, zdev->bars[i].res, 0);
56+
pci_bus_add_resource(zdev->zbus->bus, zdev->bars[i].res);
5757
}
5858
}
5959

arch/x86/pci/fixup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ static void pci_amd_enable_64bit_bar(struct pci_dev *dev)
757757
dev_info(&dev->dev, "adding root bus resource %pR (tainting kernel)\n",
758758
res);
759759
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
760-
pci_bus_add_resource(dev->bus, res, 0);
760+
pci_bus_add_resource(dev->bus, res);
761761
}
762762

763763
base = ((res->start >> 8) & AMD_141b_MMIO_BASE_MMIOBASE_MASK) |

drivers/pci/bus.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ void pci_free_resource_list(struct list_head *resources)
4646
}
4747
EXPORT_SYMBOL(pci_free_resource_list);
4848

49-
void pci_bus_add_resource(struct pci_bus *bus, struct resource *res,
50-
unsigned int flags)
49+
void pci_bus_add_resource(struct pci_bus *bus, struct resource *res)
5150
{
5251
struct pci_bus_resource *bus_res;
5352

@@ -58,7 +57,6 @@ void pci_bus_add_resource(struct pci_bus *bus, struct resource *res,
5857
}
5958

6059
bus_res->res = res;
61-
bus_res->flags = flags;
6260
list_add_tail(&bus_res->list, &bus->resources);
6361
}
6462

drivers/pci/probe.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,7 @@ void pci_read_bridge_bases(struct pci_bus *child)
546546
if (dev->transparent) {
547547
pci_bus_for_each_resource(child->parent, res) {
548548
if (res && res->flags) {
549-
pci_bus_add_resource(child, res,
550-
PCI_SUBTRACTIVE_DECODE);
549+
pci_bus_add_resource(child, res);
551550
pci_info(dev, " bridge window %pR (subtractive decode)\n",
552551
res);
553552
}
@@ -1032,7 +1031,7 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
10321031
if (res->flags & IORESOURCE_BUS)
10331032
pci_bus_insert_busn_res(bus, bus->number, res->end);
10341033
else
1035-
pci_bus_add_resource(bus, res, 0);
1034+
pci_bus_add_resource(bus, res);
10361035

10371036
if (offset) {
10381037
if (resource_type(res) == IORESOURCE_IO)

include/linux/pci.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -633,18 +633,9 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge);
633633
* Use pci_bus_for_each_resource() to iterate through all the resources.
634634
*/
635635

636-
/*
637-
* PCI_SUBTRACTIVE_DECODE means the bridge forwards the window implicitly
638-
* and there's no way to program the bridge with the details of the window.
639-
* This does not apply to ACPI _CRS windows, even with the _DEC subtractive-
640-
* decode bit set, because they are explicit and can be programmed with _SRS.
641-
*/
642-
#define PCI_SUBTRACTIVE_DECODE 0x1
643-
644636
struct pci_bus_resource {
645637
struct list_head list;
646638
struct resource *res;
647-
unsigned int flags;
648639
};
649640

650641
#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */
@@ -1498,8 +1489,7 @@ void pci_add_resource(struct list_head *resources, struct resource *res);
14981489
void pci_add_resource_offset(struct list_head *resources, struct resource *res,
14991490
resource_size_t offset);
15001491
void pci_free_resource_list(struct list_head *resources);
1501-
void pci_bus_add_resource(struct pci_bus *bus, struct resource *res,
1502-
unsigned int flags);
1492+
void pci_bus_add_resource(struct pci_bus *bus, struct resource *res);
15031493
struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n);
15041494
void pci_bus_remove_resources(struct pci_bus *bus);
15051495
void pci_bus_remove_resource(struct pci_bus *bus, struct resource *res);

0 commit comments

Comments
 (0)