From e6b8d3820842d7c5f0472bdf03dfb4fe31c6ad87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Burdukiewicz?= Date: Sat, 29 Jun 2024 00:00:21 +0200 Subject: [PATCH] fdt-v2: minor code cleanups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bartłomiej Burdukiewicz --- src/fdt/fdt-parser.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/fdt/fdt-parser.cpp b/src/fdt/fdt-parser.cpp index ed65669..b14fede 100644 --- a/src/fdt/fdt-parser.cpp +++ b/src/fdt/fdt-parser.cpp @@ -160,8 +160,10 @@ void fdt_parser::parse(const fdt::header header, iface_fdt_generator &generator) using namespace fdt::tokenizer::types; context ctx; - auto begin = reinterpret_cast(dt_struct); - auto end = reinterpret_cast(dt_struct) + header.size_dt_struct / sizeof(u32); + const auto begin = reinterpret_cast(dt_struct); + const auto end = reinterpret_cast(dt_struct) + header.size_dt_struct / sizeof(u32); + + const auto is_aligned = (header.size_dt_struct % sizeof(u32)) == 0; for (auto iter = begin; iter != end;) { const auto id = static_cast(convert(*iter)); @@ -193,6 +195,7 @@ void fdt_parser::parse(const fdt::header header, iface_fdt_generator &generator) return std::holds_alternative(v); }); + std::cout << "is_aligned : " << is_aligned << std::endl; std::cout << "node begin count: " << node_begin_count << std::endl; std::cout << "node end count: " << node_end_count << std::endl; std::cout << "property count: " << property_count << std::endl;