aboutsummaryrefslogtreecommitdiff
path: root/libflash
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2018-03-15 16:58:19 +1100
committerStewart Smith <stewart@linux.ibm.com>2018-04-09 03:45:23 -0500
commit0673f6282422e5cb26f79c986228c863b1ec8a36 (patch)
tree6bc3f3bb1eff022f775c7ca2878baec20834fc91 /libflash
parent91099dacc6c9402b305d40e7bc4068a8cd65da79 (diff)
downloadskiboot-0673f6282422e5cb26f79c986228c863b1ec8a36.zip
skiboot-0673f6282422e5cb26f79c986228c863b1ec8a36.tar.gz
skiboot-0673f6282422e5cb26f79c986228c863b1ec8a36.tar.bz2
libflash/libffs: Always add entries to the end of the TOC
It turns out that sorted order isn't the best idea. This removes flexibility from the caller. If the user wants their partitions in sorted order, they should insert them in sorted order. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'libflash')
-rw-r--r--libflash/libffs.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/libflash/libffs.c b/libflash/libffs.c
index 4f1852f..e115e42 100644
--- a/libflash/libffs.c
+++ b/libflash/libffs.c
@@ -610,25 +610,7 @@ static int __ffs_entry_add(struct ffs_hdr *hdr, struct ffs_entry *entry)
return FFS_ERR_BAD_PART_BASE;
}
- /*
- * A header can't have zero entries. Was asserted.
- */
- list_for_each(&hdr->entries, ent, list)
- if (entry->base < ent->base)
- break;
-
- if (ent == list_top(&hdr->entries, struct ffs_entry, list)) {
- /*
- * This should never happen because the partition entry
- * should ALWAYS be here
- */
- fprintf(stderr, "Warning: replacing first entry in FFS header\n");
- list_add(&hdr->entries, &entry->list);
- } else if (!ent) {
- list_add_tail(&hdr->entries, &entry->list);
- } else {
- list_add_before(&hdr->entries, &entry->list, &ent->list);
- }
+ list_add_tail(&hdr->entries, &entry->list);
return 0;
}