Skip to content

Commit

Permalink
fdt-v2: minor code cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: Bartłomiej Burdukiewicz <bartlomiej.burdukiewicz@gmail.com>
  • Loading branch information
dev-0x7C6 committed Jun 28, 2024
1 parent b0502dc commit e6b8d38
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/fdt/fdt-parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const u32 *>(dt_struct);
auto end = reinterpret_cast<const u32 *>(dt_struct) + header.size_dt_struct / sizeof(u32);
const auto begin = reinterpret_cast<const u32 *>(dt_struct);
const auto end = reinterpret_cast<const u32 *>(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<u32>(convert(*iter));
Expand Down Expand Up @@ -193,6 +195,7 @@ void fdt_parser::parse(const fdt::header header, iface_fdt_generator &generator)
return std::holds_alternative<types::end>(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;
Expand Down

0 comments on commit e6b8d38

Please sign in to comment.