commonlib/device_tree.c: Fix skipping NOP tokens
The current code doesn't make much sense. The offset created by the skipping of NOP tokens is just ignored. Reorder the lines to skip the NOP tokens first. Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: I860a57e4a773b634149e84271b8322d78ac20e32 Reviewed-on: https://review.coreboot.org/c/coreboot/+/90277 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
parent
29bec62a22
commit
db01aa6cb2
1 changed files with 2 additions and 1 deletions
|
|
@ -116,11 +116,12 @@ int fdt_next_property(const void *blob, uint32_t offset,
|
|||
struct fdt_property *prop)
|
||||
{
|
||||
struct fdt_header *header = (struct fdt_header *)blob;
|
||||
uint32_t *ptr = (uint32_t *)(((uint8_t *)blob) + offset);
|
||||
|
||||
// skip NOP tokens
|
||||
offset += fdt_skip_nops(blob, offset);
|
||||
|
||||
uint32_t *ptr = (uint32_t *)(((uint8_t *)blob) + offset);
|
||||
|
||||
int index = 0;
|
||||
if (be32toh(ptr[index++]) != FDT_TOKEN_PROPERTY)
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue