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

    r3061bc1 ra35b458  
    4242{
    4343        uintptr_t frame = frame_alloc(1, FRAME_NONE, 0);
    44        
     44
    4545        uintptr_t page0 = km_map(frame, FRAME_SIZE,
    4646            PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
    4747        TPRINTF("Virtual address %p mapped to physical address %p.\n",
    4848            (void *) page0, (void *) frame);
    49        
     49
    5050        uintptr_t page1 = km_map(frame, FRAME_SIZE,
    5151            PAGE_READ | PAGE_WRITE | PAGE_CACHEABLE);
    5252        TPRINTF("Virtual address %p mapped to physical address %p.\n",
    5353            (void *) page1, (void *) frame);
    54        
     54
    5555        for (unsigned int i = 0; i < 2; i++) {
    5656                TPRINTF("Writing magic using the first virtual address.\n");
    57                
     57
    5858                *((uint32_t *) page0) = TEST_MAGIC;
    59                
     59
    6060                TPRINTF("Reading magic using the second virtual address.\n");
    61                
     61
    6262                uint32_t v = *((uint32_t *) page1);
    63                
     63
    6464                if (v != TEST_MAGIC) {
    6565                        km_unmap(page0, PAGE_SIZE);
     
    6868                        return "Criss-cross read does not match the value written.";
    6969                }
    70                
     70
    7171                TPRINTF("Writing zero using the second virtual address.\n");
    72                
     72
    7373                *((uint32_t *) page1) = 0;
    74                
     74
    7575                TPRINTF("Reading zero using the first virtual address.\n");
    76                
     76
    7777                v = *((uint32_t *) page0);
    78                
     78
    7979                if (v != 0) {
    8080                        km_unmap(page0, PAGE_SIZE);
     
    8484                }
    8585        }
    86        
     86
    8787        km_unmap(page0, PAGE_SIZE);
    8888        km_unmap(page1, PAGE_SIZE);
    8989        frame_free(frame, 1);
    90        
     90
    9191        return NULL;
    9292}
Note: See TracChangeset for help on using the changeset viewer.