Changeset a35b458 in mainline for kernel/generic/src/time/timeout.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/time/timeout.c

    r3061bc1 ra35b458  
    103103        irq_spinlock_lock(&CPU->timeoutlock, true);
    104104        irq_spinlock_lock(&timeout->lock, false);
    105        
     105
    106106        if (timeout->cpu)
    107107                panic("Unexpected: timeout->cpu != 0.");
    108        
     108
    109109        timeout->cpu = CPU;
    110110        timeout->ticks = us2ticks(time);
    111        
     111
    112112        timeout->handler = handler;
    113113        timeout->arg = arg;
    114        
     114
    115115        /*
    116116         * Insert timeout into the active timeouts list according to timeout->ticks.
     
    123123                target = list_get_instance(cur, timeout_t, link);
    124124                irq_spinlock_lock(&target->lock, false);
    125                
     125
    126126                if (timeout->ticks < sum + target->ticks) {
    127127                        irq_spinlock_unlock(&target->lock, false);
    128128                        break;
    129129                }
    130                
     130
    131131                sum += target->ticks;
    132132                irq_spinlock_unlock(&target->lock, false);
    133133        }
    134        
     134
    135135        /* Avoid using cur->prev directly */
    136136        link_t *prev = cur->prev;
    137137        list_insert_after(&timeout->link, prev);
    138        
     138
    139139        /*
    140140         * Adjust timeout->ticks according to ticks
     
    142142         */
    143143        timeout->ticks -= sum;
    144        
     144
    145145        /*
    146146         * Decrease ticks of timeout's immediate succesor by timeout->ticks.
     
    151151                irq_spinlock_unlock(&target->lock, false);
    152152        }
    153        
     153
    154154        irq_spinlock_unlock(&timeout->lock, false);
    155155        irq_spinlock_unlock(&CPU->timeoutlock, true);
     
    168168{
    169169        DEADLOCK_PROBE_INIT(p_tolock);
    170        
     170
    171171grab_locks:
    172172        irq_spinlock_lock(&timeout->lock, true);
     
    175175                return false;
    176176        }
    177        
     177
    178178        if (!irq_spinlock_trylock(&timeout->cpu->timeoutlock)) {
    179179                irq_spinlock_unlock(&timeout->lock, true);
     
    181181                goto grab_locks;
    182182        }
    183        
     183
    184184        /*
    185185         * Now we know for sure that timeout hasn't been activated yet
    186186         * and is lurking in timeout->cpu->timeout_active_list.
    187187         */
    188        
     188
    189189        link_t *cur = timeout->link.next;
    190190        if (cur != &timeout->cpu->timeout_active_list.head) {
     
    194194                irq_spinlock_unlock(&tmp->lock, false);
    195195        }
    196        
     196
    197197        list_remove(&timeout->link);
    198198        irq_spinlock_unlock(&timeout->cpu->timeoutlock, false);
    199        
     199
    200200        timeout_reinitialize(timeout);
    201201        irq_spinlock_unlock(&timeout->lock, true);
    202        
     202
    203203        return true;
    204204}
Note: See TracChangeset for help on using the changeset viewer.