aboutsummaryrefslogtreecommitdiff
path: root/libflash
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2016-01-12 16:15:38 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-01-12 16:50:49 +1100
commitb7168570fc7e1a04421a3082f841fa43742ce7fd (patch)
tree333d10b4fac4fdd2e87f928b3570526e9ef66fc8 /libflash
parentd67d79a69dd73ee8d01324c4f62707f06e904050 (diff)
downloadskiboot-b7168570fc7e1a04421a3082f841fa43742ce7fd.zip
skiboot-b7168570fc7e1a04421a3082f841fa43742ce7fd.tar.gz
skiboot-b7168570fc7e1a04421a3082f841fa43742ce7fd.tar.bz2
libflash/libffs: Rename ffs_cmp() to ffs_equal()
Some confusion has arisen from the first consumer of ffs_cmp() in that they expected a strcmp style less than one, zero or greater than one return value. This has been addressed in this patch in two ways, by changing the return type to a boolean in order to (attempt) to alert the programmer that this is not the case and by renaming it to equal to avoid the implied comparison and imply very much a boolean outcome. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Sam Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash')
-rw-r--r--libflash/libffs.c2
-rw-r--r--libflash/libffs.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/libflash/libffs.c b/libflash/libffs.c
index 401b4db..cc534e2 100644
--- a/libflash/libffs.c
+++ b/libflash/libffs.c
@@ -282,7 +282,7 @@ int ffs_part_info(struct ffs_handle *ffs, uint32_t part_idx,
* simple, the underlying blocklevel_devices must be the same along with
* the toc_offset and the max_size.
*/
-int ffs_cmp(struct ffs_handle *one, struct ffs_handle *two)
+bool ffs_equal(struct ffs_handle *one, struct ffs_handle *two)
{
return (!one && !two) || (one && two && one->bl == two->bl
&& one->toc_offset == two->toc_offset
diff --git a/libflash/libffs.h b/libflash/libffs.h
index 0d0d5f5..a9ff574 100644
--- a/libflash/libffs.h
+++ b/libflash/libffs.h
@@ -58,7 +58,7 @@ int ffs_next_side(struct ffs_handle *ffs, struct ffs_handle **new_ffs,
* simple, the underlying blocklevel_devices must be the same along with
* the toc_offset and the max_size.
*/
-int ffs_cmp(struct ffs_handle *one, struct ffs_handle *two);
+bool ffs_equal(struct ffs_handle *one, struct ffs_handle *two);
void ffs_close(struct ffs_handle *ffs);