summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2024-08-22 07:55:02 -0600
committerTom Rini <[email protected]>2024-08-23 15:58:42 -0600
commit3fd11278ff43a5039e33a8cf04dc822711ea9694 (patch)
tree62818649b8a5605cefe4795c0fb4a24b8a087e39 /test
parent50a1ed4335045c57d9073a3fcd265edd89da924a (diff)
spl: Create a function to init spl_load_info
Rather than having every caller set this up individually, create a common init function. This allows new fields to be added without the risk of them being left uninited. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Michael Trimarchi <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/image/spl_load.c4
-rw-r--r--test/image/spl_load_os.c1
2 files changed, 2 insertions, 3 deletions
diff --git a/test/image/spl_load.c b/test/image/spl_load.c
index 7cbad40ea0c..3b6206955d3 100644
--- a/test/image/spl_load.c
+++ b/test/image/spl_load.c
@@ -343,9 +343,7 @@ static int spl_test_image(struct unit_test_state *uts, const char *test_name,
} else {
struct spl_load_info load;
- spl_set_bl_len(&load, 1);
- load.priv = img;
- load.read = spl_test_read;
+ spl_load_init(&load, spl_test_read, img, 1);
if (type == IMX8)
ut_assertok(spl_load_imx_container(&info_read, &load,
0));
diff --git a/test/image/spl_load_os.c b/test/image/spl_load_os.c
index 56105a59236..d17cf116a0e 100644
--- a/test/image/spl_load_os.c
+++ b/test/image/spl_load_os.c
@@ -20,3 +20,4 @@ static int spl_test_load(struct unit_test_state *uts)
return 0;
}
SPL_TEST(spl_test_load, 0);
+