Changeset a35b458 in mainline for kernel/genarch/src/acpi/acpi.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

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

    r3061bc1 ra35b458  
    6969        uint8_t sum = 0;
    7070        uint32_t i;
    71        
     71
    7272        for (i = 0; i < 20; i++)
    7373                sum = (uint8_t) (sum + _rsdp[i]);
    74        
     74
    7575        if (sum)
    7676                return 0; /* bad checksum */
    77        
     77
    7878        if (rsdp->revision == 0)
    7979                return 1; /* ACPI 1.0 */
    80        
     80
    8181        for (; i < rsdp->length; i++)
    8282                sum = (uint8_t) (sum + _rsdp[i]);
    83        
     83
    8484        return !sum;
    8585}
     
    9090        uint8_t sum = 0;
    9191        unsigned int i;
    92        
     92
    9393        for (i = 0; i < hdr->length; i++)
    9494                sum = (uint8_t) (sum + sdt[i]);
    95        
     95
    9696        return !sum;
    9797}
     
    109109        vsdt = (struct acpi_sdt_header *) km_map((uintptr_t) psdt,
    110110            vhdr->length, PAGE_WRITE | PAGE_NOT_CACHEABLE);
    111        
     111
    112112        // TODO: do not leak vtmp
    113113
     
    121121        size_t cnt = (acpi_rsdt->header.length - sizeof(struct acpi_sdt_header))
    122122            / sizeof(uint32_t);
    123        
     123
    124124        for (i = 0; i < cnt; i++) {
    125125                for (j = 0; j < sizeof(signature_map)
     
    127127                        struct acpi_sdt_header *hdr =
    128128                            (struct acpi_sdt_header *) (sysarg_t) acpi_rsdt->entry[i];
    129                        
     129
    130130                        struct acpi_sdt_header *vhdr = map_sdt(hdr);
    131131                        if (CMP_SIGNATURE(vhdr->signature, signature_map[j].signature)) {
    132132                                if (!acpi_sdt_check((uint8_t *) vhdr))
    133133                                        break;
    134                                
     134
    135135                                *signature_map[j].sdt_ptr = vhdr;
    136136                                LOG("%p: ACPI %s", *signature_map[j].sdt_ptr,
     
    147147        size_t cnt = (acpi_xsdt->header.length - sizeof(struct acpi_sdt_header))
    148148            / sizeof(uint64_t);
    149        
     149
    150150        for (i = 0; i < cnt; i++) {
    151151                for (j = 0; j < sizeof(signature_map)
     
    153153                        struct acpi_sdt_header *hdr =
    154154                            (struct acpi_sdt_header *) ((uintptr_t) acpi_xsdt->entry[i]);
    155                        
     155
    156156                        struct acpi_sdt_header *vhdr = map_sdt(hdr);
    157157                        if (CMP_SIGNATURE(vhdr->signature, signature_map[j].signature)) {
    158158                                if (!acpi_sdt_check((uint8_t *) vhdr))
    159159                                        break;
    160                                
     160
    161161                                *signature_map[j].sdt_ptr = vhdr;
    162162                                LOG("%p: ACPI %s", *signature_map[j].sdt_ptr,
     
    174174        unsigned int length[2] = { 1024, 128 * 1024 };
    175175        uint64_t *sig = (uint64_t *) RSDP_SIGNATURE;
    176        
     176
    177177        /*
    178178         * Find Root System Description Pointer
     
    180180         * 2. search 128K starting at 0xe0000
    181181         */
    182        
     182
    183183        addr[0] = (uint8_t *) PA2KA(ebda);
    184184        for (i = (ebda ? 0 : 1); i < 2; i++) {
     
    191191                }
    192192        }
    193        
     193
    194194        return;
    195        
     195
    196196rsdp_found:
    197197        LOG("%p: ACPI Root System Description Pointer", acpi_rsdp);
    198        
     198
    199199        uintptr_t acpi_rsdt_p = (uintptr_t) acpi_rsdp->rsdt_address;
    200200        uintptr_t acpi_xsdt_p = 0;
     
    202202        if (acpi_rsdp->revision)
    203203                acpi_xsdt_p = (uintptr_t) acpi_rsdp->xsdt_address;
    204        
     204
    205205        if (acpi_rsdt_p)
    206206                acpi_rsdt = (struct acpi_rsdt *) map_sdt(
    207207                    (struct acpi_sdt_header *) acpi_rsdt_p);
    208        
     208
    209209        if (acpi_xsdt_p)
    210210                acpi_xsdt = (struct acpi_xsdt *) map_sdt(
    211211                    (struct acpi_sdt_header *) acpi_xsdt_p);
    212        
     212
    213213        if ((acpi_rsdt) && (!acpi_sdt_check((uint8_t *) acpi_rsdt))) {
    214214                log(LF_ARCH, LVL_ERROR, "RSDT: bad checksum");
    215215                return;
    216216        }
    217        
     217
    218218        if ((acpi_xsdt) && (!acpi_sdt_check((uint8_t *) acpi_xsdt))) {
    219219                log(LF_ARCH, LVL_ERROR, "XSDT: bad checksum");
    220220                return;
    221221        }
    222        
     222
    223223        if (acpi_xsdt)
    224224                configure_via_xsdt();
Note: See TracChangeset for help on using the changeset viewer.