[source] firmware-utils: Fix build failure in mkmerakifw.c FS#298

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 26 13:40:24 PST 2016


blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/97eff5cba52076da476f028b02bae34fd1f3a9f6

commit 97eff5cba52076da476f028b02bae34fd1f3a9f6
Author: Florian Fainelli <f.fainelli at gmail.com>
AuthorDate: Wed Nov 23 12:50:25 2016 -0800

    firmware-utils: Fix build failure in mkmerakifw.c FS#298
    
    Earlier compilers such as GCC 4 do not like anynomous unions, make it a named
    union "u", and update the code where relevant.
    
    Fixes FS#298
    Fixes: a72e1692b8b3 ("firmware-utils: Add support for the Cisco Meraki MX60/MX60W")
    Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
---
 tools/firmware-utils/src/mkmerakifw.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/firmware-utils/src/mkmerakifw.c b/tools/firmware-utils/src/mkmerakifw.c
index 6394cba..1a50f16 100644
--- a/tools/firmware-utils/src/mkmerakifw.c
+++ b/tools/firmware-utils/src/mkmerakifw.c
@@ -52,7 +52,7 @@ struct board_info {
 			uint32_t fdt_offset;
 			uint32_t unknown_offset;
 		} mx60;
-	};
+	} u;
 	char *id;
 	char *description;
 };
@@ -72,7 +72,7 @@ static const struct board_info boards[] = {
 		.magic1		= 0x8e73ed8a,
 		.magic2		= 0x8e73ed8a,
 		.imagelen	= 0x00800000,
-		.statichash	= {0xda, 0x39, 0xa3, 0xee, 0x5e,
+		.u.statichash	= {0xda, 0x39, 0xa3, 0xee, 0x5e,
 				   0x6b, 0x4b, 0x0d, 0x32, 0x55,
 				   0xbf, 0xef, 0x95, 0x60, 0x18,
 				   0x90, 0xaf, 0xd8, 0x07, 0x09},
@@ -82,7 +82,7 @@ static const struct board_info boards[] = {
 		.magic1		= 0x8e73ed8a,
 		.magic2		= 0x8e73ed8a,
 		.imagelen	= 0x00800000,
-		.statichash	= {0xff, 0xff, 0xff, 0xff, 0xff,
+		.u.statichash	= {0xff, 0xff, 0xff, 0xff, 0xff,
 				   0xff, 0xff, 0xff, 0xff, 0xff,
 				   0xff, 0xff, 0xff, 0xff, 0xff,
 				   0xff, 0xff, 0xff, 0xff, 0xff},
@@ -100,7 +100,7 @@ static const struct board_info boards[] = {
 		 * 4th Row: ? Unused/Unknown ?
 		 * 5th Row: ? Unused/Unknown ?
 		 */
-		.mx60		= {
+		.u.mx60		= {
 			.kernel_offset	= 0x10000,
 			.ramdisk_offset	= 0x3FFC00,
 			.fdt_offset	= 0x0400,
@@ -286,14 +286,14 @@ int main(int argc, char *argv[])
 
 	switch (board->magic2) {
 	case 0xa1f0beef:
-		writel(buf, HDR_OFF_KERNEL_OFFSET, board->mx60.kernel_offset);
-		writel(buf, HDR_OFF_RAMDISK_OFFSET, board->mx60.ramdisk_offset);
-		writel(buf, HDR_OFF_FDT_OFFSET, board->mx60.fdt_offset),
-		writel(buf, HDR_OFF_UNKNOWN_OFFSET, board->mx60.unknown_offset);
+		writel(buf, HDR_OFF_KERNEL_OFFSET, board->u.mx60.kernel_offset);
+		writel(buf, HDR_OFF_RAMDISK_OFFSET, board->u.mx60.ramdisk_offset);
+		writel(buf, HDR_OFF_FDT_OFFSET, board->u.mx60.fdt_offset),
+		writel(buf, HDR_OFF_UNKNOWN_OFFSET, board->u.mx60.unknown_offset);
 		break;
 
 	case 0x8e73ed8a:
-		memcpy(buf + HDR_OFF_STATICHASH, board->statichash, 20);
+		memcpy(buf + HDR_OFF_STATICHASH, board->u.statichash, 20);
 		break;
 	}
 



More information about the lede-commits mailing list