summaryrefslogtreecommitdiff
path: root/0087-code-improve.patch
blob: 66f9f056fc21951bb61e72186b073b9476e3d0c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
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