From 9e5a27f745a015408e7c15a8b37f560656fdd773 Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Fri, 20 Feb 2015 11:37:46 +1100 Subject: libffs: Add comment for to clarify endian requirments In some parts of libffs we access struct ffs_entry with endian access and in other parts we don't. This adds a comment to clarify why we do this. Signed-off-by: Michael Neuling Signed-off-by: Stewart Smith --- libflash/libffs.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libflash') diff --git a/libflash/libffs.c b/libflash/libffs.c index ef2aa4d..abb9775 100644 --- a/libflash/libffs.c +++ b/libflash/libffs.c @@ -267,6 +267,10 @@ int ffs_update_act_size(struct ffs_handle *ffs, uint32_t part_idx, FL_DBG("FFS: part index %d at offset 0x%08x\n", part_idx, offset); + /* + * NOTE: We are accessing the unconverted ffs_entry from the PNOR here + * (since we are going to write it back) so we need to be endian safe. + */ if (ent->actual == cpu_to_be32(act_size)) { FL_DBG("FFS: ent->actual alrady matches: 0x%08x==0x%08x\n", cpu_to_be32(act_size), ent->actual); -- cgit v1.1