PCI: epf-test: Simplify read/write/copy test functions
authorDamien Le Moal <dlemoal@kernel.org>
Sat, 15 Apr 2023 02:35:31 +0000 (11:35 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 23 Jun 2023 20:00:40 +0000 (15:00 -0500)
commit62d48ec7ef87d65723e3efcbfa6178cf2f7d8156
tree437e551f50af3e7c2c0671c09294f94bcb207595
parent349d5c840a5d2608bc910261a176a6bd355fcc73
PCI: epf-test: Simplify read/write/copy test functions

The function pci_epf_test_cmd_handler() uses the register BAR address as a
pointer to a struct pci_epf_test_reg to determine the command sent by the
host and to execute the test function accordingly. There is no need for
doing this assignment again in each of the read, write and copy test
functions. We can simply pass the reg pointer as an argument to the
functions pci_epf_test_write(), pci_epf_test_read() and
pci_epf_test_copy().

Link: https://lore.kernel.org/r/20230415023542.77601-7-dlemoal@kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lpieralisi@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
drivers/pci/endpoint/functions/pci-epf-test.c