Changeset a35b458 in mainline for uspace/drv/platform/msim/msim.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
  • uspace/drv/platform/msim/msim.c

    r3061bc1 ra35b458  
    147147{
    148148        msim_fun_t *fun = msim_fun(fnode);
    149        
     149
    150150        assert(fun != NULL);
    151151        return &fun->hw_resources;
     
    184184{
    185185        ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name);
    186        
     186
    187187        ddf_fun_t *fnode = NULL;
    188188        errno_t rc;
    189        
     189
    190190        /* Create new device. */
    191191        fnode = ddf_fun_create(dev, fun_inner, name);
    192192        if (fnode == NULL)
    193193                goto failure;
    194        
     194
    195195        msim_fun_t *fun = ddf_fun_data_alloc(fnode, sizeof(msim_fun_t));
    196196        if (fun == NULL)
    197197                goto failure;
    198        
     198
    199199        *fun = *fun_proto;
    200        
     200
    201201        /* Add match ID */
    202202        rc = ddf_fun_add_match_id(fnode, str_match_id, 100);
    203203        if (rc != EOK)
    204204                goto failure;
    205        
     205
    206206        /* Set provided operations to the device. */
    207207        ddf_fun_set_ops(fnode, &msim_fun_ops);
    208        
     208
    209209        /* Register function. */
    210210        if (ddf_fun_bind(fnode) != EOK) {
     
    212212                goto failure;
    213213        }
    214        
     214
    215215        return true;
    216        
     216
    217217failure:
    218218        if (fnode != NULL)
    219219                ddf_fun_destroy(fnode);
    220        
     220
    221221        ddf_msg(LVL_ERROR, "Failed adding function '%s'.", name);
    222        
     222
    223223        return false;
    224224}
     
    246246        if (!msim_add_functions(dev))
    247247                ddf_msg(LVL_ERROR, "Failed to add functions for the MSIM platform.");
    248        
     248
    249249        return EOK;
    250250}
Note: See TracChangeset for help on using the changeset viewer.