Changeset b72efe8 in mainline for uspace/srv/ns


Ignore:
Timestamp:
2011-06-19T14:38:59Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
74464e8
Parents:
1d1bb0f
Message:

Separate list_t typedef from link_t (user-space part).

  • list_t represents lists
  • Use list_first(), list_last(), list_empty() where appropriate
  • Use list_foreach() where possible
  • assert_link_not_used()
  • usb_hid_report_path_free() shall not unlink the path, caller must do it
Location:
uspace/srv/ns
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/ns/clonable.c

    r1d1bb0f rb72efe8  
    5252
    5353/** List of clonable-service connection requests. */
    54 static link_t cs_req;
     54static list_t cs_req;
    5555
    5656int clonable_init(void)
     
    7676    ipc_callid_t callid)
    7777{
    78         if (list_empty(&cs_req)) {
     78        link_t *req_link;
     79
     80        req_link = list_first(&cs_req);
     81        if (req_link == NULL) {
    7982                /* There was no pending connection request. */
    8083                printf("%s: Unexpected clonable server.\n", NAME);
     
    8386        }
    8487       
    85         cs_req_t *csr = list_get_instance(cs_req.next, cs_req_t, link);
    86         list_remove(&csr->link);
     88        cs_req_t *csr = list_get_instance(req_link, cs_req_t, link);
     89        list_remove(req_link);
    8790       
    8891        /* Currently we can only handle a single type of clonable service. */
  • uspace/srv/ns/service.c

    r1d1bb0f rb72efe8  
    123123} pending_conn_t;
    124124
    125 static link_t pending_conn;
     125static list_t pending_conn;
    126126
    127127int service_init(void)
     
    141141void process_pending_conn(void)
    142142{
    143         link_t *cur;
    144        
    145143loop:
    146         for (cur = pending_conn.next; cur != &pending_conn; cur = cur->next) {
     144        list_foreach(pending_conn, cur) {
    147145                pending_conn_t *pr = list_get_instance(cur, pending_conn_t, link);
    148146               
  • uspace/srv/ns/task.c

    r1d1bb0f rb72efe8  
    189189} pending_wait_t;
    190190
    191 static link_t pending_wait;
     191static list_t pending_wait;
    192192
    193193int task_init(void)
     
    212212void process_pending_wait(void)
    213213{
    214         link_t *cur;
    215214        task_exit_t texit;
    216215       
    217216loop:
    218         for (cur = pending_wait.next; cur != &pending_wait; cur = cur->next) {
     217        list_foreach(pending_wait, cur) {
    219218                pending_wait_t *pr = list_get_instance(cur, pending_wait_t, link);
    220219               
Note: See TracChangeset for help on using the changeset viewer.