hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/scripts/dtc/flattree.c
....@@ -1,21 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
3
- *
4
- *
5
- * This program is free software; you can redistribute it and/or
6
- * modify it under the terms of the GNU General Public License as
7
- * published by the Free Software Foundation; either version 2 of the
8
- * License, or (at your option) any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
- * General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18
- * USA
194 */
205
216 #include "dtc.h"
....@@ -171,7 +156,7 @@
171156 emit_offset_label(f, m->ref, m->offset);
172157
173158 while ((d.len - off) >= sizeof(uint32_t)) {
174
- asm_emit_cell(e, fdt32_to_cpu(*((fdt32_t *)(d.val+off))));
159
+ asm_emit_cell(e, dtb_ld32(d.val + off));
175160 off += sizeof(uint32_t);
176161 }
177162
....@@ -393,7 +378,7 @@
393378 padlen = 0;
394379 if (quiet < 1)
395380 fprintf(stderr,
396
- "Warning: blob size %d >= minimum size %d\n",
381
+ "Warning: blob size %"PRIu32" >= minimum size %d\n",
397382 fdt32_to_cpu(fdt.totalsize), minsize);
398383 }
399384 }
....@@ -525,7 +510,7 @@
525510 fprintf(f, "/* Memory reserve map from source file */\n");
526511
527512 /*
528
- * Use .long on high and low halfs of u64s to avoid .quad
513
+ * Use .long on high and low halves of u64s to avoid .quad
529514 * as it appears .quad isn't available in some assemblers.
530515 */
531516 for (re = dti->reservelist; re; re = re->next) {
....@@ -692,7 +677,7 @@
692677
693678 val = flat_read_data(dtbuf, proplen);
694679
695
- return build_property(name, val);
680
+ return build_property(name, val, NULL);
696681 }
697682
698683
....@@ -750,7 +735,7 @@
750735 char *flatname;
751736 uint32_t val;
752737
753
- node = build_node(NULL, NULL);
738
+ node = build_node(NULL, NULL, NULL);
754739
755740 flatname = flat_read_string(dtbuf);
756741