PCI: epf-test: Cleanup pci_epf_test_cmd_handler()
authorDamien Le Moal <dlemoal@kernel.org>
Sat, 15 Apr 2023 02:35:35 +0000 (11:35 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 23 Jun 2023 20:02:39 +0000 (15:02 -0500)
commit96d513f5ed4cafafa31ed99f74ad527f6b0ff47b
tree5b398ab96d50d922550a366bdb65e4d42d41829f
parentfc97f5f7c23735da0c7314533203306d96a038fb
PCI: epf-test: Cleanup pci_epf_test_cmd_handler()

Command codes are never combined together as flags into a single value.
Thus we can replace the series of "if" tests in pci_epf_test_cmd_handler()
with a cleaner switch-case statement.  This also allows checking that we
got a valid command and print an error message if we did not.

Link: https://lore.kernel.org/r/20230415023542.77601-11-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