Changeset a35b458 in mainline for uspace/lib/c/generic/device/hw_res.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/lib/c/generic/device/hw_res.c

    r3061bc1 ra35b458  
    4242{
    4343        sysarg_t count = 0;
    44        
     44
    4545        async_exch_t *exch = async_exchange_begin(sess);
    46        
     46
    4747        errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
    4848            HW_RES_GET_RESOURCE_LIST, &count);
    49        
     49
    5050        if (rc != EOK) {
    5151                async_exchange_end(exch);
    5252                return rc;
    5353        }
    54        
     54
    5555        size_t size = count * sizeof(hw_resource_t);
    5656        hw_resource_t *resources = (hw_resource_t *) malloc(size);
     
    6060                return ENOMEM;
    6161        }
    62        
     62
    6363        rc = async_data_read_start(exch, resources, size);
    6464        async_exchange_end(exch);
    65        
     65
    6666        if (rc != EOK) {
    6767                free(resources);
    6868                return rc;
    6969        }
    70        
     70
    7171        hw_resources->resources = resources;
    7272        hw_resources->count = count;
    73        
     73
    7474        return EOK;
    7575}
     
    7878{
    7979        async_exch_t *exch = async_exchange_begin(sess);
    80        
     80
    8181        errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
    8282            HW_RES_ENABLE_INTERRUPT, irq);
    8383        async_exchange_end(exch);
    84        
     84
    8585        return rc;
    8686}
     
    8989{
    9090        async_exch_t *exch = async_exchange_begin(sess);
    91        
     91
    9292        errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
    9393            HW_RES_DISABLE_INTERRUPT, irq);
    9494        async_exchange_end(exch);
    95        
     95
    9696        return rc;
    9797}
     
    100100{
    101101        async_exch_t *exch = async_exchange_begin(sess);
    102        
     102
    103103        errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
    104104            HW_RES_CLEAR_INTERRUPT, irq);
    105105        async_exchange_end(exch);
    106        
     106
    107107        return rc;
    108108}
     
    126126{
    127127        async_exch_t *exch = async_exchange_begin(sess);
    128        
     128
    129129        const uint32_t packed = (channel & 0xffff) | (mode << 16);
    130130        const errno_t ret = async_req_4_0(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
    131131            HW_RES_DMA_CHANNEL_SETUP, packed, pa, size);
    132        
     132
    133133        async_exchange_end(exch);
    134        
     134
    135135        return ret;
    136136}
     
    148148{
    149149        async_exch_t *exch = async_exchange_begin(sess);
    150        
     150
    151151        sysarg_t remain;
    152152        const errno_t ret = async_req_2_1(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
    153153            HW_RES_DMA_CHANNEL_REMAIN, channel, &remain);
    154        
     154
    155155        async_exchange_end(exch);
    156        
     156
    157157        if (ret == EOK)
    158158                *rem = remain;
    159        
     159
    160160        return ret;
    161161}
Note: See TracChangeset for help on using the changeset viewer.