Thu Jun 8 17:24:10 2017 UTC ()
s/ALIGN/FDTALIGN2/


(skrll)
diff -r1.3 -r1.4 src/external/gpl2/dtc/dist/flattree.c

cvs diff -r1.3 -r1.4 src/external/gpl2/dtc/dist/flattree.c (expand / switch to unified diff)

--- src/external/gpl2/dtc/dist/flattree.c 2017/06/08 16:00:40 1.3
+++ src/external/gpl2/dtc/dist/flattree.c 2017/06/08 17:24:10 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: flattree.c,v 1.3 2017/06/08 16:00:40 skrll Exp $ */ 1/* $NetBSD: flattree.c,v 1.4 2017/06/08 17:24:10 skrll Exp $ */
2 2
3/* 3/*
4 * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005. 4 * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2005.
5 * 5 *
6 * 6 *
7 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as 8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the 9 * published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) any later version. 10 * License, or (at your option) any later version.
11 * 11 *
12 * This program is distributed in the hope that it will be useful, 12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -394,27 +394,27 @@ void dt_to_blob(FILE *f, struct dt_info  @@ -394,27 +394,27 @@ void dt_to_blob(FILE *f, struct dt_info
394 if (padlen < 0) { 394 if (padlen < 0) {
395 padlen = 0; 395 padlen = 0;
396 if (quiet < 1) 396 if (quiet < 1)
397 fprintf(stderr, 397 fprintf(stderr,
398 "Warning: blob size %d >= minimum size %d\n", 398 "Warning: blob size %d >= minimum size %d\n",
399 fdt32_to_cpu(fdt.totalsize), minsize); 399 fdt32_to_cpu(fdt.totalsize), minsize);
400 } 400 }
401 } 401 }
402 402
403 if (padsize > 0) 403 if (padsize > 0)
404 padlen = padsize; 404 padlen = padsize;
405 405
406 if (alignsize > 0) 406 if (alignsize > 0)
407 padlen = ALIGN(fdt32_to_cpu(fdt.totalsize) + padlen, alignsize) 407 padlen = FDTALIGN2(fdt32_to_cpu(fdt.totalsize) + padlen, alignsize)
408 - fdt32_to_cpu(fdt.totalsize); 408 - fdt32_to_cpu(fdt.totalsize);
409 409
410 if (padlen > 0) { 410 if (padlen > 0) {
411 int tsize = fdt32_to_cpu(fdt.totalsize); 411 int tsize = fdt32_to_cpu(fdt.totalsize);
412 tsize += padlen; 412 tsize += padlen;
413 fdt.totalsize = cpu_to_fdt32(tsize); 413 fdt.totalsize = cpu_to_fdt32(tsize);
414 } 414 }
415 415
416 /* 416 /*
417 * Assemble the blob: start with the header, add with alignment 417 * Assemble the blob: start with the header, add with alignment
418 * the reserve buffer, add the reserve map terminating zeroes, 418 * the reserve buffer, add the reserve map terminating zeroes,
419 * the device tree itself, and finally the strings. 419 * the device tree itself, and finally the strings.
420 */ 420 */