aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2019-10-03 15:23:36 +0930
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2019-10-23 14:31:38 +0530
commited7da687362a8f95d238710124f53273841649a0 (patch)
treed0702ddf8e6f18cad98d55abb3d8cb33bff46d48
parentcb24f924b4d886847a190601c6542af93f7c4f3e (diff)
downloadskiboot-ed7da687362a8f95d238710124f53273841649a0.zip
skiboot-ed7da687362a8f95d238710124f53273841649a0.tar.gz
skiboot-ed7da687362a8f95d238710124f53273841649a0.tar.bz2
blocklevel: smart_write: Rename write buffer
[ Upstream commit 5c935e78f335597f502e1fda1911ca50bbeed561 ] The buffer is only used for ECC protected partitions, so lets call it ecc_buf for clarity. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
-rw-r--r--libflash/blocklevel.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libflash/blocklevel.c b/libflash/blocklevel.c
index 91cd425..ae81c2b 100644
--- a/libflash/blocklevel.c
+++ b/libflash/blocklevel.c
@@ -508,7 +508,7 @@ int blocklevel_smart_write(struct blocklevel_device *bl, uint64_t pos, const voi
{
uint32_t erase_size;
const void *write_buf = buf;
- void *write_buf_start = NULL;
+ void *ecc_buf = NULL;
uint64_t ecc_start;
void *erase_buf;
int rc = 0;
@@ -534,18 +534,18 @@ int blocklevel_smart_write(struct blocklevel_device *bl, uint64_t pos, const voi
len = ecc_buffer_size(len);
- write_buf_start = malloc(len);
- if (!write_buf_start) {
+ ecc_buf = malloc(len);
+ if (!ecc_buf) {
errno = ENOMEM;
return FLASH_ERR_MALLOC_FAILED;
}
- if (memcpy_to_ecc(write_buf_start, buf, ecc_buffer_size_minus_ecc(len))) {
- free(write_buf_start);
+ if (memcpy_to_ecc(ecc_buf, buf, ecc_buffer_size_minus_ecc(len))) {
+ free(ecc_buf);
errno = EBADF;
return FLASH_ERR_ECC_INVALID;
}
- write_buf = write_buf_start;
+ write_buf = ecc_buf;
}
erase_buf = malloc(erase_size);
@@ -599,7 +599,7 @@ int blocklevel_smart_write(struct blocklevel_device *bl, uint64_t pos, const voi
out:
release(bl);
out_free:
- free(write_buf_start);
+ free(ecc_buf);
free(erase_buf);
return rc;
}