diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2012-04-26 22:20:56 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2012-04-26 22:20:56 -0400 |
commit | d630d14e75a1af4360808d82107b6006d2d4e48e (patch) | |
tree | 27eee09d2a9de356696078962792f297aae4601b /src | |
parent | e5d71ca96701a02c907fae345b491ff247e59581 (diff) | |
download | seabios-hppa-d630d14e75a1af4360808d82107b6006d2d4e48e.zip seabios-hppa-d630d14e75a1af4360808d82107b6006d2d4e48e.tar.gz seabios-hppa-d630d14e75a1af4360808d82107b6006d2d4e48e.tar.bz2 |
pciinit: Simplify list manipulation in pci_region_migrate_64bit_entries.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/pciinit.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/pciinit.c b/src/pciinit.c index c288fe7..dbbcf07 100644 --- a/src/pciinit.c +++ b/src/pciinit.c @@ -389,21 +389,18 @@ static u64 pci_region_sum(struct pci_region *r) static void pci_region_migrate_64bit_entries(struct pci_region *from, struct pci_region *to) { - struct pci_region_entry **pprev = &from->list; - struct pci_region_entry **last = &to->list; + struct pci_region_entry **pprev = &from->list, **last = &to->list; while (*pprev) { - if ((*pprev)->is64) { - struct pci_region_entry *entry; - entry = *pprev; - /* Delete the entry and move next */ - *pprev = (*pprev)->next; - /* Add entry at tail to keep a sorted order */ - entry->next = NULL; - *last = entry; - last = &entry->next; + struct pci_region_entry *entry = *pprev; + if (!entry->is64) { + pprev = &entry->next; + continue; } - else - pprev = &(*pprev)->next; + // Move from source list to destination list. + *pprev = entry->next; + entry->next = NULL; + *last = entry; + last = &entry->next; } } |