Commit 195f273b6c86 ("tools: mkimage: resolve image-data references
between FIT images") added FIT_DATA_SIZE_UNCIPHERED_PROP but did not
convert the existing code that spells the property name out:
fit_image_get_data_size_unciphered() on the boot side, and in mkimage
fit_image_write_cipher(), which adds the property, and
fit_image_cipher_data(), which checks for it to avoid encrypting the
data twice. Use the constant there as well.

No functional change intended.

Signed-off-by: Aristo Chen <[email protected]>
---
 boot/image-fit.c   | 2 +-
 tools/image-host.c | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/boot/image-fit.c b/boot/image-fit.c
index e173108033b..cf435329e44 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -1044,7 +1044,7 @@ int fit_image_get_data_size_unciphered(const void *fit, 
int noffset,
        const fdt32_t *val;
        int len;
 
-       val = fdt_getprop(fit, noffset, "data-size-unciphered", &len);
+       val = fdt_getprop(fit, noffset, FIT_DATA_SIZE_UNCIPHERED_PROP, &len);
        if (!val)
                return -ENOENT;
 
diff --git a/tools/image-host.c b/tools/image-host.c
index 7718d8f678a..4774c1743c5 100644
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -529,7 +529,8 @@ int fit_image_write_cipher(void *fit, int image_noffset, 
int noffset,
        }
 
        /* add non ciphered data size */
-       ret = fdt_setprop_u32(fit, image_noffset, "data-size-unciphered", size);
+       ret = fdt_setprop_u32(fit, image_noffset,
+                             FIT_DATA_SIZE_UNCIPHERED_PROP, size);
        if (ret == -FDT_ERR_NOSPACE) {
                ret = -ENOSPC;
                goto out;
@@ -623,7 +624,8 @@ int fit_image_cipher_data(const char *keydir, void *keydest,
         * image is already encrypted. This is important as 'mkimage -F' can be
         * run multiple times on a FIT image.
         */
-       if (fdt_getprop(fit, image_noffset, "data-size-unciphered", &len))
+       if (fdt_getprop(fit, image_noffset,
+                       FIT_DATA_SIZE_UNCIPHERED_PROP, &len))
                return 0;
        if (len != -FDT_ERR_NOTFOUND) {
                fprintf(stderr, "Failure testing for data-size-unciphered\n");
-- 
2.43.0

Reply via email to