Changeset a35b458 in mainline for uspace/srv/net/loopip/loopip.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/net/loopip/loopip.c

    r3061bc1 ra35b458  
    7777typedef struct {
    7878        link_t link;
    79        
     79
    8080        /* XXX Version should be part of SDU */
    8181        ip_ver_t ver;
     
    9090                rqueue_entry_t *rqe =
    9191                    list_get_instance(link, rqueue_entry_t, link);
    92                
     92
    9393                (void) iplink_ev_recv(&loopip_iplink, &rqe->sdu, rqe->ver);
    94                
     94
    9595                free(rqe->sdu.data);
    9696                free(rqe);
    9797        }
    98        
     98
    9999        return 0;
    100100}
     
    103103{
    104104        async_set_fallback_port_handler(loopip_client_conn, NULL);
    105        
     105
    106106        errno_t rc = loc_server_register(NAME);
    107107        if (rc != EOK) {
     
    109109                return rc;
    110110        }
    111        
     111
    112112        iplink_srv_init(&loopip_iplink);
    113113        loopip_iplink.ops = &loopip_iplink_ops;
    114114        loopip_iplink.arg = NULL;
    115        
     115
    116116        prodcons_initialize(&loopip_rcv_queue);
    117        
     117
    118118        const char *svc_name = "net/loopback";
    119119        service_id_t sid;
     
    124124                return rc;
    125125        }
    126        
     126
    127127        category_id_t iplink_cat;
    128128        rc = loc_category_get_id("iplink", &iplink_cat, IPC_FLAG_BLOCKING);
     
    131131                return rc;
    132132        }
    133        
     133
    134134        rc = loc_service_add_to_cat(sid, iplink_cat);
    135135        if (rc != EOK) {
     
    138138                return rc;
    139139        }
    140        
     140
    141141        fid_t fid = fibril_create(loopip_recv_fibril, NULL);
    142142        if (fid == 0)
    143143                return ENOMEM;
    144        
     144
    145145        fibril_add_ready(fid);
    146        
     146
    147147        return EOK;
    148148}
     
    169169{
    170170        log_msg(LOG_DEFAULT, LVL_DEBUG, "loopip_send()");
    171        
     171
    172172        rqueue_entry_t *rqe = calloc(1, sizeof(rqueue_entry_t));
    173173        if (rqe == NULL)
    174174                return ENOMEM;
    175        
     175
    176176        /*
    177177         * Clone SDU
     
    183183                return ENOMEM;
    184184        }
    185        
     185
    186186        memcpy(rqe->sdu.data, sdu->data, sdu->size);
    187187        rqe->sdu.size = sdu->size;
    188        
     188
    189189        /*
    190190         * Insert to receive queue
    191191         */
    192192        prodcons_produce(&loopip_rcv_queue, &rqe->link);
    193        
     193
    194194        return EOK;
    195195}
     
    198198{
    199199        log_msg(LOG_DEFAULT, LVL_DEBUG, "loopip6_send()");
    200        
     200
    201201        rqueue_entry_t *rqe = calloc(1, sizeof(rqueue_entry_t));
    202202        if (rqe == NULL)
    203203                return ENOMEM;
    204        
     204
    205205        /*
    206206         * Clone SDU
     
    212212                return ENOMEM;
    213213        }
    214        
     214
    215215        memcpy(rqe->sdu.data, sdu->data, sdu->size);
    216216        rqe->sdu.size = sdu->size;
    217        
     217
    218218        /*
    219219         * Insert to receive queue
    220220         */
    221221        prodcons_produce(&loopip_rcv_queue, &rqe->link);
    222        
     222
    223223        return EOK;
    224224}
     
    250250{
    251251        printf("%s: HelenOS loopback IP link provider\n", NAME);
    252        
     252
    253253        errno_t rc = log_init(NAME);
    254254        if (rc != EOK) {
     
    256256                return rc;
    257257        }
    258        
     258
    259259        rc = loopip_init();
    260260        if (rc != EOK) {
     
    262262                return rc;
    263263        }
    264        
     264
    265265        printf("%s: Accepting connections.\n", NAME);
    266266        task_retval(0);
    267267        async_manager();
    268        
     268
    269269        /* Not reached */
    270270        return 0;
Note: See TracChangeset for help on using the changeset viewer.