diff mbox

[03/16] libffs: Add comment for to clarify endian requirments

Message ID 1424392679-27859-3-git-send-email-mikey@neuling.org
State Accepted
Headers show

Commit Message

Michael Neuling Feb. 20, 2015, 12:37 a.m. UTC
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 <mikey@neuling.org>
---
 libflash/libffs.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

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);