]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
boot: Rename fit_image_get_data_and_size()
authorSimon Glass <sjg@chromium.org>
Sat, 11 Jan 2025 00:00:13 +0000 (17:00 -0700)
committerTom Rini <trini@konsulko.com>
Wed, 22 Jan 2025 21:58:04 +0000 (15:58 -0600)
This function is really just getting the data. The size comes along for
the ride. In fact this function is only reliable way to obtain the data
for an image in a FIT, since the FIT may use external data.

Rename it to fit_image_get_data()

Signed-off-by: Simon Glass <sjg@chromium.org>
boot/image-board.c
boot/image-fit.c
cmd/ximg.c
include/image.h
tools/fit_image.c

index b726bd6b30358a4c676c35a18bd18032027c26f3..458153b40bdd34c4d0a4a791ea0c8a701ec2937d 100644 (file)
@@ -1083,8 +1083,8 @@ fallback:
                        }
 
                        /* get script subimage data address and length */
-                       if (fit_image_get_data_and_size(fit_hdr, noffset,
-                                                       &fit_data, &fit_len)) {
+                       if (fit_image_get_data(fit_hdr, noffset, &fit_data,
+                                              &fit_len)) {
                                puts("Could not find script subimage data\n");
                                return 1;
                        }
index 7ad6e51d8edbd42c54f551246f4643735e35b103..70080d1a6c07453dd6384f5b9ea8354da6d20998 100644 (file)
@@ -509,7 +509,7 @@ void fit_image_print(const void *fit, int image_noffset, const char *p)
        fit_image_get_comp(fit, image_noffset, &comp);
        printf("%s  Compression:  %s\n", p, genimg_get_comp_name(comp));
 
-       ret = fit_image_get_data_and_size(fit, image_noffset, &data, &size);
+       ret = fit_image_get_data(fit, image_noffset, &data, &size);
 
        if (!tools_build()) {
                printf("%s  Data Start:   ", p);
@@ -1031,14 +1031,14 @@ int fit_image_get_data_size_unciphered(const void *fit, int noffset,
 }
 
 /**
- * fit_image_get_data_and_size - get data and its size including
+ * fit_image_get_data - get data and its size including
  *                              both embedded and external data
  * @fit: pointer to the FIT format image header
  * @noffset: component image node offset
  * @data: double pointer to void, will hold data property's data address
  * @size: pointer to size_t, will hold data property's data size
  *
- * fit_image_get_data_and_size() finds data and its size including
+ * fit_image_get_data() finds data and its size including
  * both embedded and external data. If the property is found
  * its data start address and size are returned to the caller.
  *
@@ -1046,8 +1046,8 @@ int fit_image_get_data_size_unciphered(const void *fit, int noffset,
  *     0, on success
  *     otherwise, on failure
  */
-int fit_image_get_data_and_size(const void *fit, int noffset,
-                               const void **data, size_t *size)
+int fit_image_get_data(const void *fit, int noffset, const void **data,
+                      size_t *size)
 {
        bool external_data = false;
        int offset;
@@ -1432,7 +1432,7 @@ int fit_image_verify(const void *fit, int image_noffset)
                goto err;
        }
        /* Get image data and data length */
-       if (fit_image_get_data_and_size(fit, image_noffset, &data, &size)) {
+       if (fit_image_get_data(fit, image_noffset, &data, &size)) {
                err_msg = "Can't get image data/size";
                goto err;
        }
@@ -1781,8 +1781,7 @@ int fit_conf_find_compat(const void *fit, const void *fdt)
                        }
 
                        /* search in this config's kernel FDT */
-                       if (fit_image_get_data_and_size(fit, kfdt_noffset,
-                                                       &fdt, &sz)) {
+                       if (fit_image_get_data(fit, kfdt_noffset, &fdt, &sz)) {
                                debug("Failed to get fdt \"%s\".\n", kfdt_name);
                                continue;
                        }
@@ -1941,7 +1940,7 @@ static int fit_get_data_tail(const void *fit, int noffset,
        if (!fit_image_verify(fit, noffset))
                return -EINVAL;
 
-       if (fit_image_get_data_and_size(fit, noffset, data, size))
+       if (fit_image_get_data(fit, noffset, data, size))
                return -ENOENT;
 
        if (!fit_get_desc(fit, noffset, &desc))
@@ -2198,8 +2197,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr,
        bootstage_mark(bootstage_id + BOOTSTAGE_SUB_CHECK_ALL_OK);
 
        /* get image data address and length */
-       if (fit_image_get_data_and_size(fit, noffset,
-                                       (const void **)&buf, &size)) {
+       if (fit_image_get_data(fit, noffset, (const void **)&buf, &size)) {
                printf("Could not find %s subimage data!\n", prop_name);
                bootstage_error(bootstage_id + BOOTSTAGE_SUB_GET_DATA);
                return -ENOENT;
index 1c96f5a0a1f680a9d7b98a039287a19ba48be2a6..29d7c3279b39a8df8f53d705ce2f9647b1ba98ef 100644 (file)
@@ -161,8 +161,7 @@ do_imgextract(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
                }
 
                /* get subimage/external data address and length */
-               if (fit_image_get_data_and_size(fit_hdr, noffset,
-                                              &fit_data, &fit_len)) {
+               if (fit_image_get_data(fit_hdr, noffset, &fit_data, &fit_len)) {
                        puts("Could not find script subimage data\n");
                        return 1;
                }
index e54e2190af5cf329f36d27c748ca5008ca6a8365..50c44118ebc6c040871c6b5cb72593e27c3d4e1f 100644 (file)
@@ -1168,8 +1168,8 @@ int fit_image_get_data_position(const void *fit, int noffset,
 int fit_image_get_data_size(const void *fit, int noffset, int *data_size);
 int fit_image_get_data_size_unciphered(const void *fit, int noffset,
                                       size_t *data_size);
-int fit_image_get_data_and_size(const void *fit, int noffset,
-                               const void **data, size_t *size);
+int fit_image_get_data(const void *fit, int noffset, const void **data,
+                      size_t *size);
 
 /**
  * fit_image_get_phase() - Get the phase from a FIT image
index 0fccfbb4ebda47f6a43f21b6a4e4064797597d13..caed8d5f9019e5cd78e9239d085f68f91d0e16e5 100644 (file)
@@ -876,7 +876,7 @@ static int fit_image_extract(
        int ret;
 
        /* get the data address and size of component at offset "image_noffset" */
-       ret = fit_image_get_data_and_size(fit, image_noffset, &file_data, &file_size);
+       ret = fit_image_get_data(fit, image_noffset, &file_data, &file_size);
        if (ret) {
                fprintf(stderr, "Could not get component information\n");
                return ret;