PCI: epf-test: Simplify transfers result print
authorDamien Le Moal <dlemoal@kernel.org>
Sat, 15 Apr 2023 02:35:38 +0000 (11:35 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 23 Jun 2023 20:03:10 +0000 (15:03 -0500)
commit1754dfd2e7931f60d199a9cb044991ab80cdfe0b
treec4f38f1530d2b33c65a92d7a23233d3811cecdf0
parent2566cbea69ab8dad4996ab4b4840fd952e62e5b4
PCI: epf-test: Simplify transfers result print

In pci_epf_test_print_rate(), instead of open coding a reduction loop to
allow for a division by a 32-bits ns value, simply use div64_u64() to
calculate the transfer rate. To match the printed unit of KB/s, this
calculation divides the rate by 1000 instead of 1024 (that would be KiB/s
unit).

Change the format of the results printed by pci_epf_test_print_rate() to be
more compact without the double new line. Also use dev_info() instead of
pr_info().

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