aboutsummaryrefslogtreecommitdiff
path: root/libflash/libffs.h
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2017-07-28 16:46:24 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-08-01 13:57:19 +1000
commit7e89bd30e88e838f6602c2a392fa8b2738287541 (patch)
treef4f0f3495ee1969e0c278724f81ef0a3452d7bf0 /libflash/libffs.h
parent523c6ed0f8aaca23cc733e26ff8445ce9bd2b7a9 (diff)
downloadskiboot-7e89bd30e88e838f6602c2a392fa8b2738287541.zip
skiboot-7e89bd30e88e838f6602c2a392fa8b2738287541.tar.gz
skiboot-7e89bd30e88e838f6602c2a392fa8b2738287541.tar.bz2
libflash/libffs: Don't require 'part' size to be known by callers
Currently the FFS header/TOC generation code requires that consumers know the size of their TOC beforehand. While this may be advantageous in some circumstances if there are known limitations of other software. It should not be a requirement. Knowing the size of the FFS header/TOC partially breaks the abstraction since it would require consumers of the library to be aware of/have some idea of the on flash structure and size. Future work may introduce functions to force sizes but the default behaviour should be to calculate it behind the scenes. This patch also addresses an off by one issue in checking for TOC overflow. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash/libffs.h')
-rw-r--r--libflash/libffs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libflash/libffs.h b/libflash/libffs.h
index a86c698..a0f65a0 100644
--- a/libflash/libffs.h
+++ b/libflash/libffs.h
@@ -133,7 +133,7 @@ struct ffs_entry *ffs_entry_get(struct ffs_handle *ffs, uint32_t index);
int ffs_update_act_size(struct ffs_handle *ffs, uint32_t part_idx,
uint32_t act_size);
-int ffs_hdr_new(uint32_t size, uint32_t block_size, uint32_t block_count,
+int ffs_hdr_new(uint32_t block_size, uint32_t block_count,
struct ffs_hdr **r);
int ffs_hdr_add_side(struct ffs_hdr *hdr);