Changeset a35b458 in mainline for uspace/drv/platform/pc/pc.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (6 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
  • uspace/drv/platform/pc/pc.c

    r3061bc1 ra35b458  
    120120{
    121121        pc_fun_t *fun = pc_fun(fnode);
    122        
     122
    123123        assert(fun != NULL);
    124124        return &fun->hw_resources;
     
    128128{
    129129        /* TODO */
    130        
     130
    131131        return false;
    132132}
     
    135135{
    136136        pc_fun_t *fun = pc_fun(fnode);
    137        
     137
    138138        assert(fun != NULL);
    139139        return &fun->pio_window;
     
    157157{
    158158        ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name);
    159        
     159
    160160        ddf_fun_t *fnode = NULL;
    161161        errno_t rc;
    162        
     162
    163163        /* Create new device. */
    164164        fnode = ddf_fun_create(dev, fun_inner, name);
    165165        if (fnode == NULL)
    166166                goto failure;
    167        
     167
    168168        pc_fun_t *fun = ddf_fun_data_alloc(fnode, sizeof(pc_fun_t));
    169169        *fun = *fun_proto;
    170        
     170
    171171        /* Add match ID */
    172172        rc = ddf_fun_add_match_id(fnode, str_match_id, 100);
    173173        if (rc != EOK)
    174174                goto failure;
    175        
     175
    176176        /* Set provided operations to the device. */
    177177        ddf_fun_set_ops(fnode, &pc_fun_ops);
    178        
     178
    179179        /* Register function. */
    180180        if (ddf_fun_bind(fnode) != EOK) {
     
    182182                goto failure;
    183183        }
    184        
     184
    185185        return true;
    186        
     186
    187187failure:
    188188        if (fnode != NULL)
    189189                ddf_fun_destroy(fnode);
    190        
     190
    191191        ddf_msg(LVL_ERROR, "Failed adding function '%s'.", name);
    192        
     192
    193193        return false;
    194194}
     
    209209        ddf_msg(LVL_DEBUG, "pc_dev_add, device handle = %d",
    210210            (int)ddf_dev_get_handle(dev));
    211        
     211
    212212        /* Register functions. */
    213213        if (!pc_add_functions(dev)) {
    214214                ddf_msg(LVL_ERROR, "Failed to add functions for PC platform.");
    215215        }
    216        
     216
    217217        return EOK;
    218218}
Note: See TracChangeset for help on using the changeset viewer.