Skip to content

Commit 6859e4f

Browse files
Mani-Sadhasivambjorn-helgaas
authored andcommitted
PCI: endpoint: pci-epf-test: Use 'msix_capable' flag directly in pci_epf_test_alloc_space()
Instead of using a local variable to cache the 'msix_capable' flag, use it directly to simplify the code. Suggested-by: Niklas Cassel <cassel@kernel.org> Link: https://lore.kernel.org/linux-pci/20240418-pci-epf-test-fix-v2-2-eacd54831444@linaro.org Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Niklas Cassel <cassel@kernel.org>
1 parent 5a5095a commit 6859e4f

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -802,19 +802,15 @@ static int pci_epf_test_alloc_space(struct pci_epf *epf)
802802
size_t msix_table_size = 0;
803803
size_t test_reg_bar_size;
804804
size_t pba_size = 0;
805-
bool msix_capable;
806805
void *base;
807806
enum pci_barno test_reg_bar = epf_test->test_reg_bar;
808807
enum pci_barno bar;
809-
const struct pci_epc_features *epc_features;
808+
const struct pci_epc_features *epc_features = epf_test->epc_features;
810809
size_t test_reg_size;
811810

812-
epc_features = epf_test->epc_features;
813-
814811
test_reg_bar_size = ALIGN(sizeof(struct pci_epf_test_reg), 128);
815812

816-
msix_capable = epc_features->msix_capable;
817-
if (msix_capable) {
813+
if (epc_features->msix_capable) {
818814
msix_table_size = PCI_MSIX_ENTRY_SIZE * epf->msix_interrupts;
819815
epf_test->msix_table_offset = test_reg_bar_size;
820816
/* Align to QWORD or 8 Bytes */

0 commit comments

Comments
 (0)