Changeset a35b458 in mainline for boot/arch/sparc64/src/ofw.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
  • boot/arch/sparc64/src/ofw.c

    r3061bc1 ra35b458  
    4747        if (ch == '\n')
    4848                ofw_putchar('\r');
    49        
     49
    5050        if (ascii_check(ch))
    5151                ofw_putchar(ch);
     
    7272{
    7373        size_t cpus;
    74        
     74
    7575        for (cpus = 0; (child != 0) && (child != (phandle) -1);
    7676            child = ofw_get_peer_node(child), cpus++) {
    7777                char type_name[OFW_TREE_PROPERTY_MAX_VALUELEN];
    78                
     78
    7979                if (ofw_get_property(child, "device_type", type_name,
    8080                    OFW_TREE_PROPERTY_MAX_VALUELEN) > 0) {
    8181                        type_name[OFW_TREE_PROPERTY_MAX_VALUELEN - 1] = 0;
    82                        
     82
    8383                        if (str_cmp(type_name, "cpu") == 0) {
    8484                                uint32_t mid;
    85                                
     85
    8686                                /*
    8787                                 * "upa-portid" for US, "portid" for US-III,
     
    9292                                    && (ofw_get_property(child, "cpuid", &mid, sizeof(mid)) <= 0))
    9393                                        continue;
    94                                
     94
    9595                                if (current_mid != mid) {
    9696                                        /*
     
    104104                }
    105105        }
    106        
     106
    107107        return cpus;
    108108}
     
    115115        /* Get the current CPU MID */
    116116        uint64_t current_mid;
    117        
     117
    118118        asm volatile (
    119119                "ldxa [%[zero]] %[asi], %[current_mid]\n"
     
    122122                  [asi] "i" (ASI_ICBUS_CONFIG)
    123123        );
    124        
     124
    125125        current_mid >>= ICBUS_CONFIG_MID_SHIFT;
    126126        current_mid &= mid_mask;
    127        
     127
    128128        /* Wake up the CPUs */
    129        
     129
    130130        phandle cpus_parent = ofw_find_device("/ssm@0,0");
    131131        if ((cpus_parent == 0) || (cpus_parent == (phandle) -1))
    132132                cpus_parent = ofw_find_device("/");
    133        
     133
    134134        phandle node = ofw_get_child_node(cpus_parent);
    135135        size_t cpus = wake_cpus_in_node(node, current_mid, physmem_start);
    136        
     136
    137137        while ((node != 0) && (node != (phandle) -1)) {
    138138                char name[OFW_TREE_PROPERTY_MAX_VALUELEN];
    139                
     139
    140140                if (ofw_get_property(node, "name", name,
    141141                    OFW_TREE_PROPERTY_MAX_VALUELEN) > 0) {
    142142                        name[OFW_TREE_PROPERTY_MAX_VALUELEN - 1] = 0;
    143                        
     143
    144144                        if (str_cmp(name, "cmp") == 0) {
    145145                                phandle subnode = ofw_get_child_node(node);
     
    148148                        }
    149149                }
    150                
     150
    151151                node = ofw_get_peer_node(node);
    152152        }
    153        
     153
    154154        if (cpus == 0)
    155155                printf("Warning: Unable to get CPU properties.\n");
     
    169169                halt();
    170170        }
    171        
     171
    172172        return ((((uintptr_t) memreg[0]) << 32) | memreg[1]);
    173173}
Note: See TracChangeset for help on using the changeset viewer.