aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWen Yang <[email protected]>2019-02-11 17:04:00 +0800
committerLorenzo Pieralisi <[email protected]>2019-02-13 09:50:58 +0000
commit726dabfde6aa35a4f1508e235ae37edbbf9fbc65 (patch)
treebb3b882724ead67f86f37de53f39a25a790532f5
parentbfeffd155283772bbe78c6a05dec7c0128ee500c (diff)
PCI: endpoint: functions: Use memcpy_fromio()/memcpy_toio()
Functions copying from/to IO addresses should use the memcpy_fromio()/memcpy_toio() API rather than plain memcpy(). Fix the issue detected through the sparse tool. Fixes: 349e7a85b25f ("PCI: endpoint: functions: Add an EP function to test PCI") Suggested-by: Kishon Vijay Abraham I <[email protected]> Signed-off-by: Wen Yang <[email protected]> [[email protected]: updated log] Signed-off-by: Lorenzo Pieralisi <[email protected]> Acked-by: Kishon Vijay Abraham I <[email protected]> CC: Lorenzo Pieralisi <[email protected]> CC: Bjorn Helgaas <[email protected]> CC: Gustavo Pimentel <[email protected]> CC: Niklas Cassel <[email protected]> CC: Greg Kroah-Hartman <[email protected]> CC: Cyrille Pitchen <[email protected]> CC: [email protected] CC: [email protected]
-rw-r--r--drivers/pci/endpoint/functions/pci-epf-test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index 3e86fa3c7da3..4bbd26e8a9e2 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -175,7 +175,7 @@ static int pci_epf_test_read(struct pci_epf_test *epf_test)
goto err_map_addr;
}
- memcpy(buf, src_addr, reg->size);
+ memcpy_fromio(buf, src_addr, reg->size);
crc32 = crc32_le(~0, buf, reg->size);
if (crc32 != reg->checksum)
@@ -230,7 +230,7 @@ static int pci_epf_test_write(struct pci_epf_test *epf_test)
get_random_bytes(buf, reg->size);
reg->checksum = crc32_le(~0, buf, reg->size);
- memcpy(dst_addr, buf, reg->size);
+ memcpy_toio(dst_addr, buf, reg->size);
/*
* wait 1ms inorder for the write to complete. Without this delay L3