Changeset 22d990c in mainline


Ignore:
Timestamp:
2020-01-11T00:36:26Z (4 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
06599a1
Parents:
8a74512
Message:

Clean up code

Correcting order of includes. Remove unnecessary new lines. Removing
old function declaration. Typos.

Location:
uspace
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/proc/common.h

    r8a74512 r22d990c  
    4444#define STR_JOB_OK      "job-ok"
    4545
    46 #define DUMMY_TASK     "/root/app/tester"
     46#define DUMMY_TASK     "/app/tester"
    4747#define DUMMY_TASK_ARG "proc_dummy_task"
    4848
  • uspace/app/vlaunch/vlaunch.c

    r8a74512 r22d990c  
    7676        int retval;
    7777        rc = task_wait(&wait, NULL, &retval);
    78         if ((rc != EOK)) {
     78        if (rc != EOK) {
    7979                printf("%s: Error retrieving retval from %s (%s)\n", NAME,
    8080                    app, str_error(rc));
  • uspace/lib/c/generic/async/client.c

    r8a74512 r22d990c  
    191191
    192192        return session;
    193 }
    194 
    195 cap_phone_handle_t async_session_phone(async_sess_t *sess)
    196 {
    197         return sess->phone;
    198193}
    199194
  • uspace/lib/c/generic/async/server.c

    r8a74512 r22d990c  
    390390 *                    calls routed through that phone.
    391391 * @param in_task_id  Identification of the incoming connection.
    392  * @param call        Call data of the opening call. If call is NULL, it's
    393  *                    either a callback connection that was opened by
    394  *                    accepting the IPC_M_CONNECT_TO_ME call.
     392 * @param call        Call data of the opening call. If call is NULL, the
     393 *                    connection was opened by accepting the
     394 *                    IPC_M_CONNECT_TO_ME call and this function is called
     395 *                    directly by the server.
    395396 * @param handler     Connection handler.
    396397 * @param data        Client argument to pass to the connection handler.
     
    967968
    968969        // TODO: Log the error.
     970
    969971        if (call->cap_handle != CAP_NIL)
    970972                /* Unknown call from unknown phone - hang it up */
     
    17401742        async_sess_t *sess = create_session(phandle, mgmt, 0, 0, 0);
    17411743        if (sess == NULL) {
    1742                 ipc_hangup(phandle);
    1743                 async_answer_0(&call, errno);
     1744                async_answer_0(&call, ENOMEM);
    17441745        } else {
    17451746                /* Acknowledge the connected phone */
  • uspace/lib/c/generic/inetping.c

    r8a74512 r22d990c  
    6060        inetping_sess = loc_service_connect(inetping_svc, INTERFACE_INETPING,
    6161            IPC_AUTOSTART);
    62 
    6362        if (inetping_sess == NULL)
    6463                return ENOENT;
  • uspace/lib/c/generic/libc.c

    r8a74512 r22d990c  
    5151#include "private/libc.h"
    5252#include "private/async.h"
     53#include "private/malloc.h"
    5354#include "private/io.h"
    5455#include "private/fibril.h"
    55 #include "private/malloc.h"
    5656#include "private/task.h"
    5757#include "private/taskman.h"
  • uspace/lib/c/generic/loader.c

    r8a74512 r22d990c  
    3333 */
    3434
    35 #include <async.h>
    36 #include <errno.h>
    3735#include <ipc/loader.h>
    3836#include <ipc/services.h>
    3937#include <ipc/taskman.h>
     38#include <ns.h>
     39#include <task.h>
     40#include <str.h>
    4041#include <libc.h>
     42#include <stdlib.h>
     43#include <async.h>
     44#include <errno.h>
     45#include <vfs/vfs.h>
    4146#include <loader/loader.h>
    42 #include <ns.h>
    43 #include <stdlib.h>
    44 #include <str.h>
    45 #include <task.h>
    46 #include <vfs/vfs.h>
    4747
    4848#include "private/loader.h"
  • uspace/lib/c/generic/loc.c

    r8a74512 r22d990c  
    325325        async_exch_t *exch;
    326326
    327         if ((flags & IPC_FLAG_BLOCKING))
     327        if (flags & IPC_FLAG_BLOCKING)
    328328                exch = loc_exchange_begin_blocking(INTERFACE_LOC_CONSUMER);
    329329        else {
  • uspace/lib/c/generic/private/async.h

    r8a74512 r22d990c  
    4242#include <time.h>
    4343#include <stdbool.h>
    44 #include <stdatomic.h>
    4544
    4645/** Session data */
     
    109108extern async_sess_t *create_session(cap_phone_handle_t, exch_mgmt_t,
    110109    sysarg_t, sysarg_t, sysarg_t);
    111 extern cap_phone_handle_t async_session_phone(async_sess_t *);
    112110
    113111#endif
  • uspace/lib/c/generic/task.c

    r8a74512 r22d990c  
    3535/** @file
    3636 */
    37 
     37#include <task.h>
     38#include <loader/loader.h>
     39#include <stdarg.h>
     40#include <str.h>
     41#include <macros.h>
    3842#include <assert.h>
    3943#include <async.h>
     
    4347#include <ipc/taskman.h>
    4448#include <libc.h>
    45 #include <loader/loader.h>
    46 #include <macros.h>
    47 #include <malloc.h>
    48 #include <stdarg.h>
    49 #include <str.h>
    50 #include <task.h>
    5149#include <taskman.h>
    5250#include <vfs/vfs.h>
     
    424422        wait.flags = flags;
    425423        errno_t rc = task_setup_wait(id, &wait);
    426 
    427424        if (rc != EOK)
    428425                return rc;
  • uspace/lib/c/include/async.h

    r8a74512 r22d990c  
    131131extern void *async_get_client_data_by_id(task_id_t);
    132132extern void async_put_client_data_by_id(task_id_t);
    133 
    134 extern void async_set_implicit_connection(async_port_handler_t);
    135133
    136134extern errno_t async_create_port(iface_t, async_port_handler_t, void *,
  • uspace/lib/c/include/ipc/taskman.h

    r8a74512 r22d990c  
    3939
    4040typedef enum {
     41        TASKMAN_NEW_TASK = IPC_FIRST_USER_METHOD,
     42        TASKMAN_CONNECT_TO_NS,
     43        TASKMAN_CONNECT_TO_LOADER
     44} taskman_connection_t;
     45
     46typedef enum {
    4147        TASKMAN_WAIT = IPC_FIRST_USER_METHOD,
    4248        TASKMAN_RETVAL,
    4349        TASKMAN_EVENT_CALLBACK,
    44         TASKMAN_NEW_TASK,
    45 
    4650        TASKMAN_I_AM_NS,
    47         TASKMAN_I_AM_LOADER,
    48 
    49         TASKMAN_CONNECT_TO_NS,
    50         TASKMAN_CONNECT_TO_LOADER
     51        TASKMAN_I_AM_LOADER
    5152} taskman_request_t;
    5253
  • uspace/lib/c/include/task.h

    r8a74512 r22d990c  
    6868    __attribute__((sentinel));
    6969
     70extern void task_cancel_wait(task_wait_t *);
    7071extern errno_t task_wait(task_wait_t *, task_exit_t *, int *);
    7172extern errno_t task_wait_task_id(task_id_t, int, task_exit_t *, int *);
    72 
    73 extern void task_cancel_wait(task_wait_t *);
    7473
    7574extern errno_t task_retval(int);
  • uspace/lib/gui/window.c

    r8a74512 r22d990c  
    626626        async_sess_t *reg_sess =
    627627            loc_service_connect(reg_dsid, INTERFACE_COMPOSITOR, ipc_flags);
    628 
    629628        if (reg_sess == NULL) {
    630629                free(win);
     
    642641
    643642        win->osess = loc_service_connect(out_dsid, INTERFACE_COMPOSITOR, ipc_flags);
    644 
    645643        if (win->osess == NULL) {
    646644                free(win);
     
    649647
    650648        win->isess = loc_service_connect(in_dsid, INTERFACE_COMPOSITOR, ipc_flags);
    651 
    652649        if (win->isess == NULL) {
    653650                async_hangup(win->osess);
  • uspace/srv/devman/driver.c

    r8a74512 r22d990c  
    3636#include <io/log.h>
    3737#include <vfs/vfs.h>
    38 #include <dirent.h>
    3938#include <loc.h>
     39#include <str_error.h>
    4040#include <stdio.h>
    41 #include <str_error.h>
    4241#include <sysman/ctl.h>
    4342#include <task.h>
  • uspace/srv/devman/drv_conn.c

    r8a74512 r22d990c  
    3636
    3737#include <assert.h>
     38#include <ipc/services.h>
     39#include <ns.h>
    3840#include <async.h>
     41#include <stdio.h>
    3942#include <errno.h>
     43#include <str_error.h>
     44#include <stdbool.h>
    4045#include <fibril_synch.h>
     46#include <stdlib.h>
     47#include <str.h>
    4148#include <io/log.h>
    4249#include <ipc/devman.h>
    43 #include <ipc/services.h>
    4450#include <loc.h>
    45 #include <ns.h>
    46 #include <stdbool.h>
    47 #include <stdio.h>
    48 #include <stdlib.h>
    49 #include <str.h>
    50 #include <str_error.h>
    5151#include <sysman/broker.h>
    5252
  • uspace/srv/hid/compositor/compositor.c

    r8a74512 r22d990c  
    22672267        if (!list_empty(&viewport_list))
    22682268                input_activate(input);
     2269
    22692270ret:
    22702271        fibril_mutex_unlock(&discovery_mtx);
  • uspace/srv/loader/main.c

    r8a74512 r22d990c  
    3939 * loader.
    4040 *
    41  * The apparent caller uses his phone to send the pathname and various other
     41 * The apparent caller uses its phone to send the pathname and various other
    4242 * information to the loader. This is normally done by the C library
    4343 * and completely hidden from applications.
     
    4949#include <stddef.h>
    5050#include <ipc/services.h>
     51#include <ipc/loader.h>
     52#include <ns.h>
     53#include <loader/pcb.h>
     54#include <entry_point.h>
     55#include <errno.h>
     56#include <async.h>
     57#include <str.h>
    5158#include <as.h>
    52 #include <async.h>
    5359#include <elf/elf.h>
    5460#include <elf/elf_load.h>
    55 #include <entry_point.h>
    56 #include <errno.h>
    5761#include <fibril_synch.h>
    58 #include <ipc/loader.h>
    59 #include <loader/pcb.h>
    60 #include <ns.h>
    61 #include <str.h>
    6262#include <task.h>
    6363#include <taskman.h>
  • uspace/srv/locsrv/locsrv.c

    r8a74512 r22d990c  
    3636 */
    3737
    38 #include <assert.h>
     38#include <ipc/services.h>
     39#include <ns.h>
    3940#include <async.h>
     41#include <stdio.h>
    4042#include <errno.h>
    41 #include <ipc/loc.h>
    42 #include <ipc/services.h>
     43#include <stdbool.h>
    4344#include <fibril_synch.h>
    4445#include <macros.h>
    45 #include <ns.h>
    46 #include <stdbool.h>
    47 #include <stdio.h>
    4846#include <stdlib.h>
    4947#include <str.h>
    5048#include <str_error.h>
     49#include <ipc/loc.h>
     50#include <assert.h>
    5151#include <sysman/broker.h>
    5252#include <sysman/ctl.h>
  • uspace/srv/logger/main.c

    r8a74512 r22d990c  
    8383
    8484        printf("%s: Accepting connections\n", NAME);
    85 
    8685        task_retval(EOK);
    8786        async_manager();
  • uspace/srv/ns/ns.c

    r8a74512 r22d990c  
    132132                return rc;
    133133        }
     134
    134135        task_retval(0);
    135 
    136136        printf("%s: Accepting connections\n", NAME);
    137 
    138137        async_manager();
    139138
  • uspace/srv/taskman/task.h

    r8a74512 r22d990c  
    6969        /* Link to listeners list. */
    7070        link_t listeners;
    71         /* Session for notifications to task. */
     71        /* Session for sending event notifications to registrar. */
    7272        async_sess_t *sess;
    7373} task_t;
  • uspace/srv/vfs/Makefile

    r8a74512 r22d990c  
    3030USPACE_PREFIX = ../..
    3131LIBS = sysman
    32 EXTRA_CFLAGS += -I$(USPACE_PREFIX)/lib/sysman/include
    3332BINARY = vfs
    3433STATIC_NEEDED = y
  • uspace/srv/vfs/vfs.c

    r8a74512 r22d990c  
    4141#include <abi/ipc/methods.h>
    4242#include <ns.h>
    43 #include <as.h>
    4443#include <async.h>
    4544#include <stdatomic.h>
     
    4847#include <stdio.h>
    4948#include <ipc/services.h>
    50 #include <macros.h>
    5149#include <stdbool.h>
    5250#include <stdio.h>
    5351#include <str.h>
     52#include <as.h>
     53#include <macros.h>
    5454#include <sysman/broker.h>
     55
    5556#include "vfs.h"
    5657
  • uspace/srv/vfs/vfs.h

    r8a74512 r22d990c  
    178178extern fs_handle_t fs_name_to_handle(const char *, unsigned int instance, bool);
    179179extern vfs_info_t *fs_handle_to_info(fs_handle_t);
    180 extern int vfs_get_fstypes(vfs_fstypes_t *);
     180extern errno_t vfs_get_fstypes(vfs_fstypes_t *);
    181181extern errno_t fs_unit_name(const char *, unsigned int, char **);
    182182
  • uspace/srv/vfs/vfs_register.c

    r8a74512 r22d990c  
    3636 */
    3737
     38#include <ipc/services.h>
     39#include <async.h>
     40#include <fibril.h>
     41#include <fibril_synch.h>
     42#include <errno.h>
     43#include <stdio.h>
     44#include <stdlib.h>
     45#include <str.h>
     46#include <ctype.h>
     47#include <stdbool.h>
    3848#include <adt/list.h>
    3949#include <as.h>
    4050#include <assert.h>
    41 #include <async.h>
    4251#include <stdatomic.h>
    43 #include <ctype.h>
    44 #include <errno.h>
    45 #include <fibril.h>
    46 #include <fibril_synch.h>
    47 #include <ipc/services.h>
    48 #include <stdbool.h>
    49 #include <stdio.h>
    50 #include <stdlib.h>
    51 #include <str.h>
    5252#include <sysman/broker.h>
    5353#include "vfs.h"
Note: See TracChangeset for help on using the changeset viewer.