Commit 634dcda25924 ("boot/fit: use constants for property strings")
switched boot/common_fit.c and boot/image-fit.c to the property name
constants in include/image.h, but a few literals are left in boot/:
- fdt_offset() in boot_fit.c reads "data-offset" and "data-size" from
the FDT image node; use FIT_DATA_OFFSET_PROP and FIT_DATA_SIZE_PROP.
- boot_get_fpga() reads the "compatible" property of the FPGA image
node. Commit 3059eb0c27dd ("boot/fit: declare (and use) new constant
for conf's compatible prop") added FIT_COMPAT_PROP and noted that FPGA
image nodes carry the same property; use it there too.
- fit_image_load_storage() looks up the dm-verity subnode by a literal
name; use FIT_VERITY_NODENAME like the rest of the dm-verity code.
No functional change.
Signed-off-by: Aristo Chen <[email protected]>
Reviewed-by: Quentin Schulz <[email protected]>
---
v2: no code changes, collected Reviewed-by
boot/boot_fit.c | 4 ++--
boot/image-board.c | 3 ++-
boot/image-fit.c | 3 ++-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/boot/boot_fit.c b/boot/boot_fit.c
index 4dcaf95c6ae..aa867fe823f 100644
--- a/boot/boot_fit.c
+++ b/boot/boot_fit.c
@@ -41,12 +41,12 @@ static int fdt_offset(const void *fit)
return -EINVAL;
}
- fdt_offset = fdt_getprop_u32(fit, fdt_node, "data-offset");
+ fdt_offset = fdt_getprop_u32(fit, fdt_node, FIT_DATA_OFFSET_PROP);
if (fdt_offset == FDT_ERROR)
return -ENOENT;
- fdt_len = fdt_getprop_u32(fit, fdt_node, "data-size");
+ fdt_len = fdt_getprop_u32(fit, fdt_node, FIT_DATA_SIZE_PROP);
if (fdt_len < 0)
return fdt_len;
diff --git a/boot/image-board.c b/boot/image-board.c
index 67938fdd200..7602f5bfaaa 100644
--- a/boot/image-board.c
+++ b/boot/image-board.c
@@ -685,7 +685,8 @@ int boot_get_fpga(struct bootm_headers *images)
}
conf_noffset = fit_image_get_node(buf, uname);
- compatible = fdt_getprop(buf, conf_noffset, "compatible", NULL);
+ compatible = fdt_getprop(buf, conf_noffset, FIT_COMPAT_PROP,
+ NULL);
if (!compatible) {
printf("'fpga' image without 'compatible' property\n");
} else {
diff --git a/boot/image-fit.c b/boot/image-fit.c
index 60e47db5fb0..e173108033b 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -2196,7 +2196,8 @@ static int fit_image_load_storage(struct bootm_headers
*images, const void *fit,
if (!fit_image_get_type(fit, noffset, &img_type) &&
img_type == IH_TYPE_FILESYSTEM &&
- fdt_subnode_offset(fit, noffset, "dm-verity") >= 0) {
+ fdt_subnode_offset(fit, noffset,
+ FIT_VERITY_NODENAME) >= 0) {
fit_image_print(fit, noffset, " ");
*datap = 0;
*lenp = 0;
--
2.43.0