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

    r3061bc1 ra35b458  
    257257{
    258258        log_msg(LOG_DEFAULT, LVL_DEBUG, "inetcfg_addr_create_static_srv()");
    259        
     259
    260260        sysarg_t link_id = IPC_GET_ARG1(*icall);
    261        
     261
    262262        ipc_callid_t callid;
    263263        size_t size;
     
    267267                return;
    268268        }
    269        
     269
    270270        if (size != sizeof(inet_naddr_t)) {
    271271                async_answer_0(callid, EINVAL);
     
    273273                return;
    274274        }
    275        
     275
    276276        inet_naddr_t naddr;
    277277        errno_t rc = async_data_write_finalize(callid, &naddr, size);
     
    281281                return;
    282282        }
    283        
     283
    284284        char *name;
    285285        rc = async_data_write_accept((void **) &name, true, 0, LOC_NAME_MAXLEN,
     
    289289                return;
    290290        }
    291        
     291
    292292        sysarg_t addr_id = 0;
    293293        rc = inetcfg_addr_create_static(name, &naddr, link_id, &addr_id);
     
    312312{
    313313        log_msg(LOG_DEFAULT, LVL_DEBUG, "inetcfg_addr_get_srv()");
    314        
     314
    315315        sysarg_t addr_id = IPC_GET_ARG1(*icall);
    316        
     316
    317317        inet_addr_info_t ainfo;
    318        
     318
    319319        inet_naddr_any(&ainfo.naddr);
    320320        ainfo.ilink = 0;
    321321        ainfo.name = NULL;
    322        
     322
    323323        errno_t rc = inetcfg_addr_get(addr_id, &ainfo);
    324324        if (rc != EOK) {
     
    326326                return;
    327327        }
    328        
     328
    329329        ipc_callid_t callid;
    330330        size_t size;
     
    334334                return;
    335335        }
    336        
     336
    337337        if (size != sizeof(inet_naddr_t)) {
    338338                async_answer_0(callid, EINVAL);
     
    340340                return;
    341341        }
    342        
     342
    343343        rc = async_data_read_finalize(callid, &ainfo.naddr, size);
    344344        if (rc != EOK) {
     
    347347                return;
    348348        }
    349        
     349
    350350        if (!async_data_read_receive(&callid, &size)) {
    351351                async_answer_0(callid, EREFUSED);
     
    353353                return;
    354354        }
    355        
     355
    356356        rc = async_data_read_finalize(callid, ainfo.name,
    357357            min(size, str_size(ainfo.name)));
    358358        free(ainfo.name);
    359        
    360         if (rc != EOK) {
    361                 async_answer_0(callid, rc);
    362                 async_answer_0(iid, rc);
    363                 return;
    364         }
    365        
     359
     360        if (rc != EOK) {
     361                async_answer_0(callid, rc);
     362                async_answer_0(iid, rc);
     363                return;
     364        }
     365
    366366        async_answer_1(iid, rc, ainfo.ilink);
    367367}
     
    584584                return;
    585585        }
    586        
     586
    587587        if (size != sizeof(inet_naddr_t)) {
    588588                async_answer_0(callid, EINVAL);
     
    590590                return;
    591591        }
    592        
     592
    593593        inet_naddr_t dest;
    594594        errno_t rc = async_data_write_finalize(callid, &dest, size);
     
    598598                return;
    599599        }
    600        
     600
    601601        if (!async_data_write_receive(&callid, &size)) {
    602602                async_answer_0(callid, EINVAL);
     
    604604                return;
    605605        }
    606        
     606
    607607        if (size != sizeof(inet_addr_t)) {
    608608                async_answer_0(callid, EINVAL);
     
    610610                return;
    611611        }
    612        
     612
    613613        inet_addr_t router;
    614614        rc = async_data_write_finalize(callid, &router, size);
     
    618618                return;
    619619        }
    620        
     620
    621621        char *name;
    622622        rc = async_data_write_accept((void **) &name, true, 0, LOC_NAME_MAXLEN,
     
    626626                return;
    627627        }
    628        
     628
    629629        sysarg_t sroute_id = 0;
    630630        rc = inetcfg_sroute_create(name, &dest, &router, &sroute_id);
     
    649649{
    650650        log_msg(LOG_DEFAULT, LVL_DEBUG, "inetcfg_sroute_get_srv()");
    651        
     651
    652652        sysarg_t sroute_id = IPC_GET_ARG1(*icall);
    653        
     653
    654654        inet_sroute_info_t srinfo;
    655        
     655
    656656        inet_naddr_any(&srinfo.dest);
    657657        inet_addr_any(&srinfo.router);
    658658        srinfo.name = NULL;
    659        
     659
    660660        errno_t rc = inetcfg_sroute_get(sroute_id, &srinfo);
    661661        if (rc != EOK) {
     
    663663                return;
    664664        }
    665        
     665
    666666        ipc_callid_t callid;
    667667        size_t size;
     
    671671                return;
    672672        }
    673        
     673
    674674        if (size != sizeof(inet_naddr_t)) {
    675675                async_answer_0(callid, EINVAL);
     
    677677                return;
    678678        }
    679        
     679
    680680        rc = async_data_read_finalize(callid, &srinfo.dest, size);
    681681        if (rc != EOK) {
     
    684684                return;
    685685        }
    686        
     686
    687687        if (!async_data_read_receive(&callid, &size)) {
    688688                async_answer_0(callid, EREFUSED);
     
    690690                return;
    691691        }
    692        
     692
    693693        if (size != sizeof(inet_addr_t)) {
    694694                async_answer_0(callid, EINVAL);
     
    696696                return;
    697697        }
    698        
     698
    699699        rc = async_data_read_finalize(callid, &srinfo.router, size);
    700700        if (rc != EOK) {
     
    703703                return;
    704704        }
    705        
     705
    706706        if (!async_data_read_receive(&callid, &size)) {
    707707                async_answer_0(callid, EREFUSED);
     
    709709                return;
    710710        }
    711        
     711
    712712        rc = async_data_read_finalize(callid, srinfo.name,
    713713            min(size, str_size(srinfo.name)));
    714714        free(srinfo.name);
    715        
     715
    716716        async_answer_0(iid, rc);
    717717}
Note: See TracChangeset for help on using the changeset viewer.