Changeset a35b458 in mainline for kernel/arch/ia64/src/drivers/ski.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (6 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
  • kernel/arch/ia64/src/drivers/ski.c

    r3061bc1 ra35b458  
    4949        /** Interval between polling in microseconds */
    5050        POLL_INTERVAL = 10000,  /* 0.01 s */
    51        
     51
    5252        /** Max. number of characters to pull out at a time */
    5353        POLL_LIMIT = 30,
    54        
     54
    5555        SKI_INIT_CONSOLE = 20,
    5656        SKI_GETCHAR      = 21,
     
    8282{
    8383        uint64_t ch;
    84        
     84
    8585        asm volatile (
    8686                "mov r15 = %1\n"
    8787                "break 0x80000;;\n"  /* modifies r8 */
    8888                "mov %0 = r8;;\n"
    89                
     89
    9090                : "=r" (ch)
    9191                : "i" (SKI_GETCHAR)
    9292                : "r15", "r8"
    9393        );
    94        
     94
    9595        return (wchar_t) ch;
    9696}
     
    103103{
    104104        int count = POLL_LIMIT;
    105        
     105
    106106        while (count > 0) {
    107107                wchar_t ch = ski_getchar();
    108                
     108
    109109                if (ch == '\0')
    110110                        break;
    111                
     111
    112112                indev_push_character(instance->srlnin, ch);
    113113                --count;
     
    119119{
    120120        ski_instance_t *instance = (ski_instance_t *) arg;
    121        
     121
    122122        while (true) {
    123123                // TODO FIXME:
     
    126126                if (console_override)
    127127                        poll_keyboard(instance);
    128                
     128
    129129                thread_usleep(POLL_INTERVAL);
    130130        }
     
    141141        if (instance)
    142142                return;
    143        
     143
    144144        asm volatile (
    145145                "mov r15 = %0\n"
     
    149149                : "r15", "r8"
    150150        );
    151        
     151
    152152        instance = malloc(sizeof(ski_instance_t), FRAME_ATOMIC);
    153        
     153
    154154        if (instance) {
    155155                instance->thread = thread_create(kskipoll, instance, TASK,
    156156                    THREAD_FLAG_UNCOUNTED, "kskipoll");
    157                
     157
    158158                if (!instance->thread) {
    159159                        free(instance);
     
    161161                        return;
    162162                }
    163                
     163
    164164                instance->srlnin = NULL;
    165165        }
     
    196196                        if (ch == '\n')
    197197                                ski_do_putchar('\r');
    198                        
     198
    199199                        ski_do_putchar(ch);
    200200                } else
     
    208208        if (!instance)
    209209                return NULL;
    210        
     210
    211211        outdev_t *skidev = malloc(sizeof(outdev_t), FRAME_ATOMIC);
    212212        if (!skidev)
    213213                return NULL;
    214        
     214
    215215        outdev_initialize("skidev", skidev, &skidev_ops);
    216216        skidev->data = instance;
    217        
     217
    218218        if (!fb_exported) {
    219219                /*
     
    224224                sysinfo_set_item_val("fb", NULL, true);
    225225                sysinfo_set_item_val("fb.kind", NULL, 6);
    226                
     226
    227227                fb_exported = true;
    228228        }
    229        
     229
    230230        return skidev;
    231231}
     
    241241        assert(instance);
    242242        assert(srlnin);
    243        
     243
    244244        instance->srlnin = srlnin;
    245245        thread_ready(instance->thread);
    246        
     246
    247247        sysinfo_set_item_val("kbd", NULL, true);
    248248        sysinfo_set_item_val("kbd.type", NULL, KBD_SKI);
Note: See TracChangeset for help on using the changeset viewer.