aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRaymond Mao <raymond.mao@linaro.org>2024-02-03 08:36:22 -0800
committerTom Rini <trini@konsulko.com>2024-02-29 09:24:22 -0500
commit1ef43f3bf20a4a9508c299a738d01faa3dc3ce95 (patch)
treef433886d55930ffe50ed879f8bb3f60dc4ef9884 /test
parent67254214930cd2cb52279b01690c1f820a7f83db (diff)
downloadu-boot-1ef43f3bf20a4a9508c299a738d01faa3dc3ce95.zip
u-boot-1ef43f3bf20a4a9508c299a738d01faa3dc3ce95.tar.gz
u-boot-1ef43f3bf20a4a9508c299a738d01faa3dc3ce95.tar.bz2
bloblist: refactor of bloblist_reloc()
The current bloblist pointer and size can be retrieved from global data, so we don't need to pass them from the function arguments. This change also help to remove all external access of gd->bloblist outside of bloblist module. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'test')
-rw-r--r--test/bloblist.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/bloblist.c b/test/bloblist.c
index 7dab9ad..1c60bba 100644
--- a/test/bloblist.c
+++ b/test/bloblist.c
@@ -376,13 +376,12 @@ static int bloblist_test_reloc(struct unit_test_state *uts)
{
const uint large_size = TEST_BLOBLIST_SIZE;
const uint small_size = 0x20;
- void *old_ptr, *new_ptr;
+ void *new_ptr;
void *blob1, *blob2;
ulong new_addr;
ulong new_size;
ut_assertok(bloblist_new(TEST_ADDR, TEST_BLOBLIST_SIZE, 0, 0));
- old_ptr = map_sysmem(TEST_ADDR, TEST_BLOBLIST_SIZE);
/* Add one blob and then one that won't fit */
blob1 = bloblist_add(TEST_TAG, small_size, 0);
@@ -394,8 +393,7 @@ static int bloblist_test_reloc(struct unit_test_state *uts)
new_addr = TEST_ADDR + TEST_BLOBLIST_SIZE;
new_size = TEST_BLOBLIST_SIZE + 0x100;
new_ptr = map_sysmem(new_addr, TEST_BLOBLIST_SIZE);
- bloblist_reloc(new_ptr, new_size, old_ptr, TEST_BLOBLIST_SIZE);
- gd->bloblist = new_ptr;
+ ut_assertok(bloblist_reloc(new_ptr, new_size));
/* Check the old blob is there and that we can now add the bigger one */
ut_assertnonnull(bloblist_find(TEST_TAG, small_size));