Skip to content

Commit 828e870

Browse files
floatiouskwilczynski
authored andcommitted
PCI: endpoint: pci-epf-test: Remove superfluous code
The only reason why we call pci_epf_configure_bar() is to set PCI_BASE_ADDRESS_MEM_TYPE_64 in case the hardware requires it. However, this flag is now automatically set when allocating a BAR that can only be a 64-bit BAR, so we can drop pci_epf_configure_bar() completely. Link: https://lore.kernel.org/linux-pci/[email protected] Signed-off-by: Niklas Cassel <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]>
1 parent 29a025b commit 828e870

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

drivers/pci/endpoint/functions/pci-epf-test.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -867,19 +867,6 @@ static int pci_epf_test_alloc_space(struct pci_epf *epf)
867867
return 0;
868868
}
869869

870-
static void pci_epf_configure_bar(struct pci_epf *epf,
871-
const struct pci_epc_features *epc_features)
872-
{
873-
struct pci_epf_bar *epf_bar;
874-
int i;
875-
876-
for (i = 0; i < PCI_STD_NUM_BARS; i++) {
877-
epf_bar = &epf->bar[i];
878-
if (epc_features->bar[i].only_64bit)
879-
epf_bar->flags |= PCI_BASE_ADDRESS_MEM_TYPE_64;
880-
}
881-
}
882-
883870
static int pci_epf_test_bind(struct pci_epf *epf)
884871
{
885872
int ret;
@@ -904,7 +891,6 @@ static int pci_epf_test_bind(struct pci_epf *epf)
904891
test_reg_bar = pci_epc_get_first_free_bar(epc_features);
905892
if (test_reg_bar < 0)
906893
return -EINVAL;
907-
pci_epf_configure_bar(epf, epc_features);
908894

909895
epf_test->test_reg_bar = test_reg_bar;
910896
epf_test->epc_features = epc_features;

0 commit comments

Comments
 (0)