Changeset a35b458 in mainline for uspace/app/kio/kio.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/app/kio/kio.c

    r3061bc1 ra35b458  
    8383        if (item == NULL)
    8484                return;
    85        
     85
    8686        size_t sz = sizeof(wchar_t) * length;
    8787        wchar_t *buf = (wchar_t *) malloc(sz);
     
    9090                return;
    9191        }
    92        
     92
    9393        memcpy(buf, data, sz);
    94        
     94
    9595        link_initialize(&item->link);
    9696        item->length = length;
     
    116116                printf("%s: Unable to create log file %s (%s)\n", NAME, LOG_FNAME,
    117117                    str_error(errno));
    118        
     118
    119119        while (true) {
    120120                link_t *link = prodcons_consume(&pc);
    121121                item_t *item = list_get_instance(link, item_t, link);
    122                
     122
    123123                for (size_t i = 0; i < item->length; i++)
    124124                        putchar(item->data[i]);
    125                
     125
    126126                if (log != NULL) {
    127127                        for (size_t i = 0; i < item->length; i++)
    128128                                fputc(item->data[i], log);
    129                        
     129
    130130                        fflush(log);
    131131                        vfs_sync(fileno(log));
    132132                }
    133                
     133
    134134                free(item->data);
    135135                free(item);
    136136        }
    137        
     137
    138138        fclose(log);
    139139        return EOK;
     
    162162         * this possibility cannot be generally avoided.
    163163         */
    164        
     164
    165165        fibril_mutex_lock(&mtx);
    166        
     166
    167167        size_t kio_start = (size_t) IPC_GET_ARG1(*call);
    168168        size_t kio_len = (size_t) IPC_GET_ARG2(*call);
    169169        size_t kio_stored = (size_t) IPC_GET_ARG3(*call);
    170        
     170
    171171        size_t offset = (kio_start + kio_len - kio_stored) % kio_length;
    172        
     172
    173173        /* Copy data from the ring buffer */
    174174        if (offset + kio_stored >= kio_length) {
    175175                size_t split = kio_length - offset;
    176                
     176
    177177                producer(split, kio + offset);
    178178                producer(kio_stored - split, kio);
    179179        } else
    180180                producer(kio_stored, kio + offset);
    181        
     181
    182182        async_event_unmask(EVENT_KIO);
    183183        fibril_mutex_unlock(&mtx);
     
    193193                return rc;
    194194        }
    195        
     195
    196196        uintptr_t faddr;
    197197        rc = sysinfo_get_value("kio.faddr", &faddr);
     
    201201                return rc;
    202202        }
    203        
     203
    204204        size_t size = pages * PAGE_SIZE;
    205205        kio_length = size / sizeof(wchar_t);
    206        
     206
    207207        rc = physmem_map(faddr, pages, AS_AREA_READ | AS_AREA_CACHEABLE,
    208208            (void *) &kio);
     
    211211                return rc;
    212212        }
    213        
     213
    214214        prodcons_initialize(&pc);
    215215        rc = async_event_subscribe(EVENT_KIO, kio_notification_handler, NULL);
     
    219219                return rc;
    220220        }
    221        
     221
    222222        fid_t fid = fibril_create(consumer, NULL);
    223223        if (!fid) {
     
    226226                return ENOMEM;
    227227        }
    228        
     228
    229229        tinput_t *input = tinput_new();
    230230        if (!input) {
     
    236236        async_event_unmask(EVENT_KIO);
    237237        kio_update();
    238        
     238
    239239        tinput_set_prompt(input, "kio> ");
    240240
Note: See TracChangeset for help on using the changeset viewer.