mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 07:08:21 -04:00
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 <cassel@kernel.org> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240207213922.1796533-4-cassel@kernel.org [mani: reworded commit message] Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
This commit is contained in:
committed by
Manivannan Sadhasivam
parent
84b51a6bae
commit
fda826b15c
@@ -841,12 +841,6 @@ static int pci_epf_test_alloc_space(struct pci_epf *epf)
|
||||
}
|
||||
test_reg_size = test_reg_bar_size + msix_table_size + pba_size;
|
||||
|
||||
if (epc_features->bar_fixed_size[test_reg_bar]) {
|
||||
if (test_reg_size > bar_size[test_reg_bar])
|
||||
return -ENOMEM;
|
||||
test_reg_size = bar_size[test_reg_bar];
|
||||
}
|
||||
|
||||
base = pci_epf_alloc_space(epf, test_reg_size, test_reg_bar,
|
||||
epc_features, PRIMARY_INTERFACE);
|
||||
if (!base) {
|
||||
@@ -888,8 +882,6 @@ static void pci_epf_configure_bar(struct pci_epf *epf,
|
||||
bar_fixed_64bit = !!(epc_features->bar_fixed_64bit & (1 << i));
|
||||
if (bar_fixed_64bit)
|
||||
epf_bar->flags |= PCI_BASE_ADDRESS_MEM_TYPE_64;
|
||||
if (epc_features->bar_fixed_size[i])
|
||||
bar_size[i] = epc_features->bar_fixed_size[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user