Changeset a35b458 in mainline for kernel/generic/src/ipc/event.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
  • kernel/generic/src/ipc/event.c

    r3061bc1 ra35b458  
    6161{
    6262        assert(evno < EVENT_TASK_END);
    63        
     63
    6464        event_t *event;
    65        
     65
    6666        if (evno < EVENT_END)
    6767                event = &events[(event_type_t) evno];
    6868        else
    6969                event = &task->events[(event_task_type_t) evno - EVENT_END];
    70        
     70
    7171        return event;
    7272}
     
    9696        for (unsigned int i = 0; i < EVENT_END; i++) {
    9797                spinlock_lock(&events[i].lock);
    98                
     98
    9999                if (events[i].answerbox == answerbox) {
    100100                        events[i].answerbox = NULL;
     
    103103                        events[i].masked = false;
    104104                }
    105                
     105
    106106                spinlock_unlock(&events[i].lock);
    107107        }
     
    125125{
    126126        assert(evno < EVENT_END);
    127        
     127
    128128        _event_set_unmask_callback(evno2event(evno, NULL), callback);
    129129}
     
    134134        assert(evno >= (int) EVENT_END);
    135135        assert(evno < EVENT_TASK_END);
    136                
     136
    137137        _event_set_unmask_callback(evno2event(evno, task), callback);
    138138}
     
    144144
    145145        spinlock_lock(&event->lock);
    146        
     146
    147147        if (event->answerbox != NULL) {
    148148                if (!event->masked) {
    149149                        call_t *call = ipc_call_alloc(FRAME_ATOMIC);
    150                        
     150
    151151                        if (call) {
    152152                                call->flags |= IPC_CALL_NOTIF;
    153153                                call->priv = ++event->counter;
    154                                
     154
    155155                                IPC_SET_IMETHOD(call->data, event->imethod);
    156156                                IPC_SET_ARG1(call->data, a1);
     
    159159                                IPC_SET_ARG4(call->data, a4);
    160160                                IPC_SET_ARG5(call->data, a5);
    161                                
     161
    162162                                call->data.task_id = TASK ? TASK->taskid : 0;
    163                                
     163
    164164                                irq_spinlock_lock(&event->answerbox->irq_lock,
    165165                                    true);
     
    168168                                irq_spinlock_unlock(&event->answerbox->irq_lock,
    169169                                    true);
    170                                
     170
    171171                                waitq_wakeup(&event->answerbox->wq,
    172172                                    WAKEUP_FIRST);
    173                                
     173
    174174                                if (mask)
    175175                                        event->masked = true;
    176                                
     176
    177177                                res = EOK;
    178178                        } else
     
    182182        } else
    183183                res = ENOENT;
    184        
     184
    185185        spinlock_unlock(&event->lock);
    186186        return res;
     
    210210{
    211211        assert(evno < EVENT_END);
    212        
     212
    213213        return event_enqueue(evno2event(evno, NULL), mask, a1, a2, a3, a4, a5);
    214214}
     
    239239        assert(evno >= (int) EVENT_END);
    240240        assert(evno < EVENT_TASK_END);
    241        
     241
    242242        return event_enqueue(evno2event(evno, task), mask, a1, a2, a3, a4, a5);
    243243}
     
    259259{
    260260        errno_t res;
    261        
    262         spinlock_lock(&event->lock);
    263        
     261
     262        spinlock_lock(&event->lock);
     263
    264264        if (event->answerbox == NULL) {
    265265                event->answerbox = answerbox;
     
    270270        } else
    271271                res = EEXIST;
    272        
    273         spinlock_unlock(&event->lock);
    274        
     272
     273        spinlock_unlock(&event->lock);
     274
    275275        return res;
    276276}
     
    289289{
    290290        errno_t res;
    291        
    292         spinlock_lock(&event->lock);
    293        
     291
     292        spinlock_lock(&event->lock);
     293
    294294        if (event->answerbox == answerbox) {
    295295                event->answerbox = NULL;
     
    300300        } else
    301301                res = ENOENT;
    302        
    303         spinlock_unlock(&event->lock);
    304        
     302
     303        spinlock_unlock(&event->lock);
     304
    305305        return res;
    306306}
     
    317317        event_callback_t callback = event->unmask_callback;
    318318        spinlock_unlock(&event->lock);
    319        
     319
    320320        /*
    321321         * Check if there is an unmask callback
     
    342342        if (evno >= EVENT_TASK_END)
    343343                return ELIMIT;
    344        
     344
    345345        return (sys_errno_t) event_subscribe(evno2event(evno, TASK),
    346346            (sysarg_t) imethod, &TASK->answerbox);
     
    361361        if (evno >= EVENT_TASK_END)
    362362                return ELIMIT;
    363        
     363
    364364        return (sys_errno_t) event_unsubscribe(evno2event(evno, TASK),
    365365            &TASK->answerbox);
     
    383383        if (evno >= EVENT_TASK_END)
    384384                return ELIMIT;
    385        
     385
    386386        event_unmask(evno2event(evno, TASK));
    387387
Note: See TracChangeset for help on using the changeset viewer.