Skip to content

Commit fda826b

Browse files
floatiousMani-Sadhasivam
authored andcommitted
PCI: endpoint: pci-epf-test: Remove superfluous checks for pci_epf_alloc_space() API
Now that the checks are performed by the pci_epf_alloc_space() API, let's remove the superfluous checks in this driver. Signed-off-by: Niklas Cassel <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Reviewed-by: Frank Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] [mani: reworded commit message] Signed-off-by: Manivannan Sadhasivam <[email protected]>
1 parent 84b51a6 commit fda826b

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -841,12 +841,6 @@ static int pci_epf_test_alloc_space(struct pci_epf *epf)
841841
}
842842
test_reg_size = test_reg_bar_size + msix_table_size + pba_size;
843843

844-
if (epc_features->bar_fixed_size[test_reg_bar]) {
845-
if (test_reg_size > bar_size[test_reg_bar])
846-
return -ENOMEM;
847-
test_reg_size = bar_size[test_reg_bar];
848-
}
849-
850844
base = pci_epf_alloc_space(epf, test_reg_size, test_reg_bar,
851845
epc_features, PRIMARY_INTERFACE);
852846
if (!base) {
@@ -888,8 +882,6 @@ static void pci_epf_configure_bar(struct pci_epf *epf,
888882
bar_fixed_64bit = !!(epc_features->bar_fixed_64bit & (1 << i));
889883
if (bar_fixed_64bit)
890884
epf_bar->flags |= PCI_BASE_ADDRESS_MEM_TYPE_64;
891-
if (epc_features->bar_fixed_size[i])
892-
bar_size[i] = epc_features->bar_fixed_size[i];
893885
}
894886
}
895887

0 commit comments

Comments
 (0)