summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2015-06-23 13:22:08 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-06-23 13:38:42 +1000
commit69b152cab30aae6188b590b2df9a6f55932c4408 (patch)
tree3f8f375a5d80131dd4c0a1955b25a3e6b669d8d0 /core
parent6c458a0369494a7f0ae2e6352850502c5e393f8f (diff)
downloadtalos-skiboot-69b152cab30aae6188b590b2df9a6f55932c4408.tar.gz
talos-skiboot-69b152cab30aae6188b590b2df9a6f55932c4408.zip
libflash/ecc: Simplify and cleanup ecc code.
The ecc 'memcpy' style functions return success or fail in terms of the ECC enum. This doesn't really make sense, use true or false. As the result the ecc enum doesn't need to be exposed anymore, which makes more sense, not clear why it was exposed in the first place. Convert some of the ecc #defines to static inlines, shouldn't make any difference but feels safer. Fix minor stylistic and typo issues. Reviewed-By: Alistair Popple <alistair@popple.id.au> Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/flash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/flash.c b/core/flash.c
index bea51605..b9c739d0 100644
--- a/core/flash.c
+++ b/core/flash.c
@@ -418,7 +418,7 @@ static int flash_find_subpartition(struct blocklevel_device *bl, uint32_t subid,
/* Get raw partition size without ECC */
partsize = *total_size;
if (ecc)
- partsize = BUFFER_SIZE_MINUS_ECC(*total_size);
+ partsize = ecc_buffer_size_minus_ecc(*total_size);
/* Get the TOC */
rc = flash_read_corrected(bl, *start, header,
@@ -483,8 +483,8 @@ static int flash_find_subpartition(struct blocklevel_device *bl, uint32_t subid,
*start += offset;
*total_size = size;
if (ecc) {
- *start += ECC_SIZE(offset);
- *total_size += ECC_SIZE(size);
+ *start += ecc_size(offset);
+ *total_size += ecc_size(size);
}
rc = 0;
goto end;
@@ -577,12 +577,12 @@ static int flash_load_resource(enum resource_id id, uint32_t subid,
/* Work out what the final size of buffer will be without ECC */
size = part_size;
if (ecc) {
- if ECC_BUFFER_SIZE_CHECK(part_size) {
+ if (ecc_buffer_size_check(part_size)) {
prerror("FLASH: %s image invalid size for ECC %d\n",
name, part_size);
goto out_free_ffs;
}
- size = BUFFER_SIZE_MINUS_ECC(part_size);
+ size = ecc_buffer_size_minus_ecc(part_size);
}
if (size > *len) {
OpenPOWER on IntegriCloud