Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 99718a2e in mainline for kernel/genarch/src/acpi/madt.c


Ignore:
Timestamp:
2010-06-30T20:42:42Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
873c681
Parents:
50f4b95
Message:

improve code readability

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/acpi/madt.c

    r50f4b95 r99718a2e  
    111111        return ((struct madt_l_apic *)
    112112            madt_entries_index[madt_l_apic_entry_index + i])->apic_id ==
    113             l_apic_id();
     113            bsp_l_apic;
    114114}
    115115
     
    147147static void madt_l_apic_entry(struct madt_l_apic *la, size_t i)
    148148{
    149         if (!madt_l_apic_entry_cnt++)
     149        if (madt_l_apic_entry_cnt == 0)
    150150                madt_l_apic_entry_index = i;
     151       
     152        madt_l_apic_entry_cnt++;
    151153       
    152154        if (!(la->flags & 0x1)) {
     
    160162static void madt_io_apic_entry(struct madt_io_apic *ioa, size_t i)
    161163{
    162         if (!madt_io_apic_entry_cnt++) {
     164        if (madt_io_apic_entry_cnt == 0) {
    163165                /* Remember index of the first io apic entry */
    164166                madt_io_apic_entry_index = i;
     
    167169                /* Currently not supported */
    168170        }
     171       
     172        madt_io_apic_entry_cnt++;
    169173}
    170174
     
    190194        /* Count MADT entries */
    191195        unsigned int madt_entries_index_cnt = 0;
    192         for (hdr = &acpi_madt->apic_header[0]; hdr < end;
     196        for (hdr = acpi_madt->apic_header; hdr < end;
    193197            hdr = (struct madt_apic_header *) (((uint8_t *) hdr) + hdr->length))
    194198                madt_entries_index_cnt++;
     
    196200        /* Create MADT APIC entries index array */
    197201        madt_entries_index = (struct madt_apic_header **)
    198             malloc(madt_entries_index_cnt * sizeof(struct madt_apic_header **),
     202            malloc(madt_entries_index_cnt * sizeof(struct madt_apic_header *),
    199203            FRAME_ATOMIC);
    200204        if (!madt_entries_index)
     
    203207        size_t i = 0;
    204208       
    205         for (hdr = &acpi_madt->apic_header[0]; hdr < end;
    206             hdr = (struct madt_apic_header *) (((uint8_t *) hdr) + hdr->length))
    207                 madt_entries_index[i++] = hdr;
     209        for (hdr = acpi_madt->apic_header; hdr < end;
     210            hdr = (struct madt_apic_header *) (((uint8_t *) hdr) + hdr->length)) {
     211                madt_entries_index[i] = hdr;
     212                i++;
     213        }
    208214       
    209215        /* Sort MADT index structure */
Note: See TracChangeset for help on using the changeset viewer.