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/drv/generic/remote_usbhid.c

    r3061bc1 ra35b458  
    6767         */
    6868        IPC_M_USBHID_GET_EVENT,
    69        
     69
    7070        /** Get the size of the report descriptor from the HID device.
    7171         *
     
    7878         */
    7979        IPC_M_USBHID_GET_REPORT_DESCRIPTOR_LENGTH,
    80        
     80
    8181        /** Get the report descriptor from the HID device.
    8282         *
     
    101101        if (!dev_sess)
    102102                return EINVAL;
    103        
     103
    104104        async_exch_t *exch = async_exchange_begin(dev_sess);
    105        
     105
    106106        sysarg_t len;
    107107        errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE),
    108108            IPC_M_USBHID_GET_EVENT_LENGTH, &len);
    109        
     109
    110110        async_exchange_end(exch);
    111        
     111
    112112        if (rc == EOK) {
    113113                if (size != NULL)
    114114                        *size = (size_t) len;
    115115        }
    116        
     116
    117117        return rc;
    118118}
     
    137137        if (!dev_sess)
    138138                return EINVAL;
    139        
     139
    140140        if (buf == NULL)
    141141                return ENOMEM;
    142        
     142
    143143        if (size == 0)
    144144                return EINVAL;
    145        
     145
    146146        size_t buffer_size =  size;
    147147        uint8_t *buffer = malloc(buffer_size);
    148148        if (buffer == NULL)
    149149                return ENOMEM;
    150        
     150
    151151        async_exch_t *exch = async_exchange_begin(dev_sess);
    152        
     152
    153153        ipc_call_t opening_request_call;
    154154        aid_t opening_request = async_send_2(exch,
    155155            DEV_IFACE_ID(USBHID_DEV_IFACE), IPC_M_USBHID_GET_EVENT,
    156156            flags, &opening_request_call);
    157        
     157
    158158        if (opening_request == 0) {
    159159                async_exchange_end(exch);
     
    161161                return ENOMEM;
    162162        }
    163        
     163
    164164        ipc_call_t data_request_call;
    165165        aid_t data_request = async_data_read(exch, buffer, buffer_size,
    166166            &data_request_call);
    167        
     167
    168168        async_exchange_end(exch);
    169        
     169
    170170        if (data_request == 0) {
    171171                async_forget(opening_request);
     
    173173                return ENOMEM;
    174174        }
    175        
     175
    176176        errno_t data_request_rc;
    177177        errno_t opening_request_rc;
    178178        async_wait_for(data_request, &data_request_rc);
    179179        async_wait_for(opening_request, &opening_request_rc);
    180        
     180
    181181        if (data_request_rc != EOK) {
    182182                /* Prefer return code of the opening request. */
     
    186186                        return (errno_t) data_request_rc;
    187187        }
    188        
     188
    189189        if (opening_request_rc != EOK)
    190190                return (errno_t) opening_request_rc;
    191        
     191
    192192        size_t act_size = IPC_GET_ARG2(data_request_call);
    193        
     193
    194194        /* Copy the individual items. */
    195195        memcpy(buf, buffer, act_size);
    196        
     196
    197197        if (actual_size != NULL)
    198198                *actual_size = act_size;
    199        
     199
    200200        if (event_nr != NULL)
    201201                *event_nr = IPC_GET_ARG1(opening_request_call);
    202        
     202
    203203        return EOK;
    204204}
     
    209209        if (!dev_sess)
    210210                return EINVAL;
    211        
     211
    212212        async_exch_t *exch = async_exchange_begin(dev_sess);
    213        
     213
    214214        sysarg_t arg_size;
    215215        errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE),
    216216            IPC_M_USBHID_GET_REPORT_DESCRIPTOR_LENGTH, &arg_size);
    217        
     217
    218218        async_exchange_end(exch);
    219        
     219
    220220        if (rc == EOK) {
    221221                if (size != NULL)
    222222                        *size = (size_t) arg_size;
    223223        }
    224        
     224
    225225        return rc;
    226226}
     
    231231        if (!dev_sess)
    232232                return EINVAL;
    233        
     233
    234234        if (buf == NULL)
    235235                return ENOMEM;
    236        
     236
    237237        if (size == 0)
    238238                return EINVAL;
    239        
     239
    240240        async_exch_t *exch = async_exchange_begin(dev_sess);
    241        
     241
    242242        aid_t opening_request = async_send_1(exch,
    243243            DEV_IFACE_ID(USBHID_DEV_IFACE), IPC_M_USBHID_GET_REPORT_DESCRIPTOR,
     
    247247                return ENOMEM;
    248248        }
    249        
     249
    250250        ipc_call_t data_request_call;
    251251        aid_t data_request = async_data_read(exch, buf, size,
    252252            &data_request_call);
    253        
     253
    254254        async_exchange_end(exch);
    255        
     255
    256256        if (data_request == 0) {
    257257                async_forget(opening_request);
    258258                return ENOMEM;
    259259        }
    260        
     260
    261261        errno_t data_request_rc;
    262262        errno_t opening_request_rc;
    263263        async_wait_for(data_request, &data_request_rc);
    264264        async_wait_for(opening_request, &opening_request_rc);
    265        
     265
    266266        if (data_request_rc != EOK) {
    267267                /* Prefer return code of the opening request. */
     
    271271                        return (errno_t) data_request_rc;
    272272        }
    273        
     273
    274274        if (opening_request_rc != EOK)
    275275                return (errno_t) opening_request_rc;
    276        
     276
    277277        size_t act_size = IPC_GET_ARG2(data_request_call);
    278        
     278
    279279        if (actual_size != NULL)
    280280                *actual_size = act_size;
    281        
     281
    282282        return EOK;
    283283}
     
    312312{
    313313        printf("remote_usbhid_get_event_length()\n");
    314        
     314
    315315        usbhid_iface_t *hid_iface = (usbhid_iface_t *) iface;
    316316
     
    326326//      }
    327327        async_answer_1(callid, EOK, len);
    328        
     328
    329329//      if (len < 0) {
    330330//              async_answer_0(callid, len);
Note: See TracChangeset for help on using the changeset viewer.