Changeset a35b458 in mainline for uspace/drv/char/i8042/main.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/char/i8042/main.c

    r3061bc1 ra35b458  
    5959{
    6060        assert(dev);
    61        
     61
    6262        async_sess_t *parent_sess = ddf_dev_parent_sess_get(dev);
    6363        if (parent_sess == NULL)
    6464                return ENOMEM;
    65        
     65
    6666        hw_res_list_parsed_t hw_resources;
    6767        hw_res_list_parsed_init(&hw_resources);
     
    6969        if (ret != EOK)
    7070                return ret;
    71        
     71
    7272        if ((hw_resources.irqs.count != 2) ||
    7373            (hw_resources.io_ranges.count != 1)) {
     
    7575                return EINVAL;
    7676        }
    77        
     77
    7878        if (p_io_reg)
    7979                *p_io_reg = hw_resources.io_ranges.ranges[0];
    80        
     80
    8181        if (kbd_irq)
    8282                *kbd_irq = hw_resources.irqs.irqs[0];
    83        
     83
    8484        if (mouse_irq)
    8585                *mouse_irq = hw_resources.irqs.irqs[1];
    86        
     86
    8787        hw_res_list_parsed_clean(&hw_resources);
    8888        return EOK;
     
    102102        int mouse = 0;
    103103        errno_t rc;
    104        
     104
    105105        if (!device)
    106106                return EINVAL;
    107        
     107
    108108        rc = get_my_registers(device, &io_regs, &kbd, &mouse);
    109109        if (rc != EOK) {
     
    112112                return rc;
    113113        }
    114        
     114
    115115        ddf_msg(LVL_DEBUG,
    116116            "I/O regs at %p (size %zuB), IRQ kbd %d, IRQ mouse %d.",
    117117            RNGABSPTR(io_regs), RNGSZ(io_regs), kbd, mouse);
    118        
     118
    119119        i8042_t *i8042 = ddf_dev_data_alloc(device, sizeof(i8042_t));
    120120        if (i8042 == NULL) {
     
    122122                return ENOMEM;
    123123        }
    124        
     124
    125125        rc = i8042_init(i8042, &io_regs, kbd, mouse, device);
    126126        if (rc != EOK) {
     
    129129                return rc;
    130130        }
    131        
     131
    132132        ddf_msg(LVL_NOTE, "Controlling '%s' (%" PRIun ").",
    133133            ddf_dev_get_name(device), ddf_dev_get_handle(device));
     
    150150        printf("%s: HelenOS PS/2 driver.\n", NAME);
    151151        ddf_log_init(NAME);
    152        
     152
    153153        return ddf_driver_main(&i8042_driver);
    154154}
Note: See TracChangeset for help on using the changeset viewer.