global: Migrate CONFIG_STACKBASE to CFG
[platform/kernel/u-boot.git] / include / image.h
index 65d0d4f..b6a8098 100644 (file)
@@ -229,6 +229,7 @@ enum image_type_t {
        IH_TYPE_COPRO,                  /* Coprocessor Image for remoteproc*/
        IH_TYPE_SUNXI_EGON,             /* Allwinner eGON Boot Image */
        IH_TYPE_SUNXI_TOC0,             /* Allwinner TOC0 Boot Image */
+       IH_TYPE_FDT_LEGACY,             /* Binary Flat Device Tree Blob in a Legacy Image */
 
        IH_TYPE_COUNT,                  /* Number of image types */
 };
@@ -853,7 +854,13 @@ image_set_hdr_b(comp)              /* image_set_comp */
 
 static inline void image_set_name(struct legacy_img_hdr *hdr, const char *name)
 {
-       strncpy(image_get_name(hdr), name, IH_NMLEN);
+       /*
+        * This is equivalent to: strncpy(image_get_name(hdr), name, IH_NMLEN);
+        *
+        * Use the tortured code below to avoid a warning with gcc 12. We do not
+        * want to include a nul terminator if the name is of length IH_NMLEN
+        */
+       memcpy(image_get_name(hdr), name, strnlen(name, IH_NMLEN));
 }
 
 int image_check_hcrc(const struct legacy_img_hdr *hdr);