Changeset a35b458 in mainline for kernel/test/synch/workq-test-core.h


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/test/synch/workq-test-core.h

    r3061bc1 ra35b458  
    5454{
    5555        ++work->wave;
    56        
     56
    5757        if (work->wave < WAVES) {
    5858                work->count_down = COUNT;
     
    7979                child->count_down = work->count_down;
    8080        }
    81        
     81
    8282        return child;
    8383}
     
    9393        /* Ensure work_item is ours for the taking. */
    9494        memsetb(work_item, sizeof(work_t), 0xec);
    95        
     95
    9696        test_work_t *work = (test_work_t *)work_item;
    97        
     97
    9898        atomic_inc(&call_cnt[work->wave]);
    99        
     99
    100100        if (0 < work->count_down) {
    101101                /* Sleep right before creating the last generation. */
     
    108108                        }
    109109                }
    110                
     110
    111111                --work->count_down;
    112112
     
    122122                        }
    123123                }
    124                
     124
    125125                if (!core_workq_enqueue(work_item, reproduce)) {
    126126                        if (work->master)
     
    131131        } else {
    132132                /* We're done with this wave - only the master survives. */
    133                
     133
    134134                if (work->master && new_wave(work)) {
    135135                        if (!core_workq_enqueue(work_item, reproduce)) {
     
    140140                        if (work->master)
    141141                                TPRINTF("\nMaster work item done.\n");
    142                                
     142
    143143                        free_work(work);
    144144                }
     
    157157        work->wave = 0;
    158158        work->count_down = COUNT;
    159        
     159
    160160        /*
    161161         * k == COUNT_POW
     
    166166         */
    167167        size_t exp_call_cnt = (COUNT_POW + 2) * (1 << (COUNT_POW - 1));
    168        
     168
    169169        TPRINTF("waves: %d, count_down: %d, total expected calls: %zu\n",
    170170                WAVES, COUNT, exp_call_cnt * WAVES);
    171        
     171
    172172
    173173        core_workq_enqueue(&work->work_item, reproduce);
    174        
     174
    175175        size_t sleep_cnt = 0;
    176176        /* At least 40 seconds total (or 2 sec to end while there's work). */
    177177        size_t max_sleep_secs = end_prematurely ? 2 : MAIN_MAX_SLEEP_SEC;
    178178        size_t max_sleep_cnt = (max_sleep_secs * 1000) / MAIN_POLL_SLEEP_MS;
    179        
     179
    180180        for (int i = 0; i < WAVES; ++i) {
    181181                while (atomic_get(&call_cnt[i]) < exp_call_cnt
     
    186186                }
    187187        }
    188        
     188
    189189        bool success = true;
    190        
     190
    191191        for (int i = 0; i < WAVES; ++i) {
    192192                if (atomic_get(&call_cnt[i]) == exp_call_cnt) {
     
    199199                }
    200200        }
    201        
    202        
     201
     202
    203203        if (success)
    204204                return NULL;
Note: See TracChangeset for help on using the changeset viewer.