Changeset a35b458 in mainline for uspace/srv/bd/rd/rd.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
  • uspace/srv/bd/rd/rd.c

    r3061bc1 ra35b458  
    119119                return ELIMIT;
    120120        }
    121        
     121
    122122        fibril_rwlock_read_lock(&rd_lock);
    123123        memcpy(buf, rd_addr + ba * block_size, min(block_size * cnt, size));
    124124        fibril_rwlock_read_unlock(&rd_lock);
    125        
     125
    126126        return EOK;
    127127}
     
    135135                return ELIMIT;
    136136        }
    137        
     137
    138138        fibril_rwlock_write_lock(&rd_lock);
    139139        memcpy(rd_addr + ba * block_size, buf, min(block_size * cnt, size));
    140140        fibril_rwlock_write_unlock(&rd_lock);
    141        
     141
    142142        return EOK;
    143143}
     
    152152                return false;
    153153        }
    154        
     154
    155155        sysarg_t addr_phys;
    156156        ret = sysinfo_get_value("rd.address.physical", &addr_phys);
     
    159159                return false;
    160160        }
    161        
     161
    162162        rd_size = ALIGN_UP(size, block_size);
    163163        unsigned int flags =
    164164            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE;
    165        
     165
    166166        ret = physmem_map(addr_phys,
    167167            ALIGN_UP(rd_size, PAGE_SIZE) >> PAGE_WIDTH, flags, &rd_addr);
     
    170170                return false;
    171171        }
    172        
     172
    173173        printf("%s: Found RAM disk at %p, %" PRIun " bytes\n", NAME,
    174174            (void *) addr_phys, size);
    175        
     175
    176176        bd_srvs_init(&bd_srvs);
    177177        bd_srvs.ops = &rd_bd_ops;
    178        
     178
    179179        async_set_fallback_port_handler(rd_client_conn, NULL);
    180180        ret = loc_server_register(NAME);
     
    183183                return false;
    184184        }
    185        
     185
    186186        service_id_t service_id;
    187187        ret = loc_service_register("bd/initrd", &service_id);
     
    190190                return false;
    191191        }
    192        
     192
    193193        fibril_rwlock_initialize(&rd_lock);
    194        
     194
    195195        return true;
    196196}
     
    213213{
    214214        printf("%s: HelenOS RAM disk server\n", NAME);
    215        
     215
    216216        if (!rd_init())
    217217                return -1;
    218        
     218
    219219        printf("%s: Accepting connections\n", NAME);
    220220        async_manager();
    221        
     221
    222222        /* Never reached */
    223223        return 0;
Note: See TracChangeset for help on using the changeset viewer.