summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-01-27 12:53:13 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-01-27 15:03:18 +0900
commite9e0d2877fb27b81c6b55b57fad684e3f15c15bf (patch)
tree425b65d648c44d486e07074036991ee82358cff1 /tools
parentea39d557aefe6d8bbd9b08901f2b6f2122e417fe (diff)
fiptool: simplify assert() for add_image(_desc)
lookup_image(_desc)_from_uuid() traverses the linked list, so it is not efficient. We just want to make sure *p points to NULL here. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/fiptool/fiptool.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/fiptool/fiptool.c b/tools/fiptool/fiptool.c
index b79c0d69..7a5c2cd7 100644
--- a/tools/fiptool/fiptool.c
+++ b/tools/fiptool/fiptool.c
@@ -202,11 +202,10 @@ static void add_image_desc(image_desc_t *desc)
{
image_desc_t **p = &image_desc_head;
- assert(lookup_image_desc_from_uuid(&desc->uuid) == NULL);
-
while (*p)
p = &(*p)->next;
+ assert(*p == NULL);
*p = desc;
nr_image_descs++;
}
@@ -244,11 +243,10 @@ static void add_image(image_t *image)
{
image_t **p = &image_head;
- assert(lookup_image_from_uuid(&image->uuid) == NULL);
-
while (*p)
p = &(*p)->next;
+ assert(*p == NULL);
*p = image;
nr_images++;