diff options
author | Simon Glass <sjg@chromium.org> | 2023-12-27 13:07:00 -0800 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2023-12-31 07:21:02 -0700 |
commit | 1a2e02f955f98395142415d7c6cc14e4df903969 (patch) | |
tree | 59f3057b5cede46f4dcccf2fa9ecdcea6facf032 /test | |
parent | e748e4b780057872b4a7192db87476adaa8b501c (diff) |
bloblist: Adjust API to align in powers of 2
The updated bloblist structure stores the alignment as a power-of-two
value in its structures. Adjust the API to use this, to avoid needing to
calling ilog2().
Update the bloblist alignment from 16 bytes to 8 bytes.
Drop a stale comment while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Co-developed-by: Raymond Mao <raymond.mao@linaro.org>
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/bloblist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/bloblist.c b/test/bloblist.c index efa1e32afd7..8b435e27ca3 100644 --- a/test/bloblist.c +++ b/test/bloblist.c @@ -336,7 +336,7 @@ static int bloblist_test_align(struct unit_test_state *uts) /* Check larger alignment */ for (i = 0; i < 3; i++) { - int align = 32 << i; + int align = 5 - i; data = bloblist_add(3 + i, i * 4, align); ut_assertnonnull(data); @@ -351,7 +351,7 @@ static int bloblist_test_align(struct unit_test_state *uts) ut_assertok(bloblist_new(TEST_ADDR + BLOBLIST_ALIGN, TEST_BLOBLIST_SIZE, 0)); - data = bloblist_add(1, 5, BLOBLIST_ALIGN * 2); + data = bloblist_add(1, 5, BLOBLIST_ALIGN_LOG2 + 1); ut_assertnonnull(data); addr = map_to_sysmem(data); ut_asserteq(0, addr & (BLOBLIST_ALIGN * 2 - 1)); |