aboutsummaryrefslogtreecommitdiff
path: root/libflash
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2019-10-03 15:23:36 +0930
committerOliver O'Halloran <oohall@gmail.com>2019-10-14 16:27:10 +1100
commit5c935e78f335597f502e1fda1911ca50bbeed561 (patch)
tree3f185b965244edcf84a7048a40cc352d89639bb3 /libflash
parent8f204c12ebc07111c99d2059e1df0b86d7a203ae (diff)
downloadskiboot-5c935e78f335597f502e1fda1911ca50bbeed561.zip
skiboot-5c935e78f335597f502e1fda1911ca50bbeed561.tar.gz
skiboot-5c935e78f335597f502e1fda1911ca50bbeed561.tar.bz2
blocklevel: smart_write: Rename write buffer
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>
Diffstat (limited to 'libflash')
-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;
}