scripts/dtc: Update to upstream version v1.6.1-66-gabbd523bae6e
authorRob Herring <robh@kernel.org>
Fri, 3 Feb 2023 15:13:46 +0000 (09:13 -0600)
committerRob Herring <robh@kernel.org>
Mon, 6 Feb 2023 17:03:00 +0000 (11:03 -0600)
This adds the following commits from upstream:

abbd523bae6e pylibfdt: Work-around SWIG limitations with flexible arrays
a41509bea3e7 libfdt: Replace deprecated 0-length arrays with proper flexible arrays
2cd89f862cdb dtc: Warning rather than error on possible truncation of cell values

Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/all/20230203172430.474431-1-robh@kernel.org/
Signed-off-by: Rob Herring <robh@kernel.org>
scripts/dtc/dtc-parser.y
scripts/dtc/libfdt/fdt.h
scripts/dtc/version_gen.h

index 46457d4bc0aa51fcc41a3bd40e0271c7b6e5b4fc..bff1337ec2665ae6b627df4d98ad2e43e032cd97 100644 (file)
@@ -404,9 +404,14 @@ arrayprefix:
                                 * within the mask to one (i.e. | in the
                                 * mask), all bits are one.
                                 */
-                               if (($2 > mask) && (($2 | mask) != -1ULL))
-                                       ERROR(&@2, "Value out of range for"
-                                             " %d-bit array element", $1.bits);
+                               if (($2 > mask) && (($2 | mask) != -1ULL)) {
+                                       char *loc = srcpos_string(&@2);
+                                       fprintf(stderr,
+                                               "WARNING: %s: Value 0x%016" PRIx64
+                                               " truncated to 0x%0*" PRIx64 "\n",
+                                               loc, $2, $1.bits / 4, ($2 & mask));
+                                       free(loc);
+                               }
                        }
 
                        $$.data = data_append_integer($1.data, $2, $1.bits);
index f2e68807f277c5009641c54f5198bebb7cb1c28f..0c91aa7f67b5b7d75d94cef2c61e8f7ec2c973c0 100644 (file)
@@ -35,14 +35,14 @@ struct fdt_reserve_entry {
 
 struct fdt_node_header {
        fdt32_t tag;
-       char name[0];
+       char name[];
 };
 
 struct fdt_property {
        fdt32_t tag;
        fdt32_t len;
        fdt32_t nameoff;
-       char data[0];
+       char data[];
 };
 
 #endif /* !__ASSEMBLY */
index 0f303087b043d1ab9282dc12415f68d697fb116b..99614ec1a289fc12ade044e62852c2c78355b8ca 100644 (file)
@@ -1 +1 @@
-#define DTC_VERSION "DTC 1.6.1-g55778a03"
+#define DTC_VERSION "DTC 1.6.1-gabbd523b"