Changeset a35b458 in mainline for kernel/test/mm/falloc2.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/test/mm/falloc2.c

    r3061bc1 ra35b458  
    5151{
    5252        uint8_t val = THREAD->tid % THREADS;
    53        
     53
    5454        uintptr_t *frames = (uintptr_t *)
    5555            malloc(MAX_FRAMES * sizeof(uintptr_t), FRAME_ATOMIC);
     
    6161                return;
    6262        }
    63        
     63
    6464        thread_detach(THREAD);
    65        
     65
    6666        for (unsigned int run = 0; run < THREAD_RUNS; run++) {
    6767                for (size_t count = 1; count <= MAX_FRAMES; count++) {
    6868                        size_t bytes = FRAMES2SIZE(count);
    69                        
     69
    7070                        TPRINTF("Thread #%" PRIu64 " (cpu%u): "
    7171                            "Allocating %zu frames blocks (%zu bytes) ... \n", THREAD->tid,
    7272                            CPU->id, count, bytes);
    73                        
     73
    7474                        unsigned int allocated = 0;
    7575                        for (unsigned int i = 0; i < (MAX_FRAMES / count); i++) {
     
    8181                                        break;
    8282                        }
    83                        
     83
    8484                        TPRINTF("Thread #%" PRIu64 " (cpu%u): "
    8585                            "%u blocks allocated.\n", THREAD->tid, CPU->id,
     
    8787                        TPRINTF("Thread #%" PRIu64 " (cpu%u): "
    8888                            "Deallocating ... \n", THREAD->tid, CPU->id);
    89                        
     89
    9090                        for (unsigned int i = 0; i < allocated; i++) {
    9191                                for (size_t k = 0; k < bytes; k++) {
     
    101101                                frame_free(frames[i], count);
    102102                        }
    103                        
     103
    104104                        TPRINTF("Thread #%" PRIu64 " (cpu%u): "
    105105                            "Finished run.\n", THREAD->tid, CPU->id);
    106106                }
    107107        }
    108        
     108
    109109cleanup:
    110110        free(frames);
    111        
     111
    112112        TPRINTF("Thread #%" PRIu64 " (cpu%u): Exiting\n",
    113113            THREAD->tid, CPU->id);
     
    119119        atomic_set(&thread_count, THREADS);
    120120        atomic_set(&thread_fail, 0);
    121        
     121
    122122        for (unsigned int i = 0; i < THREADS; i++) {
    123123                thread_t *thrd = thread_create(falloc, NULL, TASK,
     
    129129                thread_ready(thrd);
    130130        }
    131        
     131
    132132        while (atomic_get(&thread_count) > 0) {
    133133                TPRINTF("Threads left: %" PRIua "\n",
     
    135135                thread_sleep(1);
    136136        }
    137        
     137
    138138        if (atomic_get(&thread_fail) == 0)
    139139                return NULL;
    140        
     140
    141141        return "Test failed";
    142142}
Note: See TracChangeset for help on using the changeset viewer.