flash: Rename copy_flash to flash_copy

Change-Id: If449889fca3370e25a65719d2f5c5ec90258d633
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/flash.c b/flash.c
index c446658..4975efb 100644
--- a/flash.c
+++ b/flash.c
@@ -219,16 +219,16 @@
 #define CHUNKSIZE (64 * 1024)
 
 /*
- * copy_flash() - Copy data from the flash device into a provided buffer
+ * flash_copy() - Copy data from the flash device into a provided buffer
  * @context:	The mbox context pointer
  * @offset:	The flash offset to copy from (bytes)
  * @mem:	The buffer to copy into (must be of atleast 'size' bytes)
  * @size:	The number of bytes to copy
  * Return:	Number of bytes copied on success, otherwise negative error
- *		code. copy_flash will copy at most 'size' bytes, but it may
+ *		code. flash_copy will copy at most 'size' bytes, but it may
  *		copy less.
  */
-int64_t copy_flash(struct mbox_context *context, uint32_t offset, void *mem,
+int64_t flash_copy(struct mbox_context *context, uint32_t offset, void *mem,
 		   uint32_t size)
 {
 	int32_t size_read;
diff --git a/flash.h b/flash.h
index a53e76e..dcc8288 100644
--- a/flash.h
+++ b/flash.h
@@ -11,7 +11,7 @@
 
 int flash_dev_init(struct mbox_context *context);
 void flash_dev_free(struct mbox_context *context);
-int64_t copy_flash(struct mbox_context *context, uint32_t offset, void *mem,
+int64_t flash_copy(struct mbox_context *context, uint32_t offset, void *mem,
 		   uint32_t size);
 int set_flash_bytemap(struct mbox_context *context, uint32_t offset,
 		      uint32_t count, uint8_t val);
diff --git a/mboxd_windows.c b/mboxd_windows.c
index 200b205..ed87df1 100644
--- a/mboxd_windows.c
+++ b/mboxd_windows.c
@@ -191,7 +191,7 @@
 			MSG_ERR("Unable to allocate memory\n");
 			return -MBOX_R_SYSTEM_ERROR;
 		}
-		rc = copy_flash(context, low_mem.flash_offset,
+		rc = flash_copy(context, low_mem.flash_offset,
 				low_mem.mem, low_mem.size);
 		if (rc < 0) {
 			goto out;
@@ -206,7 +206,7 @@
 			rc = -MBOX_R_SYSTEM_ERROR;
 			goto out;
 		}
-		rc = copy_flash(context, high_mem.flash_offset,
+		rc = flash_copy(context, high_mem.flash_offset,
 				high_mem.mem, high_mem.size);
 		if (rc < 0) {
 			goto out;
@@ -619,7 +619,7 @@
 	}
 
 	/* Copy from flash into the window buffer */
-	rc = copy_flash(context, offset, cur->mem, cur->size);
+	rc = flash_copy(context, offset, cur->mem, cur->size);
 	if (rc < 0) {
 		/* We don't know how much we've copied -> better reset window */
 		reset_window(context, cur);
diff --git a/test/Makefile.am.include b/test/Makefile.am.include
index 760dbdd..55746a5 100644
--- a/test/Makefile.am.include
+++ b/test/Makefile.am.include
@@ -1,7 +1,7 @@
 test_sanity_SOURCES = %reldir%/sanity.c
 
-test_copy_flash_SOURCES = \
-	%reldir%/copy_flash.c \
+test_flash_copy_SOURCES = \
+	%reldir%/flash_copy.c \
 	flash.c \
 	common.c mtd.c \
 	%reldir%/tmpf.c
@@ -99,7 +99,7 @@
 
 check_PROGRAMS += \
 		%reldir%/sanity \
-		%reldir%/copy_flash \
+		%reldir%/flash_copy \
 		%reldir%/erase_flash \
 		%reldir%/write_flash \
 		%reldir%/get_mbox_info_v2 \
diff --git a/test/copy_flash.c b/test/flash_copy.c
similarity index 96%
rename from test/copy_flash.c
rename to test/flash_copy.c
index d6632d2..565bb0c 100644
--- a/test/copy_flash.c
+++ b/test/flash_copy.c
@@ -68,7 +68,7 @@
 
 	context.fds[MTD_FD].fd = tmp.fd;
 
-	copy_flash(&context, 0, dst, TEST_SIZE);
+	flash_copy(&context, 0, dst, TEST_SIZE);
 	assert(0 == memcmp(src, dst, TEST_SIZE));
 
 free:
diff --git a/vpnor/flash.cpp b/vpnor/flash.cpp
index b2e0134..e18f3b8 100644
--- a/vpnor/flash.cpp
+++ b/vpnor/flash.cpp
@@ -108,16 +108,16 @@
 }
 
 /*
- * copy_flash() - Copy data from the virtual pnor into a provided buffer
+ * flash_copy() - Copy data from the virtual pnor into a provided buffer
  * @context:    The mbox context pointer
  * @offset:     The pnor offset to copy from (bytes)
  * @mem:        The buffer to copy into (must be of atleast 'size' bytes)
  * @size:       The number of bytes to copy
  * Return:      Number of bytes copied on success, otherwise negative error
- *              code. copy_flash will copy at most 'size' bytes, but it may
+ *              code. flash_copy will copy at most 'size' bytes, but it may
  *              copy less.
  */
-int64_t copy_flash(struct mbox_context* context, uint32_t offset, void* mem,
+int64_t flash_copy(struct mbox_context* context, uint32_t offset, void* mem,
                    uint32_t size)
 {
     vpnor::partition::Table* table;
diff --git a/vpnor/mboxd_pnor_partition_table.cpp b/vpnor/mboxd_pnor_partition_table.cpp
index 228ae5b..bc78609 100644
--- a/vpnor/mboxd_pnor_partition_table.cpp
+++ b/vpnor/mboxd_pnor_partition_table.cpp
@@ -102,14 +102,14 @@
         size_t tocOffset = 0;
 
         // Copy TOC
-        copy_flash(&local, tocOffset,
+        flash_copy(&local, tocOffset,
                    static_cast<uint8_t *>(context->mem) + tocStart,
                    blTable.capacity());
         const pnor_partition &partition = blTable.partition(blPartitionName);
         size_t hbbOffset = partition.data.base * eraseSize;
         uint32_t hbbSize = partition.data.actual;
         // Copy HBB
-        copy_flash(&local, hbbOffset,
+        flash_copy(&local, hbbOffset,
                    static_cast<uint8_t *>(context->mem) + hbbOffset, hbbSize);
     }
     catch (err::InternalFailure &e)