Migrate to libfdt
Replace our custom FDT parser implementation with libfdt while retaining
the original API as a thin wrapper around libfdt. This minimizes the
changes to the rest of our code base and hides differences in coding
styles.
As a byproduct, this fixes an issue with unaligned memory accesses while
parsing as libfdt handles these correctly.
Bug: 150587116
Change-Id: I8d305d7094b1be04608048009d73d7c448a578a0
diff --git a/src/fdt_test.cc b/src/fdt_test.cc
index 0ee534d..295821a 100644
--- a/src/fdt_test.cc
+++ b/src/fdt_test.cc
@@ -81,8 +81,10 @@
TEST(fdt, total_size)
{
- EXPECT_THAT(fdt_total_size((struct fdt_header *)&test_dtb[0]),
- Eq(sizeof(test_dtb)));
+ size_t size;
+
+ EXPECT_TRUE(fdt_size_from_header(&test_dtb[0], &size));
+ EXPECT_THAT(size, Eq(sizeof(test_dtb)));
}
} /* namespace */