From e17bb2f5995d261790c453d81a453d25024450d1 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Mon, 13 May 2024 17:06:07 +1400
Subject: [PATCH 087/108] code improve

Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
 src/client/connect/protocol_type.c            |  2 +-
 src/cmd/isula/base/create.c                   |  3 +-
 src/cmd/isula/inspect_format.c                |  4 +-
 src/cmd/isulad-shim/common.c                  |  2 +-
 src/cmd/isulad-shim/main.c                    |  5 +-
 src/cmd/isulad-shim/process.c                 | 18 +++----
 src/daemon/common/cgroup/cgroup.c             |  9 ++--
 src/daemon/common/cgroup/cgroup.h             |  9 ++--
 src/daemon/common/cgroup/cgroup_common.h      |  9 ++--
 src/daemon/common/cgroup/cgroup_v1.c          | 10 ++--
 src/daemon/common/cgroup/cgroup_v2.c          |  9 ++--
 src/daemon/common/cri/cri_helpers.cc          |  4 +-
 src/daemon/common/cri/v1/v1_cri_helpers.cc    | 11 ++--
 src/daemon/common/sysinfo.c                   |  4 +-
 src/daemon/config/isulad_config.c             |  2 +-
 .../cri/v1/cri_v1_runtime_runtime_service.cc  |  5 +-
 .../v1/v1_cri_container_manager_service.cc    |  3 +-
 .../v1/v1_cri_pod_sandbox_manager_service.cc  |  8 +--
 .../v1/v1_cri_pod_sandbox_manager_service.h   |  6 ++-
 .../cri/v1/v1_cri_runtime_service_impl.cc     |  3 +-
 .../cri/v1/v1_cri_runtime_service_impl.h      |  3 +-
 .../executor/container_cb/execution_create.c  |  2 +-
 src/daemon/mailbox/mailbox.c                  |  3 +-
 src/daemon/mailbox/mailbox.h                  |  4 +-
 src/daemon/mailbox/mailbox_message.c          |  9 ++--
 src/daemon/mailbox/mailbox_message.h          |  4 +-
 src/daemon/modules/api/container_api.h        |  3 +-
 src/daemon/modules/api/network_api.h          |  2 +-
 .../modules/container/supervisor/supervisor.c |  3 +-
 .../device/cdi/behavior/cdi_container_edits.c | 46 ++++++++--------
 .../modules/device/cdi/behavior/cdi_device.c  | 16 +++---
 .../modules/device/cdi/behavior/cdi_spec.c    | 10 ++--
 .../modules/device/cdi/behavior/cdi_spec.h    |  2 +-
 .../device/cdi/behavior/cdi_spec_dirs.c       |  6 +--
 .../device/cdi/behavior/cdi_spec_dirs.h       |  2 +-
 .../modules/device/cdi/behavior/cdi_version.c |  2 +-
 .../device/cdi/behavior/parser/cdi_parser.c   |  6 +--
 src/daemon/modules/device/cdi/cdi_cache.c     | 22 ++++----
 src/daemon/modules/device/cdi/cdi_cache.h     |  6 +--
 src/daemon/modules/device/cdi_operate.c       |  8 +--
 src/daemon/modules/image/oci/oci_image.c      |  3 +-
 src/daemon/modules/image/oci/progress.h       |  2 +-
 .../modules/image/oci/registry/registry.c     |  3 +-
 .../cni_operator/libcni/invoke/libcni_exec.h  |  2 +-
 src/daemon/modules/network/cri/adaptor_cri.c  |  2 +-
 src/daemon/modules/network/cri/adaptor_cri.h  |  4 +-
 .../modules/runtime/engines/lcr/lcr_rt_ops.c  |  6 ++-
 .../modules/runtime/isula/isula_rt_ops.c      |  9 ++--
 .../modules/service/service_container.c       |  5 +-
 src/daemon/modules/spec/specs.c               | 52 ++++++++++---------
 src/daemon/modules/spec/specs_mount.c         |  4 +-
 src/utils/cutils/blocking_queue.c             |  3 +-
 src/utils/cutils/network_namespace.h          |  4 +-
 src/utils/cutils/utils_array.c                | 12 ++---
 src/utils/cutils/utils_port.h                 |  2 +-
 src/utils/cutils/utils_verify.c               |  4 +-
 src/utils/progress/show.h                     |  8 +--
 src/utils/tar/isulad_tar.c                    |  2 +-
 test/cgroup/cpu/cgroup_cpu_ut.cc              |  2 +-
 59 files changed, 223 insertions(+), 191 deletions(-)

diff --git a/src/client/connect/protocol_type.c b/src/client/connect/protocol_type.c
index 4d530aea..57dcf753 100644
--- a/src/client/connect/protocol_type.c
+++ b/src/client/connect/protocol_type.c
@@ -72,7 +72,7 @@ int isula_filters_last_parse_args(size_t last_n, struct isula_filters **flt)
         goto cleanup;
     }
 
