Changeset a35b458 in mainline for uspace/drv/hid/usbhid/blink1


Ignore:
Timestamp:
2018-03-02T20:10:49Z (8 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.

Location:
uspace/drv/hid/usbhid/blink1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/hid/usbhid/blink1/blink1.c

    r3061bc1 ra35b458  
    6767                return EINVAL;
    6868        }
    69        
     69
    7070        blink1_report_t report;
    71        
     71
    7272        report.id = BLINK1_REPORT_ID;
    7373        report.command = BLINK1_COMMAND_SET;
     
    7878        report.arg4 = 0;
    7979        report.arg5 = 0;
    80        
     80
    8181        return usbhid_req_set_report(
    8282            usb_device_get_default_pipe(blink1_dev->hid_dev->usb_dev),
     
    100100                return EINVAL;
    101101        }
    102        
     102
    103103        /* Create the exposed function. */
    104104        ddf_fun_t *fun = usb_device_ddf_fun_create(hid_dev->usb_dev,
     
    109109                return ENOMEM;
    110110        }
    111        
     111
    112112        usb_blink1_t *blink1_dev = (usb_blink1_t *)
    113113            ddf_fun_data_alloc(fun, sizeof(usb_blink1_t));
     
    118118                return ENOMEM;
    119119        }
    120        
     120
    121121        ddf_fun_set_ops(fun, &blink1_ops);
    122        
     122
    123123        errno_t rc = ddf_fun_bind(fun);
    124124        if (rc != EOK) {
     
    128128                return rc;
    129129        }
    130        
     130
    131131        rc = ddf_fun_add_to_category(fun, HID_BLINK1_CATEGORY);
    132132        if (rc != EOK) {
    133133                usb_log_error("Could not add DDF function to category %s: %s.",
    134134                    HID_BLINK1_CATEGORY, str_error(rc));
    135                
     135
    136136                rc = ddf_fun_unbind(fun);
    137137                if (rc != EOK) {
     
    140140                        return rc;
    141141                }
    142                
     142
    143143                ddf_fun_destroy(fun);
    144144                return rc;
    145145        }
    146        
     146
    147147        blink1_dev->fun = fun;
    148148        blink1_dev->hid_dev = hid_dev;
    149149        *data = blink1_dev;
    150        
     150
    151151        return EOK;
    152152}
     
    156156        if (data == NULL)
    157157                return;
    158        
     158
    159159        usb_blink1_t *blink1_dev = (usb_blink1_t *) data;
    160        
     160
    161161        errno_t rc = ddf_fun_unbind(blink1_dev->fun);
    162162        if (rc != EOK) {
     
    165165                return;
    166166        }
    167        
     167
    168168        ddf_fun_destroy(blink1_dev->fun);
    169169}
  • uspace/drv/hid/usbhid/blink1/blink1.h

    r3061bc1 ra35b458  
    4444        /** DDF blink(1) function */
    4545        ddf_fun_t *fun;
    46        
     46
    4747        /** USB HID device */
    4848        usb_hid_dev_t *hid_dev;
Note: See TracChangeset for help on using the changeset viewer.