Skip to content

Commit

Permalink
fix device-tree loop (had just by chance no negative effect)
Browse files Browse the repository at this point in the history
  • Loading branch information
er13 committed Mar 26, 2017
1 parent 87aaad1 commit 5e30001
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions avm_kernel_config/gen_avm_kernel_config.c
Expand Up @@ -227,7 +227,7 @@ bool hasDeviceTree(struct _avm_kernel_config * *configArea, int i)
while (entry->tag <= avm_kernel_config_tags_last)
{
if (entry->config == NULL) return false;
if ((int) entry->tag == (avm_kernel_config_tags_device_tree_subrev_0 + i)) return true;
if ((int) entry->tag == i) return true;
entry++;
}

Expand All @@ -252,12 +252,12 @@ int processConfigArea(struct _avm_kernel_config * *configArea)

// device tree for subrevision 0 is the fallback entry and may be expected
// as 'always present', if FDTs exist at all
for (int i = 0; i <= avm_kernel_config_tags_device_tree_subrev_last; i++)
for (int i = avm_kernel_config_tags_device_tree_subrev_0; i <= avm_kernel_config_tags_device_tree_subrev_last; i++)
{
if (hasDeviceTree(configArea, i))
{
outputDeviceTrees = true;
fprintf(stdout, "\tAVM_KERNEL_CONFIG_ENTRY\t%u, \"device_tree_subrev_%u\"\n", avm_kernel_config_tags_device_tree_subrev_0 + i, i);
fprintf(stdout, "\tAVM_KERNEL_CONFIG_ENTRY\t%u, \"device_tree_subrev_%u\"\n", i, i - avm_kernel_config_tags_device_tree_subrev_0);
}
}

Expand Down

0 comments on commit 5e30001

Please sign in to comment.