-    ret = snprintf(value, VALUE_SIZE, "%ld", last_n);
+    ret = snprintf(value, VALUE_SIZE, "%lu", last_n);
     if (ret < 0 || ret >= VALUE_SIZE) {
         ret = -1;
         ERROR("Sprintf lastest n containers args failed");
diff --git a/src/cmd/isula/base/create.c b/src/cmd/isula/base/create.c
index b8e3667e..543b8fd6 100644
--- a/src/cmd/isula/base/create.c
+++ b/src/cmd/isula/base/create.c
@@ -932,7 +932,8 @@ inline static int request_pack_host_device_cgroup_rules(const struct client_argu
 
 inline static int request_pack_host_blockio(const struct client_arguments *args, isula_host_config_t *hostconfig)
 {
-    return (request_pack_host_weight_devices(args, hostconfig) != 0 || request_pack_host_device_read_bps(args, hostconfig) != 0 ||
+    return (request_pack_host_weight_devices(args, hostconfig) != 0 ||
+            request_pack_host_device_read_bps(args, hostconfig) != 0 ||
             request_pack_host_device_write_bps(args, hostconfig) != 0 ||
             request_pack_host_device_read_iops(args, hostconfig) != 0 ||
             request_pack_host_device_write_iops(args, hostconfig) != 0);
diff --git a/src/cmd/isula/inspect_format.c b/src/cmd/isula/inspect_format.c
index 36e8a31c..1fd67924 100644
--- a/src/cmd/isula/inspect_format.c
+++ b/src/cmd/isula/inspect_format.c
@@ -26,12 +26,12 @@
 
 #define PRINTF_TAB_LEN 4
 #define TOP_LEVEL_OBJ 0x10
-#define IS_TOP_LEVEL_OBJ(value) ((value)&TOP_LEVEL_OBJ)
+#define IS_TOP_LEVEL_OBJ(value) ((value) & TOP_LEVEL_OBJ)
 
 #define LAST_ELEMENT_BIT 0x0F
 #define NOT_LAST_ELEMENT 0x00
 #define LAST_ELEMENT 0x01
-#define IS_LAST_ELEMENT(value) (LAST_ELEMENT == ((value)&LAST_ELEMENT_BIT))
+#define IS_LAST_ELEMENT(value) (LAST_ELEMENT == ((value) & LAST_ELEMENT_BIT))
 
 #define YAJL_TYPEOF(json) ((json)->type)
 
diff --git a/src/cmd/isulad-shim/common.c b/src/cmd/isulad-shim/common.c
index a288c170..799da3c2 100644
--- a/src/cmd/isulad-shim/common.c
+++ b/src/cmd/isulad-shim/common.c
@@ -40,7 +40,7 @@
 static __thread char *g_shim_errmsg = NULL;
 
 // currently, log_to_stderr is only modified in the main process
-// and there is no need to set a thread-local variable. 
+// and there is no need to set a thread-local variable.
 // if it can be modified by multiple threads in the future,
 // this variable needs to be set as a thread-local variable.
 static bool log_to_stderr = false;
diff --git a/src/cmd/isulad-shim/main.c b/src/cmd/isulad-shim/main.c
index 54876d44..9061e568 100644
--- a/src/cmd/isulad-shim/main.c
+++ b/src/cmd/isulad-shim/main.c
@@ -103,7 +103,7 @@ int main(int argc, char **argv)
     engine_log_path = getenv(SHIIM_LOG_PATH_ENV);
     if (engine_log_path == NULL) {
         dprintf(STDERR_FILENO, "empty SHIIM_LOG_PATH_ENV");
-         _exit(EXIT_FAILURE);
+        _exit(EXIT_FAILURE);
     }
 
     log_level = getenv(SHIIM_LOG_LEVEL_ENV);
@@ -149,7 +149,8 @@ int main(int argc, char **argv)
 
     // If isulad-shim is a child process of the isulad process,
     // print the log to stderr so that isulad can obtain the exit information of isulad-shim.
-    set_log_to_stderr((p->state->exec) && (p->state->isulad_stdin != NULL || p->state->isulad_stdout != NULL || p->state->isulad_stderr != NULL));
+    set_log_to_stderr((p->state->exec) && (p->state->isulad_stdin != NULL || p->state->isulad_stdout != NULL ||
+                                           p->state->isulad_stderr != NULL));
 
     /*
      * Open exit pipe
diff --git a/src/cmd/isulad-shim/process.c b/src/cmd/isulad-shim/process.c
index 6b5f8f7f..18fae03f 100644
--- a/src/cmd/isulad-shim/process.c
+++ b/src/cmd/isulad-shim/process.c
@@ -199,7 +199,7 @@ static int add_attach_terminal_fifos(const char *in, const char *out, const char
     struct isula_linked_list *node = NULL;
 
     bool invalid = (in != NULL && !fifo_exists(in)) || (out != NULL && !fifo_exists(out)) || (err != NULL &&
-                                                                                             !fifo_exists(err));
+                                                                                              !fifo_exists(err));
     if (invalid) {
         ERROR("File %s or %s or %s does not refer to a FIFO", in, out, err);
         return -1;
@@ -371,7 +371,7 @@ static int stdout_cb(int fd, uint32_t events, void *cbdata, isula_epoll_descr_t
     (void)memset(p->buf, 0, DEFAULT_IO_COPY_BUF);
 
     r_count = isula_file_read_nointr(fd, p->buf, DEFAULT_IO_COPY_BUF);
-    if (r_count <= 0 ) {
+    if (r_count <= 0) {
         isula_epoll_remove_handler(descr, fd);
         // fd cannot be closed here, which will cause the container process to exit abnormally
         // due to terminal fd receiving the sighup signal.
@@ -417,7 +417,7 @@ static int stderr_cb(int fd, uint32_t events, void *cbdata, isula_epoll_descr_t
     (void)memset(p->buf, 0, DEFAULT_IO_COPY_BUF);
 
     r_count = isula_file_read_nointr(fd, p->buf, DEFAULT_IO_COPY_BUF);
-    if (r_count <= 0 ) {
+    if (r_count <= 0) {
         isula_epoll_remove_handler(descr, fd);
         // fd cannot be closed here, which will cause the container process to exit abnormally
         // due to terminal fd receiving the sighup signal.
@@ -563,7 +563,7 @@ static int attach_cb(int fd, uint32_t events, void *cbdata, isula_epoll_descr_t
     // limit the number of attach connections to MAX_ATTACH_NUM
     if (isula_linked_list_len(p->attach_fifos) >= MAX_ATTACH_NUM) {
         ERROR("The number of attach connections exceeds the limit:%d, and this connection is rejected.",
-                             MAX_ATTACH_NUM);
+              MAX_ATTACH_NUM);
         goto out;
     }
 
@@ -934,8 +934,8 @@ static void *io_epoll_loop(void *data)
 
     (void)sem_post(&p->sem_mainloop);
 
-    // th frist epoll_loop will exit in the following scenarios: 
-    // 1. Receive sync fd event 
+    // th frist epoll_loop will exit in the following scenarios:
+    // 1. Receive sync fd event
     // 2. stdin fd receive EPOLLHUP event
     // 3. stdin fd read failed
     ret = isula_epoll_loop(&descr, -1);
@@ -945,8 +945,8 @@ static void *io_epoll_loop(void *data)
         error_exit(EXIT_FAILURE);
     }
 
-    // use a timeout epoll loop to ensure complete data reception 
-    // th second epoll_loop will exit in the following scenarios: 
+    // use a timeout epoll loop to ensure complete data reception
+    // th second epoll_loop will exit in the following scenarios:
     // 1. both stdout fd and stderr fd failed to read
     // 2. no event received within 100 milliseconds
     ret = isula_epoll_loop(&descr, 100);
@@ -1408,7 +1408,7 @@ static void exec_runtime_process(process_t *p, int exec_fd)
         // the standard streams of the child process are set to /dev/null to prevent incorrect information acquisition.
         if (isula_null_stdfds() != 0) {
             (void)dprintf(exec_fd, "failed to set std console to /dev/null");
-            exit(EXIT_FAILURE);           
+            exit(EXIT_FAILURE);
         }
     }
 
diff --git a/src/daemon/common/cgroup/cgroup.c b/src/daemon/common/cgroup/cgroup.c
index 007dbb70..71bf9801 100644
--- a/src/daemon/common/cgroup/cgroup.c
+++ b/src/daemon/common/cgroup/cgroup.c
@@ -82,9 +82,9 @@ int common_get_cgroup_version(void)
 }
 
 int common_get_cgroup_info(cgroup_mem_info_t *meminfo, cgroup_cpu_info_t *cpuinfo,
-                            cgroup_hugetlb_info_t *hugetlbinfo, cgroup_blkio_info_t *blkioinfo,
-                            cgroup_cpuset_info_t *cpusetinfo, cgroup_pids_info_t *pidsinfo,
-                            cgroup_files_info_t *filesinfo, bool quiet)
+                           cgroup_hugetlb_info_t *hugetlbinfo, cgroup_blkio_info_t *blkioinfo,
+                           cgroup_cpuset_info_t *cpusetinfo, cgroup_pids_info_t *pidsinfo,
+                           cgroup_files_info_t *filesinfo, bool quiet)
 {
     if (g_cgroup_ops.get_cgroup_info == NULL) {
         ERROR("Unimplemented get_cgroup_info ops");
@@ -197,7 +197,8 @@ char *common_convert_cgroup_path(const char *cgroup_path)
     return util_strdup_s(result);
 }
 
-cgroup_oom_handler_info_t *common_get_cgroup_oom_handler(int fd, const char *name, const char *cgroup_path, const char *exit_fifo)
+cgroup_oom_handler_info_t *common_get_cgroup_oom_handler(int fd, const char *name, const char *cgroup_path,
+                                                         const char *exit_fifo)
 {
     if (g_cgroup_ops.get_cgroup_oom_handler == NULL) {
         ERROR("Unimplmented get_cgroup_oom_handler op");
diff --git a/src/daemon/common/cgroup/cgroup.h b/src/daemon/common/cgroup/cgroup.h
index 8c76d99d..0bbb70a0 100644
--- a/src/daemon/common/cgroup/cgroup.h
+++ b/src/daemon/common/cgroup/cgroup.h
@@ -31,9 +31,9 @@ int cgroup_ops_init(void);
 
 int common_get_cgroup_version(void);
 int common_get_cgroup_info(cgroup_mem_info_t *meminfo, cgroup_cpu_info_t *cpuinfo,
-                            cgroup_hugetlb_info_t *hugetlbinfo, cgroup_blkio_info_t *blkioinfo,
-                            cgroup_cpuset_info_t *cpusetinfo, cgroup_pids_info_t *pidsinfo,
-                            cgroup_files_info_t *filesinfo, bool quiet);
+                           cgroup_hugetlb_info_t *hugetlbinfo, cgroup_blkio_info_t *blkioinfo,
+                           cgroup_cpuset_info_t *cpusetinfo, cgroup_pids_info_t *pidsinfo,
+                           cgroup_files_info_t *filesinfo, bool quiet);
 int common_get_cgroup_metrics(const char *cgroup_path, cgroup_metrics_t *cgroup_metrics);
 int common_get_cgroup_mnt_and_root_path(const char *subsystem, char **mountpoint, char **root);
 
@@ -43,7 +43,8 @@ char *common_get_own_cgroup_path(const char *subsystem);
 
 char *common_convert_cgroup_path(const char *cgroup_path);
 
-cgroup_oom_handler_info_t *common_get_cgroup_oom_handler(int fd, const char *name, const char *cgroup_path, const char *exit_fifo);
+cgroup_oom_handler_info_t *common_get_cgroup_oom_handler(int fd, const char *name, const char *cgroup_path,
+                                                         const char *exit_fifo);
 void common_free_cgroup_oom_handler_info(cgroup_oom_handler_info_t *info);
 
 #ifdef __cplusplus
diff --git a/src/daemon/common/cgroup/cgroup_common.h b/src/daemon/common/cgroup/cgroup_common.h
index e3912bf0..46a7de50 100644
--- a/src/daemon/common/cgroup/cgroup_common.h
+++ b/src/daemon/common/cgroup/cgroup_common.h
@@ -130,9 +130,9 @@ typedef struct _cgroup_oom_handler_info_t {
 typedef struct {
     int (*get_cgroup_version)(void);
     int (*get_cgroup_info)(cgroup_mem_info_t *meminfo, cgroup_cpu_info_t *cpuinfo,
-                            cgroup_hugetlb_info_t *hugetlbinfo, cgroup_blkio_info_t *blkioinfo,
-                            cgroup_cpuset_info_t *cpusetinfo, cgroup_pids_info_t *pidsinfo,
-                            cgroup_files_info_t *filesinfo, bool quiet);
+                           cgroup_hugetlb_info_t *hugetlbinfo, cgroup_blkio_info_t *blkioinfo,
+                           cgroup_cpuset_info_t *cpusetinfo, cgroup_pids_info_t *pidsinfo,
+                           cgroup_files_info_t *filesinfo, bool quiet);
     int (*get_cgroup_metrics)(const char *cgroup_path, cgroup_metrics_t *cgroup_metrics);
 
     int (*get_cgroup_mnt_and_root_path)(const char *subsystem, char **mountpoint, char **root);
@@ -140,7 +140,8 @@ typedef struct {
     char *(*get_init_cgroup_path)(const char *subsystem);
     char *(*get_own_cgroup_path)(const char *subsystem);
 
-    cgroup_oom_handler_info_t *(*get_cgroup_oom_handler)(int fd, const char *name, const char *cgroup_path, const char *exit_fifo);
+    cgroup_oom_handler_info_t *(*get_cgroup_oom_handler)(int fd, const char *name, const char *cgroup_path,
+                                                         const char *exit_fifo);
 } cgroup_ops;
 
 #ifdef __cplusplus
diff --git a/src/daemon/common/cgroup/cgroup_v1.c b/src/daemon/common/cgroup/cgroup_v1.c
index 41f3110a..45b1d096 100644
--- a/src/daemon/common/cgroup/cgroup_v1.c
+++ b/src/daemon/common/cgroup/cgroup_v1.c
@@ -772,7 +772,8 @@ static void get_cgroup_v1_blkio_info(const cgroup_layer_t *layers, const bool qu
     blkioinfo->blkio_write_iops_device = check_cgroup_v1_file_exists(mountpoint, BLKIO_WRITE_IOPS, quiet);
 }
 
-static void get_cgroup_v1_hugetlb_info(const cgroup_layer_t *layers, const bool quiet, cgroup_hugetlb_info_t *hugetlbinfo)
+static void get_cgroup_v1_hugetlb_info(const cgroup_layer_t *layers, const bool quiet,
+                                       cgroup_hugetlb_info_t *hugetlbinfo)
 {
     int nret;
     char *mountpoint = NULL;
@@ -1038,8 +1039,8 @@ static char *common_get_cgroup_path(const char *path, const char *subsystem)
 
     for (i = 0; i < util_array_len((const char **)nlist); i++) {
         const char *prefix = "name=";
-        bool find_sub = (strcmp(nlist[i], subsystem) == 0 || (strncmp(nlist[i], prefix, strlen(prefix)) == 0
-                        && strcmp(nlist[i]+strlen(prefix), subsystem) == 0));
+        bool find_sub = (strcmp(nlist[i], subsystem) == 0 || (strncmp(nlist[i], prefix, strlen(prefix)) == 0 &&
+                                                              strcmp(nlist[i] + strlen(prefix), subsystem) == 0));
         if (find_sub) {
             res = util_strdup_s(plist[i]);
             break;
@@ -1135,7 +1136,8 @@ static char *get_memory_cgroup_path_v1(const char *cgroup_path)
     return util_path_join(fpath, converted_cgroup_path);
 }
 
-static cgroup_oom_handler_info_t *get_cgroup_oom_handler_v1(int fd, const char *name, const char *cgroup_path, const char *exit_fifo)
+static cgroup_oom_handler_info_t *get_cgroup_oom_handler_v1(int fd, const char *name, const char *cgroup_path,
+                                                            const char *exit_fifo)
 {
     __isula_auto_free char *memory_cgroup_path = NULL;
     __isula_auto_free char *memory_cgroup_oom_control_path = NULL;
diff --git a/src/daemon/common/cgroup/cgroup_v2.c b/src/daemon/common/cgroup/cgroup_v2.c
index a36258f0..76754dc1 100644
--- a/src/daemon/common/cgroup/cgroup_v2.c
+++ b/src/daemon/common/cgroup/cgroup_v2.c
@@ -387,7 +387,7 @@ static int get_cgroup_info_v2(cgroup_mem_info_t *meminfo, cgroup_cpu_info_t *cpu
     if (ret != 0) {
         return ret;
     }
-    
+
     get_cgroup_v2_pids_info(quiet, pidsinfo);
     get_cgroup_v2_files_info(quiet, filesinfo);
 
@@ -433,7 +433,7 @@ static bool oom_cb_cgroup_v2(int fd, void *cbdata)
         return CGROUP_OOM_HANDLE_CLOSE;
     }
 
-    if (((struct inotify_event *)events)->mask & ( IN_DELETE | IN_DELETE_SELF)) {
+    if (((struct inotify_event *)events)->mask & (IN_DELETE | IN_DELETE_SELF)) {
         return CGROUP_OOM_HANDLE_CLOSE;
     }
 
@@ -450,7 +450,7 @@ static bool oom_cb_cgroup_v2(int fd, void *cbdata)
         int count;
         const char *oom_str = "oom ";
         const char *oom_kill_str = "oom_kill ";
-        const int oom_len = strlen(oom_str), oom_kill_len = strlen(oom_kill_str);
+        const size_t oom_len = strlen(oom_str), oom_kill_len = strlen(oom_kill_str);
 
         if (read >= oom_kill_len + 2 && memcmp(line, oom_kill_str, oom_kill_len) == 0) {
             len = oom_kill_len;
@@ -492,7 +492,8 @@ static char *get_real_cgroup_path_v2(const char *cgroup_path)
     return util_path_join(CGROUP_MOUNTPOINT, converted_cgroup_path);
 }
 
-cgroup_oom_handler_info_t *get_cgroup_oom_handler_v2(int fd, const char *name, const char *cgroup_path, const char *exit_fifo)
+cgroup_oom_handler_info_t *get_cgroup_oom_handler_v2(int fd, const char *name, const char *cgroup_path,
+                                                     const char *exit_fifo)
 {
     __isula_auto_free char *real_cgroup_path = NULL;
     if (name == NULL || cgroup_path == NULL || exit_fifo == NULL) {
diff --git a/src/daemon/common/cri/cri_helpers.cc b/src/daemon/common/cri/cri_helpers.cc
index d7ec9f36..68d569cc 100644
--- a/src/daemon/common/cri/cri_helpers.cc
+++ b/src/daemon/common/cri/cri_helpers.cc
@@ -550,8 +550,8 @@ void CreateContainerLogSymlink(const std::string &containerID, Errors &error)
         WARN("Deleted previously existing symlink file: %s", path.c_str());
     }
     if (symlink(realPath.c_str(), path.c_str()) != 0) {
-        SYSERROR("failed to create symbolic link %s to the container log file %s for container %s", path.c_str(), realPath.c_str(),
-                 containerID.c_str());
+        SYSERROR("failed to create symbolic link %s to the container log file %s for container %s", path.c_str(),
+                 realPath.c_str(), containerID.c_str());
         error.Errorf("failed to create symbolic link %s to the container log file %s for container %s", path.c_str(),
                      realPath.c_str(), containerID.c_str());
     }
diff --git a/src/daemon/common/cri/v1/v1_cri_helpers.cc b/src/daemon/common/cri/v1/v1_cri_helpers.cc
index 1f797ad7..478dd105 100644
--- a/src/daemon/common/cri/v1/v1_cri_helpers.cc
+++ b/src/daemon/common/cri/v1/v1_cri_helpers.cc
@@ -636,7 +636,8 @@ void ContainerStatusToGRPC(container_inspect *inspect,
     ConvertResourcesToStatus(inspect, contStatus);
 }
 
-std::unique_ptr<runtime::v1::ContainerStatus> GetContainerStatus(service_executor_t *m_cb, const std::string &containerID, Errors &error)
+std::unique_ptr<runtime::v1::ContainerStatus> GetContainerStatus(service_executor_t *m_cb,
+                                                                 const std::string &containerID, Errors &error)
 {
     if (m_cb == nullptr) {
         error.SetError("Invalid input arguments: empty service executor");
@@ -694,7 +695,7 @@ static int InsertCDIDevices(std::unordered_set<std::string> &fromCRI, const std:
     }
     return 0;
 }
- 
+
 void GenerateCDIRequestedDevices(const runtime::v1::ContainerConfig &config, host_config *hostconfig, Errors &err)
 {
     std::unordered_set<std::string> fromCRI;
@@ -703,13 +704,13 @@ void GenerateCDIRequestedDevices(const runtime::v1::ContainerConfig &config, hos
     __isula_auto_string_array_t string_array *devices = nullptr;
     json_map_string_string *annotations = nullptr;
     __isula_auto_free char *error = nullptr;
- 
+
     if (hostconfig == nullptr) {
         ERROR("Invalid input arguments");
         err.Errorf("Invalid input arguments");
         return;
     }
-    
+
     if (config.cdi_devices().empty() && config.annotations().empty()) {
         return;
     }
@@ -746,7 +747,7 @@ void GenerateCDIRequestedDevices(const runtime::v1::ContainerConfig &config, hos
     requested->items = nullptr;
     hostconfig->cdi_requested_devices_len = requested->len;
     requested->len = 0;
- 
+
 free_out:
     free_json_map_string_string(annotations);
 }
diff --git a/src/daemon/common/sysinfo.c b/src/daemon/common/sysinfo.c
index e369c3e3..ed1c01a3 100644
--- a/src/daemon/common/sysinfo.c
+++ b/src/daemon/common/sysinfo.c
@@ -384,8 +384,8 @@ sysinfo_t *get_sys_info(bool quiet)
     sysinfo->ncpus_conf = get_nprocs_conf();
 
     ret = common_get_cgroup_info(&sysinfo->cgmeminfo, &sysinfo->cgcpuinfo, &sysinfo->hugetlbinfo,
-                                        &sysinfo->blkioinfo, &sysinfo->cpusetinfo, &sysinfo->pidsinfo,
-                                        &sysinfo->filesinfo, quiet);
+                                 &sysinfo->blkioinfo, &sysinfo->cpusetinfo, &sysinfo->pidsinfo,
+                                 &sysinfo->filesinfo, quiet);
     if (ret != 0) {
         goto out;
     }
diff --git a/src/daemon/config/isulad_config.c b/src/daemon/config/isulad_config.c
index 617db7a2..80689bce 100644
--- a/src/daemon/config/isulad_config.c
+++ b/src/daemon/config/isulad_config.c
@@ -1839,7 +1839,7 @@ int merge_json_confs_into_global(struct service_arguments *args)
     args->json_confs->cdi_spec_dirs_len = tmp_json_confs->cdi_spec_dirs_len;
     tmp_json_confs->cdi_spec_dirs_len = 0;
 #endif /* ENABLE_CDI */
- 
+
 out:
     free(err);
     free_isulad_daemon_configs(tmp_json_confs);
diff --git a/src/daemon/entry/connect/grpc/cri/v1/cri_v1_runtime_runtime_service.cc b/src/daemon/entry/connect/grpc/cri/v1/cri_v1_runtime_runtime_service.cc
index fb5aad3c..f8df8e0a 100644
--- a/src/daemon/entry/connect/grpc/cri/v1/cri_v1_runtime_runtime_service.cc
+++ b/src/daemon/entry/connect/grpc/cri/v1/cri_v1_runtime_runtime_service.cc
@@ -90,7 +90,8 @@ void RuntimeV1RuntimeServiceImpl::Init(std::string &podSandboxImage,
         m_enablePodEvents = enablePodEvents;
     }
 
-    m_rService = std::unique_ptr<CRIV1::CRIRuntimeService>(new CRIRuntimeServiceImpl(podSandboxImage, cb, networkPlugin, m_enablePodEvents));
+    m_rService = std::unique_ptr<CRIV1::CRIRuntimeService>(new CRIRuntimeServiceImpl(podSandboxImage, cb, networkPlugin,
+                                                                                     m_enablePodEvents));
 }
 
 void RuntimeV1RuntimeServiceImpl::Wait()
@@ -134,7 +135,7 @@ auto RuntimeV1RuntimeServiceImpl::GenerateCRIContainerEvent(const char *containe
     m_rService->PodSandboxStatus(sandboxID, statusReply, error);
     if (!error.Empty()) {
         WARN("Object: CRI, Type: Failed to status pod:%s due to %s", sandboxID.c_str(),
-              error.GetMessage().c_str());
+             error.GetMessage().c_str());
     } else {
         *(response->mutable_pod_sandbox_status()) = *(statusReply->mutable_status());
         for (auto &containerStatus : statusReply->containers_statuses()) {
diff --git a/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc
index 1097c32c..1cee68ec 100644
--- a/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_container_manager_service.cc
@@ -1015,7 +1015,8 @@ cleanup:
     return contStats;
 }
 
-std::unique_ptr<runtime::v1::ContainerStatus> ContainerManagerService::ContainerStatus(const std::string &containerID, Errors &error)
+std::unique_ptr<runtime::v1::ContainerStatus> ContainerManagerService::ContainerStatus(const std::string &containerID,
+                                                                                       Errors &error)
 {
     return CRIHelpersV1::GetContainerStatus(m_cb, containerID, error);
 }
diff --git a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
index 4291d8a0..fa726e2c 100644
--- a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.cc
@@ -819,7 +819,8 @@ void PodSandboxManagerService::SetSandboxStatusNetwork(std::shared_ptr<sandbox::
 
 void PodSandboxManagerService::GetContainerStatuses(const std::string &podSandboxID,
                                                     std::vector<std::unique_ptr<runtime::v1::ContainerStatus>> &containerStatuses,
-                                                    std::vector<std::string> &errors) {
+                                                    std::vector<std::string> &errors)
+{
     auto list_response_wrapper = GetContainerListResponse(podSandboxID, errors);
     if (list_response_wrapper == nullptr) {
         return;
@@ -837,7 +838,8 @@ void PodSandboxManagerService::GetContainerStatuses(const std::string &podSandbo
     }
 }
 
-std::unique_ptr<runtime::v1::PodSandboxStatus> PodSandboxManagerService::GetPodSandboxStatus(const std::string &podSandboxID, Errors &error)
+std::unique_ptr<runtime::v1::PodSandboxStatus> PodSandboxManagerService::GetPodSandboxStatus(
+    const std::string &podSandboxID, Errors &error)
 {
     std::unique_ptr<runtime::v1::PodSandboxStatus> podStatus(new (std::nothrow) runtime::v1::PodSandboxStatus);
     if (podStatus == nullptr) {
@@ -876,7 +878,7 @@ void PodSandboxManagerService::PodSandboxStatus(const std::string &podSandboxID,
         return;
     }
 
- 
+
     auto podStatus = GetPodSandboxStatus(podSandboxID, error);
     if (error.NotEmpty()) {
         ERROR("Failed to get pod sandbox status: %s", error.GetCMessage());
diff --git a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.h b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.h
index 3872c4c9..d5c0cf91 100644
--- a/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.h
+++ b/src/daemon/entry/cri/v1/v1_cri_pod_sandbox_manager_service.h
@@ -129,8 +129,10 @@ private:
                              std::vector<std::string> &podSandboxIDs, Errors &error);
     void ApplySandboxLinuxOptions(const runtime::v1::LinuxPodSandboxConfig &lc, host_config *hc,
                                   container_config *custom_config, Errors &error);
-    auto GetPodSandboxStatus(const std::string &podSandboxID, Errors &error) -> std::unique_ptr<runtime::v1::PodSandboxStatus>;
-    void GetContainerStatuses(const std::string &podSandboxID, std::vector<std::unique_ptr<runtime::v1::ContainerStatus>> &containerStatuses,
+    auto GetPodSandboxStatus(const std::string &podSandboxID,
+                             Errors &error) -> std::unique_ptr<runtime::v1::PodSandboxStatus>;
+    void GetContainerStatuses(const std::string &podSandboxID,
+                              std::vector<std::unique_ptr<runtime::v1::ContainerStatus>> &containerStatuses,
                               std::vector<std::string> &errors);
 
 private:
diff --git a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.cc b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.cc
index 7b40e29d..56c89c1e 100644
--- a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.cc
+++ b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.cc
@@ -125,7 +125,8 @@ void CRIRuntimeServiceImpl::RemovePodSandbox(const std::string &podSandboxID, Er
     m_podSandboxManager->RemovePodSandbox(podSandboxID, error);
 }
 
-void CRIRuntimeServiceImpl::PodSandboxStatus(const std::string &podSandboxID, runtime::v1::PodSandboxStatusResponse *reply, Errors &error)
+void CRIRuntimeServiceImpl::PodSandboxStatus(const std::string &podSandboxID,
+                                             runtime::v1::PodSandboxStatusResponse *reply, Errors &error)
 {
     m_podSandboxManager->PodSandboxStatus(podSandboxID, reply, error);
 }
diff --git a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
index 6ae59bfa..3d93c7bb 100644
--- a/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
+++ b/src/daemon/entry/cri/v1/v1_cri_runtime_service_impl.h
@@ -73,7 +73,8 @@ public:
 
     void RemovePodSandbox(const std::string &podSandboxID, Errors &error) override;
 
-    void PodSandboxStatus(const std::string &podSandboxID, runtime::v1::PodSandboxStatusResponse *reply, Errors &error) override;
+    void PodSandboxStatus(const std::string &podSandboxID, runtime::v1::PodSandboxStatusResponse *reply,
+                          Errors &error) override;
 
     void ListPodSandbox(const runtime::v1::PodSandboxFilter &filter,
                         std::vector<std::unique_ptr<runtime::v1::PodSandbox>> &pods, Errors &error) override;
diff --git a/src/daemon/executor/container_cb/execution_create.c b/src/daemon/executor/container_cb/execution_create.c
index 785b4e27..8e930c8a 100644
--- a/src/daemon/executor/container_cb/execution_create.c
+++ b/src/daemon/executor/container_cb/execution_create.c
@@ -551,7 +551,7 @@ static int merge_config_for_syscontainer(const container_create_request *request
         goto out;
     }
     if (request->rootfs != NULL && (append_json_map_string_string(container_spec->annotations, "external.rootfs", "true")
-        || append_json_map_string_string(oci_spec->annotations, "external.rootfs", "true"))) {
+                                    || append_json_map_string_string(oci_spec->annotations, "external.rootfs", "true"))) {
         ERROR("Realloc annotations failed");
         ret = -1;
         goto out;
diff --git a/src/daemon/mailbox/mailbox.c b/src/daemon/mailbox/mailbox.c
index 732b91b9..39f003f3 100644
--- a/src/daemon/mailbox/mailbox.c
+++ b/src/daemon/mailbox/mailbox.c
@@ -23,7 +23,8 @@
 
 mailbox_topic_handler_t mailbox_topic_handlers[MAILBOX_TOPIC_MAX] = { 0 };
 
-static bool mailbox_topic_valid(mailbox_topic topic) {
+static bool mailbox_topic_valid(mailbox_topic topic)
+{
     return topic > MAILBOX_TOPIC_INVALID && topic < MAILBOX_TOPIC_MAX;
 }
 
diff --git a/src/daemon/mailbox/mailbox.h b/src/daemon/mailbox/mailbox.h
index 1dc2e934..aef63514 100644
--- a/src/daemon/mailbox/mailbox.h
+++ b/src/daemon/mailbox/mailbox.h
@@ -64,7 +64,7 @@ typedef struct {
     cri_container_message_type type;
 } cri_container_message_t;
 
-int mailbox_register_topic_handler(mailbox_topic topic, message_generator_t handle, void *context,
+int mailbox_register_topic_handler(mailbox_topic topic, message_generator_t generator, void *context,
                                    message_release_t release, bool async);
 
 void mailbox_unregister_topic_handler(mailbox_topic topic);
@@ -73,7 +73,7 @@ void mailbox_publish(mailbox_topic topic, void *data);
 
 message_subscriber *mailbox_subscribe(mailbox_topic topic);
 
-void mailbox_unsubscribe(mailbox_topic, message_subscriber *sub);
+void mailbox_unsubscribe(mailbox_topic topic, message_subscriber *sub);
 
 #ifdef __cplusplus
 }
diff --git a/src/daemon/mailbox/mailbox_message.c b/src/daemon/mailbox/mailbox_message.c
index b16a1bdd..316b7428 100644
--- a/src/daemon/mailbox/mailbox_message.c
+++ b/src/daemon/mailbox/mailbox_message.c
@@ -20,7 +20,8 @@
 #include "utils.h"
 
 // Once the create succeeds, the ownership is transferred to the mailbox_message.
-mailbox_message *mailbox_message_create(void *data, void (*destroy)(void *)) {
+mailbox_message *mailbox_message_create(void *data, void (*destroy)(void *))
+{
     __isula_auto_free mailbox_message *msg = NULL;
     msg = util_common_calloc_s(sizeof(mailbox_message));
     if (msg == NULL) {
@@ -40,7 +41,8 @@ mailbox_message *mailbox_message_create(void *data, void (*destroy)(void *)) {
     return isula_transfer_ptr(msg);
 }
 
-int mailbox_message_ref(mailbox_message *dest) {
+int mailbox_message_ref(mailbox_message *dest)
+{
     __isula_auto_pm_unlock pthread_mutex_t *lock = NULL;
     if (dest == NULL) {
         ERROR("Invalid mailbox_message");
@@ -63,7 +65,8 @@ int mailbox_message_ref(mailbox_message *dest) {
     return 0;
 }
 
-void mailbox_message_unref(mailbox_message *dest) {
+void mailbox_message_unref(mailbox_message *dest)
+{
     __isula_auto_pm_unlock pthread_mutex_t *lock = NULL;
     if (dest == NULL) {
         return;
diff --git a/src/daemon/mailbox/mailbox_message.h b/src/daemon/mailbox/mailbox_message.h
index 39e40b70..af323069 100644
--- a/src/daemon/mailbox/mailbox_message.h
+++ b/src/daemon/mailbox/mailbox_message.h
@@ -34,9 +34,9 @@ typedef struct mailbox_message {
 
 mailbox_message *mailbox_message_create(void *ptr, void (*destroy)(void *));
 
-int mailbox_message_ref(mailbox_message *p);
+int mailbox_message_ref(mailbox_message *dest);
 
-void mailbox_message_unref(mailbox_message *p);
+void mailbox_message_unref(mailbox_message *dest);
 
 // define auto free function callback for mailbox_message
 define_auto_cleanup_callback(mailbox_message_unref, mailbox_message);
diff --git a/src/daemon/modules/api/container_api.h b/src/daemon/modules/api/container_api.h
index 55c59980..a6ec8e22 100644
--- a/src/daemon/modules/api/container_api.h
+++ b/src/daemon/modules/api/container_api.h
@@ -271,7 +271,8 @@ bool container_is_valid_state_string(const char *state);
 
 void container_update_health_monitor(const char *container_id);
 
-extern int container_supervisor_add_exit_monitor(int fd, const char *exit_fifo, const pid_ppid_info_t *pid_info, const container_t *cont);
+extern int container_supervisor_add_exit_monitor(int fd, const char *exit_fifo, const pid_ppid_info_t *pid_info,
+                                                 const container_t *cont);
 
 extern char *container_exit_fifo_create(const char *cont_state_path);
 
diff --git a/src/daemon/modules/api/network_api.h b/src/daemon/modules/api/network_api.h
index 4c1e3480..fd8607b3 100644
--- a/src/daemon/modules/api/network_api.h
+++ b/src/daemon/modules/api/network_api.h
@@ -77,7 +77,7 @@ void free_network_api_result_list(network_api_result_list *ptr);
 
 void free_attach_net_conf(struct attach_net_conf *ptr);
 
-void free_network_api_conf(network_api_conf *ptr);
+void free_network_api_conf(network_api_conf *conf);
 
 bool network_module_init(const char *network_plugin, const char *cache_dir, const char *conf_dir, const char* bin_path);
 
diff --git a/src/daemon/modules/container/supervisor/supervisor.c b/src/daemon/modules/container/supervisor/supervisor.c
index 83d46268..39d9fdb8 100644
--- a/src/daemon/modules/container/supervisor/supervisor.c
+++ b/src/daemon/modules/container/supervisor/supervisor.c
@@ -307,7 +307,8 @@ static int oom_handle_cb(int fd, uint32_t events, void *cbdata, struct epoll_des
 }
 
 /* supervisor add exit monitor */
-int container_supervisor_add_exit_monitor(int fd, const char *exit_fifo, const pid_ppid_info_t *pid_info, const container_t *cont)
+int container_supervisor_add_exit_monitor(int fd, const char *exit_fifo, const pid_ppid_info_t *pid_info,
+                                          const container_t *cont)
 {
     int ret = 0;
     struct supervisor_handler_data *data = NULL;
diff --git a/src/daemon/modules/device/cdi/behavior/cdi_container_edits.c b/src/daemon/modules/device/cdi/behavior/cdi_container_edits.c
index 816b9c2d..d146f7e1 100644
--- a/src/daemon/modules/device/cdi/behavior/cdi_container_edits.c
+++ b/src/daemon/modules/device/cdi/behavior/cdi_container_edits.c
@@ -27,8 +27,8 @@
 #include "utils_array.h"
 #include "specs_api.h"
 
-/* 
- * The OCI being used by the iSulad not supportes 
+/*
+ * The OCI being used by the iSulad not supportes
  * createRuntime/createContainer/startContainer currently.
  */
 // PRESTART_HOOK is the name of the OCI "prestart" hook.
@@ -105,8 +105,8 @@ static int fill_device_node_info(cdi_device_node *d)
         dev_type = NULL;
     } else {
         if (strcmp(d->type, dev_type) != 0) {
-            ERROR("CDI device (%s, %s), host type mismatch (%s, %s)", 
-                d->path, d->host_path, d->type, dev_type);
+            ERROR("CDI device (%s, %s), host type mismatch (%s, %s)",
+                  d->path, d->host_path, d->type, dev_type);
             return -1;
         }
     }
@@ -168,7 +168,7 @@ static cdi_hook *clone_cdi_hook(cdi_hook *h)
         hook->env_len = h->env_len;
     }
     hook->timeout = h->timeout;
-   
+
     return hook;
 
 error_out:
@@ -280,7 +280,7 @@ static defs_device *cdi_device_node_to_oci(cdi_device_node *d)
     oci_device->file_mode = d->file_mode;
     oci_device->uid = d->uid;
     oci_device->gid = d->gid;
-    
+
     return oci_device;
 }
 
@@ -331,7 +331,7 @@ static int apply_cdi_device_nodes(cdi_container_edits *e, oci_runtime_spec *spec
                 access = "rwm";
             }
             if (spec_add_linux_resources_device(spec, true, dev->type,
-                dev->major, dev->minor, access)) {
+                                                dev->major, dev->minor, access)) {
                 dev = NULL;
                 goto error_out;
             }
@@ -391,9 +391,9 @@ static int apply_cdi_mounts(cdi_container_edits *e, oci_runtime_spec *spec)
             return -1;
         }
     }
-        
+
     qsort(spec->mounts, spec->mounts_len,
-              sizeof(defs_mount *), (int (*)(const void *, const void *))defs_mount_cmp);
+          sizeof(defs_mount *), (int (*)(const void *, const void *))defs_mount_cmp);
     return 0;
 }
 
@@ -411,8 +411,8 @@ static int apply_cdi_hooks(cdi_container_edits *e, oci_runtime_spec *spec)
         } else if (strcmp(e->hooks[i]->hook_name, POSTSTOP_HOOK)) {
             ret = spec_add_poststop_hook(spec, oci_hook);
         } else {
-            /* 
-            * The OCI being used by the iSulad not supportes 
+            /*
+            * The OCI being used by the iSulad not supportes
             * createRuntime/createContainer/startContainer currently.
             */
             ERROR("Unknown hook name %s", e->hooks[i]->hook_name);
@@ -503,19 +503,19 @@ int cdi_container_edits_validate(cdi_container_edits *e)
     static int append_##item(cdi_container_edits *e, cdi_container_edits *o, clone_common_array_item_cb cb) \
     {                                                                                                   \
         common_array e_array = {                                                                        \
-            .items = (void **)e->item,                                                                  \
-            .len = e->item##_len,                                                                       \
-            .cap = e->item##_len,                                                                       \
-            .free_item_cb = NULL,                                                                       \
-            .clone_item_cb = cb                                                                         \
-        };                                                                                              \
+                                                                                                        .items = (void **)e->item,                                                                  \
+                                                                                                        .len = e->item##_len,                                                                       \
+                                                                                                        .cap = e->item##_len,                                                                       \
+                                                                                                        .free_item_cb = NULL,                                                                       \
+                                                                                                        .clone_item_cb = cb                                                                         \
+                               };                                                                                              \
         common_array o_array = {                                                                        \
-            .items = (void **)o->item,                                                                  \
-            .len = o->item##_len,                                                                       \
-            .cap = o->item##_len,                                                                       \
-            .free_item_cb = NULL,                                                                       \
-            .clone_item_cb = cb                                                                         \
-        };                                                                                              \
+                                                                                                        .items = (void **)o->item,                                                                  \
+                                                                                                        .len = o->item##_len,                                                                       \
+                                                                                                        .cap = o->item##_len,                                                                       \
+                                                                                                        .free_item_cb = NULL,                                                                       \
+                                                                                                        .clone_item_cb = cb                                                                         \
+                               };                                                                                              \
         if (util_merge_common_array(&e_array, &o_array) != 0) {                                         \
             ERROR("Out of memory");                                                                     \
             return -1;                                                                                  \
diff --git a/src/daemon/modules/device/cdi/behavior/cdi_device.c b/src/daemon/modules/device/cdi/behavior/cdi_device.c
index aec3d7c0..9104416c 100644
--- a/src/daemon/modules/device/cdi/behavior/cdi_device.c
+++ b/src/daemon/modules/device/cdi/behavior/cdi_device.c
@@ -28,21 +28,21 @@ void free_cdi_cache_device(struct cdi_cache_device *d)
     if (d == NULL) {
         return;
     }
- 
-    /* 
+
+    /*
      * free_cdi_cache_device should not be recursively free raw_device.
      * Otherwise, the function conflicts with the raw_spec free raw_device
-     * when cdi_cache_spec free raw_spec, triggering double free. 
+     * when cdi_cache_spec free raw_spec, triggering double free.
      */
     d->raw_device = NULL;
- 
-    /* 
+
+    /*
      * free_cdi_cache_device should not be recursively free cache_spec.
      * Otherwise, the function conflicts with the cache free specs,
-     * triggering double free. 
+     * triggering double free.
      */
     d->cache_spec = NULL;
- 
+
     free(d);
 }
 
@@ -86,7 +86,7 @@ char *cdi_device_get_qualified_name(const struct cdi_cache_device *d)
         return NULL;
     }
     return cdi_parser_qualified_name(cdi_spec_get_vendor(d->cache_spec),
-        cdi_spec_get_class(d->cache_spec), d->raw_device->name);
+                                     cdi_spec_get_class(d->cache_spec), d->raw_device->name);
 }
 
 cdi_container_edits *cdi_device_get_edits(const struct cdi_cache_device *d)
diff --git a/src/daemon/modules/device/cdi/behavior/cdi_spec.c b/src/daemon/modules/device/cdi/behavior/cdi_spec.c
index 8783debc..ec563230 100644
--- a/src/daemon/modules/device/cdi/behavior/cdi_spec.c
+++ b/src/daemon/modules/device/cdi/behavior/cdi_spec.c
@@ -33,7 +33,7 @@ void free_cdi_cache_spec(struct cdi_cache_spec *s)
     if (s == NULL) {
         return;
     }
- 
+
     free_cdi_spec(s->raw_spec);
     s->raw_spec = NULL;
     free(s->vendor);
@@ -44,7 +44,7 @@ void free_cdi_cache_spec(struct cdi_cache_spec *s)
     s->path = NULL;
     map_free(s->devices);
     s->devices = NULL;
- 
+
     free(s);
 }
 
@@ -58,7 +58,7 @@ struct cdi_cache_spec *cdi_spec_read_spec(const char *path, int priority)
         ERROR("Failed to get clean path %s", path);
         return NULL;
     }
-    
+
     raw_spec = cdi_spec_parse_file(cleanpath, NULL, &err);
     if (raw_spec == NULL) {
         ERROR("Failed to read CDI Spec %s: %s", cleanpath, err);
@@ -106,7 +106,7 @@ struct cdi_cache_spec *cdi_spec_new_spec(cdi_spec *raw, const char *path, int pr
         ERROR("Invalid CDI Spec");
         goto error_out;
     }
-    
+
     return spec;
 
 error_out:
@@ -183,7 +183,7 @@ static int cdi_spec_init(struct cdi_cache_spec *s)
     cdi_device *d = NULL;
     size_t i;
     bool version_result = true;
-    
+
     if (!cdi_is_valid_version(s->raw_spec->cdi_version)) {
         ERROR("Failed to validate cdi spec version: %s", s->raw_spec->cdi_version);
         return -1;
diff --git a/src/daemon/modules/device/cdi/behavior/cdi_spec.h b/src/daemon/modules/device/cdi/behavior/cdi_spec.h
index ca7b2cfa..d20826c6 100644
--- a/src/daemon/modules/device/cdi/behavior/cdi_spec.h
+++ b/src/daemon/modules/device/cdi/behavior/cdi_spec.h
@@ -37,7 +37,7 @@ struct cdi_cache_spec {
 };
 
 #define CDI_DEFAULT_SPEC_EXT ".json"
- 
+
 void free_cdi_cache_spec(struct cdi_cache_spec *s);
 
 struct cdi_cache_spec *cdi_spec_read_spec(const char *path, int priority);
diff --git a/src/daemon/modules/device/cdi/behavior/cdi_spec_dirs.c b/src/daemon/modules/device/cdi/behavior/cdi_spec_dirs.c
index cafb52b8..75cd7abf 100644
--- a/src/daemon/modules/device/cdi/behavior/cdi_spec_dirs.c
+++ b/src/daemon/modules/device/cdi/behavior/cdi_spec_dirs.c
@@ -27,13 +27,13 @@
 
 #define DEFAULT_SPEC_DIRS_LEN   2
 static char *default_spec_dirs_items[DEFAULT_SPEC_DIRS_LEN] = {CDI_DEFAULT_STATIC_DIR, CDI_DEFAULT_DYNAMIC_DIR};
- 
+
 string_array g_default_spec_dirs = {
     .items = default_spec_dirs_items,
     .len = DEFAULT_SPEC_DIRS_LEN,
     .cap = DEFAULT_SPEC_DIRS_LEN,
 };
- 
+
 struct scan_spec_dir_cb_args {
     struct cdi_scan_fn_maps *scan_fn_maps;
     cdi_scan_spec_func scan_fn;
@@ -64,7 +64,7 @@ static bool scan_spec_dir_cb(const char *dir, const struct dirent *pdirent, void
         DEBUG("Skip dir %s", file_path);
         return true;
     }
-    
+
     if (!util_has_suffix(file_path, ".json")) {
         DEBUG("Skip file %s", file_path);
         return true;
diff --git a/src/daemon/modules/device/cdi/behavior/cdi_spec_dirs.h b/src/daemon/modules/device/cdi/behavior/cdi_spec_dirs.h
index b17a0cd8..fdb0f2f9 100644
--- a/src/daemon/modules/device/cdi/behavior/cdi_spec_dirs.h
+++ b/src/daemon/modules/device/cdi/behavior/cdi_spec_dirs.h
@@ -27,7 +27,7 @@ extern "C" {
 #define CDI_DEFAULT_DYNAMIC_DIR "/var/run/cdi"
 
 extern string_array g_default_spec_dirs;
- 
+
 struct cdi_scan_fn_maps {
     map_t *specs;
     map_t *devices;
diff --git a/src/daemon/modules/device/cdi/behavior/cdi_version.c b/src/daemon/modules/device/cdi/behavior/cdi_version.c
index 550f3107..4cdc116a 100644
--- a/src/daemon/modules/device/cdi/behavior/cdi_version.c
+++ b/src/daemon/modules/device/cdi/behavior/cdi_version.c
@@ -177,7 +177,7 @@ const char *cdi_minimum_required_version(cdi_spec *spec)
 bool cdi_is_valid_version(const char *spec_version)
 {
     int i;
-    
+
     for (i = 0; i < VALID_SPEC_VERSIONS_LEN; i++) {
         if (strcmp(g_valid_spec_versions[i].version, spec_version) == 0) {
             return true;
diff --git a/src/daemon/modules/device/cdi/behavior/parser/cdi_parser.c b/src/daemon/modules/device/cdi/behavior/parser/cdi_parser.c
index 8824d29c..603ce28d 100644
--- a/src/daemon/modules/device/cdi/behavior/parser/cdi_parser.c
+++ b/src/daemon/modules/device/cdi/behavior/parser/cdi_parser.c
@@ -47,7 +47,7 @@ char *cdi_parser_qualified_name(const char *vendor, const char *class, const cha
     }
 
     nret = snprintf(device_name, sizeof(device_name), "%s/%s=%s",
-                        vendor, class, name);
+                    vendor, class, name);
     if (nret < 0 || (size_t)nret >= sizeof(device_name)) {
         ERROR("Device name is too long");
         return NULL;
@@ -118,7 +118,7 @@ int cdi_parser_parse_device(const char *device, char **vendor, char **class, cha
 {
     __isula_auto_array_t char **parts = NULL;
 
-    if (vendor == NULL || class == NULL || name == NULL || 
+    if (vendor == NULL || class == NULL || name == NULL ||
         device == NULL || device[0] == '/') {
         ERROR("Invalid argument");
         return -1;
@@ -214,7 +214,7 @@ int cdi_parser_validate_class_name(const char *class)
 int cdi_parser_validate_device_name(const char *name)
 {
     size_t i;
-    
+
     if (name == NULL) {
         ERROR("Invalid (empty) device name");
         return -1;
diff --git a/src/daemon/modules/device/cdi/cdi_cache.c b/src/daemon/modules/device/cdi/cdi_cache.c
index e637f7cd..e9a9b804 100644
--- a/src/daemon/modules/device/cdi/cdi_cache.c
+++ b/src/daemon/modules/device/cdi/cdi_cache.c
@@ -179,7 +179,7 @@ static int cdi_refresh(struct cdi_cache *c)
 {
     bool refreshed;
     int ret = 0;
-    
+
     if (c == NULL) {
         ERROR("Invalid arguments");
         return -1;
@@ -206,10 +206,10 @@ static void map_cdi_cache_specs_kvfree(void *key, void *value)
 static void map_cdi_cache_device_kvfree(void *key, void *value)
 {
     free(key);
-    /* 
+    /*
      * map_cdi_cache_device_kvfree should not be recursively free cdi_cache_device.
      * Otherwise, the function conflicts with the cdi_cache_specs free devices,
-     * triggering double free. 
+     * triggering double free.
      */
     (void)value;
 }
@@ -249,8 +249,8 @@ static bool resolve_conflict(struct cdi_scan_fn_maps *scan_fn_maps, const char *
     return true;
 }
 
-static void refresh_scan_spec_func(struct cdi_scan_fn_maps *scan_fn_maps, const char *path, 
-                                    int priority, struct cdi_cache_spec *spec)
+static void refresh_scan_spec_func(struct cdi_scan_fn_maps *scan_fn_maps, const char *path,
+                                   int priority, struct cdi_cache_spec *spec)
 {
     map_t *specs = scan_fn_maps->specs;
     map_t *devices = scan_fn_maps->devices;
@@ -375,7 +375,7 @@ static int refresh(struct cdi_cache *c)
     util_swap_ptr((void **)&c->devices, (void **)&devices);
 
     ret = c->refresh_error_flag ? -1 : 0;
-    
+
 free_out:
     map_itor_free(itor);
     map_free(specs);
@@ -443,7 +443,7 @@ static int cdi_inject_devices(struct cdi_cache *c, oci_runtime_spec *oci_spec, s
 
     (void)refresh_if_required(c, false, &ret);
 
-    for(i = 0; i < devices->len; i++) {
+    for (i = 0; i < devices->len; i++) {
         device = devices->items[i];
         d = map_search(c->devices, (void *)device);
         if (d == NULL) {
@@ -524,7 +524,7 @@ static int init_tracked(struct cdi_watch *w, string_array *dirs)
         ERROR("Out of memory");
         return -1;
     }
-    for(i = 0; i < dirs->len; i++) {
+    for (i = 0; i < dirs->len; i++) {
         if (!map_replace(w->tracked, (void *)dirs->items[i], (void *)&tmp_value)) {
             ERROR("Failed to insert tracked by dir %s", dirs->items[i]);
             goto error_out;
@@ -624,7 +624,7 @@ static int process_cdi_events(int watcher_fd, struct cdi_cache *c)
     }
 
     (void)pthread_mutex_lock(&c->mutex);
-    
+
     while (events_index < events_length) {
         cdi_event = (struct inotify_event *)(&buffer[events_index]);
         ssize_t event_size = (ssize_t)(cdi_event->len) + (ssize_t)offsetof(struct inotify_event, name);
@@ -633,8 +633,8 @@ static int process_cdi_events(int watcher_fd, struct cdi_cache *c)
         }
         events_index += event_size;
 
-        /*  
-         *  file: 
+        /*
+         *  file:
          *      Rename:  mask == IN_MOVED_TO | IN_MOVED_FROM
          *      Remove:  mask == IN_MOVED_FROM || mask == IN_DELETE
          *      Write:   mask == IN_MODIFY
diff --git a/src/daemon/modules/device/cdi/cdi_cache.h b/src/daemon/modules/device/cdi/cdi_cache.h
index 638e954e..9f6793c8 100644
--- a/src/daemon/modules/device/cdi/cdi_cache.h
+++ b/src/daemon/modules/device/cdi/cdi_cache.h
@@ -34,7 +34,7 @@ struct cdi_cache_ops {
     // injecting CDI devices into an OCI Spec.
     // Resolver
     int (*inject_devices)(struct cdi_cache *c, oci_runtime_spec *spec, string_array *devices);
-    
+
     // refreshing the cache of CDI Specs and devices.
     // Refresher
     int (*configure)(struct cdi_cache *c, string_array *spec_dirs);
@@ -55,12 +55,12 @@ struct cdi_cache {
     // This map holding the reference to cdi device, the devices will not released when the map is freed.
     map_t *devices;      // MAP_STR_PTR     devices[cdi_device.name] = cdi_cache_device*
     bool refresh_error_flag;
-    bool auto_refresh; 
+    bool auto_refresh;
     struct cdi_watch *watch;
 };
 
 void free_cdi_cache(struct cdi_cache *c);
- 
+
 struct cdi_cache *cdi_new_cache(string_array *spec_dirs);
 struct cdi_cache_ops *cdi_get_cache_ops(void);
 
diff --git a/src/daemon/modules/device/cdi_operate.c b/src/daemon/modules/device/cdi_operate.c
index f99bb7e4..2cc2a17d 100644
--- a/src/daemon/modules/device/cdi_operate.c
+++ b/src/daemon/modules/device/cdi_operate.c
@@ -29,7 +29,7 @@ int cdi_operate_registry_init(char **specs_dirs, size_t specs_dirs_len)
         .len = specs_dirs_len,
         .cap = specs_dirs_len,
     };
-    
+
     return cdi_registry_init(&spec_dirs_array);
 }
 
@@ -40,7 +40,7 @@ int cdi_operate_refresh(void)
         ERROR("Failed to get registry");
         return -1;
     }
-    
+
     return registry->ops->refresh(registry->cdi_cache);
 }
 
@@ -52,13 +52,13 @@ int cdi_operate_inject_devices(oci_runtime_spec *spec, string_array *devices)
         ERROR("Invalid params");
         return -1;
     }
-    
+
     registry = cdi_get_registry();
     if (registry == NULL || registry->ops == NULL || registry->ops->inject_devices == NULL) {
         ERROR("Failed to get registry");
         return -1;
     }
-    
+
     return registry->ops->inject_devices(registry->cdi_cache, spec, devices);
 }
 
diff --git a/src/daemon/modules/image/oci/oci_image.c b/src/daemon/modules/image/oci/oci_image.c
index ce1c8a6b..e9f16024 100644
--- a/src/daemon/modules/image/oci/oci_image.c
+++ b/src/daemon/modules/image/oci/oci_image.c
@@ -295,7 +295,8 @@ static bool remove_image_tmpdir_cb(const char *path_name, const struct dirent *s
         return true;
     }
 
-    if (!util_has_prefix(sub_dir->d_name, LOAD_TMPDIR_PREFIX) && !util_has_prefix(sub_dir->d_name, REGISTRY_TMPDIR_PREFIX)) {
+    if (!util_has_prefix(sub_dir->d_name, LOAD_TMPDIR_PREFIX) &&
+        !util_has_prefix(sub_dir->d_name, REGISTRY_TMPDIR_PREFIX)) {
         // only remove directory that image module created
         return true;
     }
diff --git a/src/daemon/modules/image/oci/progress.h b/src/daemon/modules/image/oci/progress.h
index dcc8e144..673019a4 100644
--- a/src/daemon/modules/image/oci/progress.h
+++ b/src/daemon/modules/image/oci/progress.h
@@ -35,7 +35,7 @@ typedef struct progress {
 
 bool progress_status_map_udpate(progress_status_map *progress_status_map, char *key, int64_t current, int64_t total);
 
-progress_status_map *progress_status_map_new();
+progress_status_map *progress_status_map_new(void);
 
 size_t progress_status_map_size(progress_status_map *progress_status_map);
 
diff --git a/src/daemon/modules/image/oci/registry/registry.c b/src/daemon/modules/image/oci/registry/registry.c
index 66fa0076..2e99255a 100644
--- a/src/daemon/modules/image/oci/registry/registry.c
+++ b/src/daemon/modules/image/oci/registry/registry.c
@@ -293,7 +293,8 @@ static bool is_manifest_schemav1(char *media_type)
         return false;
     }
 
-    if (strcmp(media_type, DOCKER_MANIFEST_SCHEMA1_JSON) == 0 || strcmp(media_type, DOCKER_MANIFEST_SCHEMA1_PRETTYJWS) == 0 ||
+    if (strcmp(media_type, DOCKER_MANIFEST_SCHEMA1_JSON) == 0 ||
+        strcmp(media_type, DOCKER_MANIFEST_SCHEMA1_PRETTYJWS) == 0 ||
         strcmp(media_type, MEDIA_TYPE_APPLICATION_JSON) == 0) {
         return true;
     }
diff --git a/src/daemon/modules/network/cni_operator/libcni/invoke/libcni_exec.h b/src/daemon/modules/network/cni_operator/libcni/invoke/libcni_exec.h
index 48d8d8b6..10c14f05 100644
--- a/src/daemon/modules/network/cni_operator/libcni/invoke/libcni_exec.h
+++ b/src/daemon/modules/network/cni_operator/libcni/invoke/libcni_exec.h
@@ -36,7 +36,7 @@ struct cni_args {
 void free_cni_args(struct cni_args *cargs);
 
 int exec_plugin_with_result(const char *plugin_path, const char *cni_net_conf_json, const struct cni_args *cniargs,
-                            struct cni_opt_result **ret);
+                            struct cni_opt_result **result);
 
 int exec_plugin_without_result(const char *plugin_path, const char *cni_net_conf_json, const struct cni_args *cniargs);
 
diff --git a/src/daemon/modules/network/cri/adaptor_cri.c b/src/daemon/modules/network/cri/adaptor_cri.c
index 2d03dd98..55826d52 100644
--- a/src/daemon/modules/network/cri/adaptor_cri.c
+++ b/src/daemon/modules/network/cri/adaptor_cri.c
@@ -71,7 +71,7 @@ int adaptor_cni_update_confs()
     size_t tmp_net_list_len = 0;
     size_t i;
     char message[MAX_BUFFER_SIZE] = { 0 };
-    int pos = 0;
+    size_t pos = 0;
 
     work = map_new(MAP_STR_INT, MAP_DEFAULT_CMP_FUNC, MAP_DEFAULT_FREE_FUNC);
     if (work == NULL) {
diff --git a/src/daemon/modules/network/cri/adaptor_cri.h b/src/daemon/modules/network/cri/adaptor_cri.h
index 3d4fe82d..bc157626 100644
--- a/src/daemon/modules/network/cri/adaptor_cri.h
+++ b/src/daemon/modules/network/cri/adaptor_cri.h
@@ -23,9 +23,9 @@ extern "C" {
 
 int adaptor_cni_init_confs(const char *conf_dir, const char **bin_paths, const size_t bin_paths_len);
 
-int adaptor_cni_update_confs();
+int adaptor_cni_update_confs(void);
 
-bool adaptor_cni_check_inited();
+bool adaptor_cni_check_inited(void);
 
 int adaptor_cni_setup(const network_api_conf *conf, network_api_result_list *result);
 
diff --git a/src/daemon/modules/runtime/engines/lcr/lcr_rt_ops.c b/src/daemon/modules/runtime/engines/lcr/lcr_rt_ops.c
index a89d0375..64a8adbc 100644
--- a/src/daemon/modules/runtime/engines/lcr/lcr_rt_ops.c
+++ b/src/daemon/modules/runtime/engines/lcr/lcr_rt_ops.c
@@ -166,7 +166,8 @@ int rt_lcr_start(const char *name, const char *runtime, const rt_start_params_t
         }
         isulad_set_error_message("Start container error: %s",
                                  (tmpmsg != NULL && strcmp(tmpmsg, DEF_SUCCESS_STR) != 0) ? tmpmsg : DEF_ERR_RUNTIME_STR);
-        ERROR("Start container error: %s", (tmpmsg != NULL && strcmp(tmpmsg, DEF_SUCCESS_STR) != 0) ? tmpmsg : DEF_ERR_RUNTIME_STR);
+        ERROR("Start container error: %s", (tmpmsg != NULL &&
+                                            strcmp(tmpmsg, DEF_SUCCESS_STR) != 0) ? tmpmsg : DEF_ERR_RUNTIME_STR);
         ret = -1;
         goto out;
     }
@@ -264,7 +265,8 @@ int rt_lcr_rm(const char *name, const char *runtime, const rt_rm_params_t *param
     if (engine_ops == NULL || engine_ops->engine_delete_op == NULL) {
         // if engine_ops is NULL, container root path may have been corrupted, try to remove by daemon
         // If user runs container with lcr but remove lcr runtime after, there might be resources remaining
-        ERROR("Failed to get engine delete operations, container %s root path may have been corrupted, try to remove by daemon", name);
+        ERROR("Failed to get engine delete operations, container %s root path may have been corrupted, try to remove by daemon",
+              name);
         if (remove_container_rootpath(name, params->rootpath) == 0) {
             ret = 0;
             goto out;
diff --git a/src/daemon/modules/runtime/isula/isula_rt_ops.c b/src/daemon/modules/runtime/isula/isula_rt_ops.c
index 854752ea..62cff3cf 100644
--- a/src/daemon/modules/runtime/isula/isula_rt_ops.c
+++ b/src/daemon/modules/runtime/isula/isula_rt_ops.c
@@ -623,7 +623,8 @@ out:
     return ret;
 }
 
-static void transform_stats_info_from_runtime(shim_client_runtime_stats *stats, struct runtime_container_resources_stats_info *info)
+static void transform_stats_info_from_runtime(shim_client_runtime_stats *stats,
+                                              struct runtime_container_resources_stats_info *info)
 {
     size_t i;
     if (stats == NULL || stats->data == NULL) {
@@ -887,7 +888,7 @@ static int shim_create(shim_create_args *args)
 
     if (get_engine_routine_log_info(&engine_log_path, &log_level) != 0) {
         ERROR("failed to get engine log path");
-        return -1; 
+        return -1;
     }
 
     nret = snprintf(fpid, sizeof(fpid), "%s/shim-pid", args->workdir);
@@ -938,7 +939,7 @@ static int shim_create(shim_create_args *args)
         //prevent the child process from having the same standard streams as the parent process
         if (isula_null_stdfds() != 0) {
             (void)dprintf(exec_err_pipe[1], "failed to set std console to /dev/null");
-            exit(EXIT_FAILURE);           
+            exit(EXIT_FAILURE);
         }
 
         if (args->fg) {
@@ -1054,7 +1055,7 @@ out:
     close(shim_stdout_pipe[0]);
     if (ret != 0) {
         show_shim_errlog(shim_stderr_pipe[0]);
-        // Since users are more concerned about runtime error information, 
+        // Since users are more concerned about runtime error information,
         // the runtime log will overwrite the shim log if it exists.
         show_runtime_errlog(args->workdir);
         if (args->timeout != NULL) {
diff --git a/src/daemon/modules/service/service_container.c b/src/daemon/modules/service/service_container.c
index fe8ee72f..0b95cdad 100644
--- a/src/daemon/modules/service/service_container.c
+++ b/src/daemon/modules/service/service_container.c
@@ -691,7 +691,8 @@ out:
     epoll_loop_close(&descr);
 }
 
-static int do_oci_spec_update(const char *id, oci_runtime_spec *oci_spec, container_config *container_spec, host_config *hostconfig)
+static int do_oci_spec_update(const char *id, oci_runtime_spec *oci_spec, container_config *container_spec,
+                              host_config *hostconfig)
 {
     int ret;
 
@@ -2013,7 +2014,7 @@ static defs_process *make_exec_process_spec(const container_config *container_sp
 #ifdef ENABLE_CDI
         // extend step: merge env from oci_spec which comes from injected devices
         ret = defs_process_add_multiple_env(spec, (const char **)oci_spec->process->env,
-            oci_spec->process->env_len);
+                                            oci_spec->process->env_len);
         if (ret != 0) {
             ERROR("Failed to dup oci env for exec process spec");
             goto err_out;
diff --git a/src/daemon/modules/spec/specs.c b/src/daemon/modules/spec/specs.c
index e779c22e..122f9992 100644
--- a/src/daemon/modules/spec/specs.c
+++ b/src/daemon/modules/spec/specs.c
@@ -2483,7 +2483,8 @@ out:
     return ret;
 }
 
-int update_oci_ulimit(oci_runtime_spec *oci_spec, const host_config *hostconfig) {
+int update_oci_ulimit(oci_runtime_spec *oci_spec, const host_config *hostconfig)
+{
     if (oci_spec == NULL || hostconfig == NULL) {
         ERROR("Invalid arguments");
         return -1;
@@ -2660,7 +2661,7 @@ int defs_process_add_multiple_env(defs_process *dp, const char **envs, size_t en
 int spec_add_multiple_process_env(oci_runtime_spec *oci_spec, const char **envs, size_t env_len)
 {
     int ret = 0;
-    
+
     if (envs == NULL || env_len == 0) {
         DEBUG("empty envs");
         return 0;
@@ -2669,26 +2670,26 @@ int spec_add_multiple_process_env(oci_runtime_spec *oci_spec, const char **envs,
         ERROR("Invalid params");
         return -1;
     }
- 
+
     ret = make_sure_oci_spec_process(oci_spec);
     if (ret < 0) {
         ERROR("Out of memory");
         return -1;
     }
- 
+
     ret = defs_process_add_multiple_env(oci_spec->process, envs, env_len);
     if (ret < 0) {
         ERROR("Failed to add envs");
     }
- 
+
     return ret;
 }
- 
+
 int spec_add_device(oci_runtime_spec *oci_spec, defs_device *device)
 {
     int ret = 0;
     size_t i;
- 
+
     if (device == NULL) {
         return -1;
     }
@@ -2696,7 +2697,7 @@ int spec_add_device(oci_runtime_spec *oci_spec, defs_device *device)
     if (ret < 0) {
         return -1;
     }
-    
+
     for (i = 0; i < oci_spec->linux->devices_len; i++) {
         if (strcmp(oci_spec->linux->devices[i]->path, device->path) == 0) {
             free_defs_device(oci_spec->linux->devices[i]);
@@ -2712,21 +2713,21 @@ int spec_add_device(oci_runtime_spec *oci_spec, defs_device *device)
     }
     oci_spec->linux->devices[oci_spec->linux->devices_len] = device;
     oci_spec->linux->devices_len++;
- 
+
     return 0;
 }
- 
+
 int spec_add_linux_resources_device(oci_runtime_spec *oci_spec, bool allow, const char *dev_type,
                                     int64_t major, int64_t minor, const char *access)
 {
     int ret = 0;
     defs_device_cgroup *device = NULL;
- 
+
     ret = make_sure_oci_spec_linux_resources(oci_spec);
     if (ret < 0) {
         return -1;
     }
- 
+
     device = util_common_calloc_s(sizeof(*device));
     if (device == NULL) {
         ERROR("Out of memory");
@@ -2738,7 +2739,8 @@ int spec_add_linux_resources_device(oci_runtime_spec *oci_spec, bool allow, cons
     device->major = major;
     device->minor = minor;
 
-    if (util_mem_realloc((void **)&oci_spec->linux->resources->devices, (oci_spec->linux->resources->devices_len + 1) * sizeof(char *),
+    if (util_mem_realloc((void **)&oci_spec->linux->resources->devices,
+                         (oci_spec->linux->resources->devices_len + 1) * sizeof(char *),
                          (void *)oci_spec->linux->resources->devices, oci_spec->linux->resources->devices_len * sizeof(char *)) != 0) {
         ERROR("Out of memory");
         free_defs_device_cgroup(device);
@@ -2746,35 +2748,35 @@ int spec_add_linux_resources_device(oci_runtime_spec *oci_spec, bool allow, cons
     }
     oci_spec->linux->resources->devices[oci_spec->linux->resources->devices_len] = device;
     oci_spec->linux->resources->devices_len++;
- 
+
     return 0;
 }
- 
+
 void spec_remove_mount(oci_runtime_spec *oci_spec, const char *dest)
 {
     size_t i;
- 
+
     if (oci_spec == NULL || oci_spec->mounts == NULL || dest == NULL) {
         return;
     }
- 
+
     for (i = 0; i < oci_spec->mounts_len; i++) {
         if (strcmp(oci_spec->mounts[i]->destination, dest) == 0) {
             free_defs_mount(oci_spec->mounts[i]);
             (void)memcpy((void **)&oci_spec->mounts[i], (void **)&oci_spec->mounts[i + 1],
-                (oci_spec->mounts_len - i - 1) * sizeof(void *));        
+                         (oci_spec->mounts_len - i - 1) * sizeof(void *));
             oci_spec->mounts_len--;
             return;
         }
     }
 }
- 
+
 int spec_add_mount(oci_runtime_spec *oci_spec, defs_mount *mnt)
 {
     if (oci_spec == NULL || mnt == NULL) {
         return -1;
     }
-    
+
     if (util_mem_realloc((void **)&oci_spec->mounts, (oci_spec->mounts_len + 1) * sizeof(char *),
                          (void *)oci_spec->mounts, oci_spec->mounts_len * sizeof(char *)) != 0) {
         ERROR("Out of memory");
@@ -2782,10 +2784,10 @@ int spec_add_mount(oci_runtime_spec *oci_spec, defs_mount *mnt)
     }
     oci_spec->mounts[oci_spec->mounts_len] = mnt;
     oci_spec->mounts_len++;
- 
+
     return 0;
 }
- 
+
 #define SPEC_ADD_HOOKS_ITEM_DEF(hooktype)                                                                                   \
     int spec_add_##hooktype##_hook(oci_runtime_spec *oci_spec, defs_hook *hooktype##_hook)                                  \
     {                                                                                                                       \
@@ -2806,9 +2808,9 @@ int spec_add_mount(oci_runtime_spec *oci_spec, defs_mount *mnt)
         oci_spec->hooks->hooktype##_len++;                                                                                  \
         return 0;                                                                                                           \
     }
- 
-/* 
-* The OCI being used by the iSulad not supportes 
+
+/*
+* The OCI being used by the iSulad not supportes
 * createRuntime/createContainer/startContainer currently.
 */
 SPEC_ADD_HOOKS_ITEM_DEF(prestart)
diff --git a/src/daemon/modules/spec/specs_mount.c b/src/daemon/modules/spec/specs_mount.c
index 12bd261b..2e065e3d 100644
--- a/src/daemon/modules/spec/specs_mount.c
+++ b/src/daemon/modules/spec/specs_mount.c
@@ -2871,7 +2871,7 @@ static inline int set_host_ipc_shm_path(container_config_v2_common_config *v2_sp
  * 1. The user defined /dev/shm in mounts, which takes the first priority
  * 2. If sharable is set in ipc mode (or by default ipc_mode is null), the container provides shm path,
  *    in the case of sandbox API is used, the sandbox module has already provided shm path
- * 3. Use the connected container's shm path if ipc_mode is set to container:<cid>, 
+ * 3. Use the connected container's shm path if ipc_mode is set to container:<cid>,
  *    if connected containerd is a sandbox, use the sandbox's shm path
  * 4. Use /dev/shm if ipc_mode is set to host
  */
@@ -3613,7 +3613,7 @@ int inject_CDI_devcies_for_oci_spec(oci_runtime_spec *oci_spec, host_config *hos
     int ret = 0;
     string_array devices_array = { 0 };
     __isula_auto_free char *error = NULL;
-    
+
     if (oci_spec == NULL || hostconfig == NULL) {
         ERROR("Invalid params");
         return -1;
diff --git a/src/utils/cutils/blocking_queue.c b/src/utils/cutils/blocking_queue.c
index 9bdb2ca3..02059690 100644
--- a/src/utils/cutils/blocking_queue.c
+++ b/src/utils/cutils/blocking_queue.c
@@ -97,7 +97,8 @@ int blocking_queue_push(blocking_queue *queue, void *data)
     return 0;
 }
 
-int blocking_queue_pop(blocking_queue *queue, void **data) {
+int blocking_queue_pop(blocking_queue *queue, void **data)
+{
     if (queue == NULL || data == NULL) {
         ERROR("Invalid NULL arguments");
         return -1;
diff --git a/src/utils/cutils/network_namespace.h b/src/utils/cutils/network_namespace.h
index 6ac7b28b..14410736 100644
--- a/src/utils/cutils/network_namespace.h
+++ b/src/utils/cutils/network_namespace.h
@@ -22,9 +22,9 @@
 extern "C" {
 #endif
 
-int prepare_network_namespace(const char *netns_path, const bool post_prepare_network, const int pid);
+int prepare_network_namespace(const char *netns_path, const bool post_setup_network, const int pid);
 
-int remove_network_namespace(const char *netns);
+int remove_network_namespace(const char *netns_path);
 
 int create_network_namespace_file(const char *netns_path);
 
diff --git a/src/utils/cutils/utils_array.c b/src/utils/cutils/utils_array.c
index 72294005..6c7444f0 100644
--- a/src/utils/cutils/utils_array.c
+++ b/src/utils/cutils/utils_array.c
@@ -90,17 +90,17 @@ char **util_copy_array_by_len(char **array, size_t len)
 {
     char **new_array = NULL;
     size_t i;
- 
+
     if (array == NULL || len == 0) {
         return NULL;
     }
- 
+
     new_array = util_smart_calloc_s(sizeof(char *), len);
     if (new_array == NULL) {
         ERROR("Out of memory");
         return NULL;
     }
- 
+
     for (i = 0; i < len; i++) {
         new_array[i] = util_strdup_s(array[i]);
     }
@@ -262,12 +262,12 @@ string_array *util_copy_string_array(string_array *sarr)
 {
     string_array *ptr = NULL;
     size_t i;
- 
+
     if (sarr == NULL) {
         ERROR("Invalid string array");
         return NULL;
     }
- 
+
     ptr = util_string_array_new(sarr->cap);
     if (ptr == NULL) {
         ERROR("Out of memory");
@@ -277,7 +277,7 @@ string_array *util_copy_string_array(string_array *sarr)
         ptr->items[i] = util_strdup_s(sarr->items[i]);
         ptr->len += 1;
     }
- 
+
     return ptr;
 }
 
diff --git a/src/utils/cutils/utils_port.h b/src/utils/cutils/utils_port.h
index dbbf2a5a..ae1676f2 100644
--- a/src/utils/cutils/utils_port.h
+++ b/src/utils/cutils/utils_port.h
@@ -66,7 +66,7 @@ void util_free_network_port(struct network_port *ptr);
 
 bool util_valid_proto(const char *proto);
 
-int util_get_random_port();
+int util_get_random_port(void);
 
 static inline bool is_valid_port(const int port)
 {
diff --git a/src/utils/cutils/utils_verify.c b/src/utils/cutils/utils_verify.c
index 6f1da12c..0d7c17f4 100644
--- a/src/utils/cutils/utils_verify.c
+++ b/src/utils/cutils/utils_verify.c
@@ -540,8 +540,8 @@ bool util_valid_propagation_mode(const char *mode)
     if (mode == NULL) {
         return false;
     }
-    return strcmp(mode, "private") == 0 || strcmp(mode, "rprivate") == 0 || strcmp(mode, "slave") == 0 || strcmp(mode, "rslave") == 0 ||
-           strcmp(mode, "shared") == 0 || strcmp(mode, "rshared") == 0;
+    return strcmp(mode, "private") == 0 || strcmp(mode, "rprivate") == 0 || strcmp(mode, "slave") == 0 ||
+           strcmp(mode, "rslave") == 0 || strcmp(mode, "shared") == 0 || strcmp(mode, "rshared") == 0;
 }
 
 bool util_valid_mount_mode(const char *mode)
diff --git a/src/utils/progress/show.h b/src/utils/progress/show.h
index c1f71d86..1942db8e 100644
--- a/src/utils/progress/show.h
+++ b/src/utils/progress/show.h
@@ -21,11 +21,11 @@ extern "C" {
 #endif
 
 void move_to_row(int row);
-void move_cursor_up(int lines);
+void move_cursor_up(int rows);
 void clear_row(int row);
-void clear_lines_below();
-int get_current_row();
-int get_terminal_width();
+void clear_lines_below(void);
+int get_current_row(void);
+int get_terminal_width(void);
 
 #ifdef __cplusplus
 }
diff --git a/src/utils/tar/isulad_tar.c b/src/utils/tar/isulad_tar.c
index 13343922..29008420 100644
--- a/src/utils/tar/isulad_tar.c
+++ b/src/utils/tar/isulad_tar.c
@@ -445,7 +445,7 @@ static int tar_resource_rebase(const char *path, const char *rebase, const char
         ERROR("Can not split path: %s", path);
         goto cleanup;
     }
- 
+
     if (realpath(srcdir, cleanpath) == NULL) {
         ERROR("Failed to get real path for %s", srcdir);
         goto cleanup;
diff --git a/test/cgroup/cpu/cgroup_cpu_ut.cc b/test/cgroup/cpu/cgroup_cpu_ut.cc
index 6e6e04f4..16eec69b 100644
--- a/test/cgroup/cpu/cgroup_cpu_ut.cc
+++ b/test/cgroup/cpu/cgroup_cpu_ut.cc
@@ -80,7 +80,7 @@ TEST(CgroupCpuUnitTest, test_sysinfo_cgroup_controller_cpurt_mnt_path)
 {
     MOCK_SET(util_common_calloc_s, nullptr);
     ASSERT_EQ(get_sys_info(true), nullptr);
-    
+
     int ret = cgroup_ops_init();
     ASSERT_EQ(ret, 0);
 
-- 
2.25.1

