Skip to content

Commit

Permalink
use "entry->config == NULL" as criterion for "end of config area arra…
Browse files Browse the repository at this point in the history
…y" instead of "entry->tag == avm_kernel_config_tags_last" used so far
  • Loading branch information
er13 committed Mar 26, 2017
1 parent 9defda1 commit 89dee38
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions avm_kernel_config/gen_avm_kernel_config.c
Expand Up @@ -64,10 +64,8 @@ bool relocateConfigArea(struct _avm_kernel_config * *configArea, size_t configSi

swapEndianess(swapNeeded, &entry->tag);

while (entry->tag <= avm_kernel_config_tags_last)
while (entry->config != NULL)
{
if (entry->config == NULL) break;

swapEndianess(swapNeeded, (uint32_t *) &entry->config);
entry->config = (void *) ((uint32_t) entry->config - kernelOffset + configBase);

Expand Down Expand Up @@ -161,10 +159,8 @@ struct _avm_kernel_config* findEntry(struct _avm_kernel_config * *configArea, en
if (entry == NULL)
return NULL;

while (entry->tag <= avm_kernel_config_tags_last)
while (entry->config != NULL)
{
if (entry->config == NULL)
return NULL;
if (entry->tag == tag)
return entry;
entry++;
Expand Down

0 comments on commit 89dee38

Please sign in to comment.