diff --git a/Kconfig b/Kconfig
index 359ec54c..91a85230 100644
--- a/Kconfig
+++ b/Kconfig
@@ -369,7 +369,7 @@ config KERNEL_LMK
default n
depends on KERNEL_EXTKERNEL
help
- Configuration item for low momery killer tailoring.
+ Configuration item for low memory killer tailoring.
If you wish to build LiteOS with support for low memory killer.
config KERNEL_LMK_DEBUG
@@ -574,7 +574,7 @@ config MEM_LEAKCHECK
depends on DEBUG_VERSION && MEM_DEBUG
select KERNEL_BACKTRACE
help
- Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the infomations of mem node.
+ Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the informations of mem node.
config BASE_MEM_NODE_INTEGRITY_CHECK
bool "Enable integrity check or not"
default n
diff --git a/README.md b/README.md
index 8806b76f..0bc2da4b 100644
--- a/README.md
+++ b/README.md
@@ -131,4 +131,4 @@ How to contribute a chip based on Liteos-M kernel:
[Kernel Subsystem](https://gitee.com/openharmony/docs/blob/HEAD/en/readme/kernel-subsystem.md)
-**kernel\_liteos\_m**
+[kernel\_liteos\_m](https://gitee.com/openharmony/kernel_liteos_m/blob/master/README.md)
diff --git a/README_zh.md b/README_zh.md
index 8fff9f9f..f729b18f 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -131,5 +131,5 @@ LiteOS-M内核移植的具体开发板的工程由社区开发者提供,可以
[内核子系统](https://gitee.com/openharmony/docs/blob/HEAD/zh-cn/readme/%E5%86%85%E6%A0%B8%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
-**kernel\_liteos\_m**
+[kernel\_liteos\_m](https://gitee.com/openharmony/kernel_liteos_m/blob/master/README_zh.md)
diff --git a/arch/arm/arm9/gcc/los_interrupt.c b/arch/arm/arm9/gcc/los_interrupt.c
index fd6d48cc..a82fe435 100644
--- a/arch/arm/arm9/gcc/los_interrupt.c
+++ b/arch/arm/arm9/gcc/los_interrupt.c
@@ -163,7 +163,6 @@ inline UINT32 ArchIsIntActive(VOID)
Output : None
Return : None
**************************************************************************** */
-/*lint -e529*/
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
{
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HwiNumGet());
diff --git a/arch/arm/cortex-m3/keil/los_atomic.S b/arch/arm/cortex-m3/keil/los_atomic.S
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m3/keil/los_exc.S b/arch/arm/cortex-m3/keil/los_exc.S
index da2bcaf3..ab39c384 100644
--- a/arch/arm/cortex-m3/keil/los_exc.S
+++ b/arch/arm/cortex-m3/keil/los_exc.S
@@ -190,7 +190,7 @@ _hwiActiveCheck
CMP R3, #0
BEQ _hwiActiveCheckNext
- ; exc occured in IRQ
+ ; exc occurred in IRQ
ORR R0, R0, #FLAG_HWI_ACTIVE
RBIT R2, R3
CLZ R2, R2
@@ -228,19 +228,19 @@ _hwiActiveCheckNext
AND R2, R2,R3
CMP R2,#0
BNE _ExcInMSP
- ; exc occured in Task or Init or exc
+ ; exc occurred in Task or Init or exc
; reserved for register info from task stack
LDR R2, =g_taskScheduled
LDR R2, [R2]
TST R2, #1 ; OS_FLG_BGD_ACTIVE
- BEQ _ExcInMSP ; if exc occured in Init then branch
+ BEQ _ExcInMSP ; if exc occurred in Init then branch
CMP LR, #0xFFFFFFED ;auto push floating registers
BNE _NoFloatInPsp
- ; exc occured in Task
+ ; exc occurred in Task
MOV R2, R13
SUB R13, #96 ; add 8 Bytes reg(for STMFD)
diff --git a/arch/arm/cortex-m3/keil/los_interrupt.c b/arch/arm/cortex-m3/keil/los_interrupt.c
index 391cb7a4..26e3de7b 100644
--- a/arch/arm/cortex-m3/keil/los_interrupt.c
+++ b/arch/arm/cortex-m3/keil/los_interrupt.c
@@ -40,14 +40,12 @@
#include "los_memory.h"
#include "los_membox.h"
-/*lint -save -e40 -e522 -e533*/
UINT32 g_intCount = 0;
-/*lint -restore*/
#ifdef __ICCARM__
#pragma location = ".data.vector"
#elif defined(__CC_ARM) || defined(__GNUC__)
-#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN
+#pragma data_alignment = LOSCFG_ARCH_HWI_VECTOR_ALIGN
LITE_OS_SEC_VEC
#endif
/* *
@@ -198,7 +196,6 @@ inline UINT32 ArchIsIntActive(VOID)
Output : None
Return : None
**************************************************************************** */
-/*lint -e529*/
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
{
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HwiNumGet());
@@ -602,7 +599,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
-
+
/* Enable DIV 0 and unaligned exception */
#ifdef LOSCFG_ARCH_UNALIGNED_EXC
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
diff --git a/arch/arm/cortex-m33/gcc/NTZ/los_arch_atomic.h b/arch/arm/cortex-m33/gcc/NTZ/los_arch_atomic.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/NTZ/los_arch_context.h b/arch/arm/cortex-m33/gcc/NTZ/los_arch_context.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/NTZ/los_arch_interrupt.h b/arch/arm/cortex-m33/gcc/NTZ/los_arch_interrupt.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/NTZ/los_exc.S b/arch/arm/cortex-m33/gcc/NTZ/los_exc.S
old mode 100755
new mode 100644
index c019764e..e809d8e1
--- a/arch/arm/cortex-m33/gcc/NTZ/los_exc.S
+++ b/arch/arm/cortex-m33/gcc/NTZ/los_exc.S
@@ -263,7 +263,7 @@ _hwiActiveCheck:
CMP R3, #0
BEQ _hwiActiveCheckNext
- // exc occured in IRQ
+ // exc occurred in IRQ
ORR R0, R0, #FLAG_HWI_ACTIVE
RBIT R2, R3
CLZ R2, R2
@@ -316,19 +316,19 @@ _hwiActiveCheckNext:
AND R2, R2,R3
CMP R2,#0
BNE _ExcInMSP
- // exc occured in Task or Init or exc
+ // exc occurred in Task or Init or exc
// reserved for register info from task stack
LDR R2, =g_taskScheduled
LDR R2, [R2]
TST R2, #1 // OS_FLG_BGD_ACTIVE
- BEQ _ExcInMSP // if exc occured in Init then branch
+ BEQ _ExcInMSP // if exc occurred in Init then branch
CMP LR, #0xFFFFFFED //auto push floating registers
BNE _NoFloatInPsp
- // exc occured in Task
+ // exc occurred in Task
MOV R2, R13
SUB R13, #96 // add 8 Bytes reg(for STMFD)
diff --git a/arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c b/arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c
old mode 100755
new mode 100644
index 1ee9c848..d8dd8db8
--- a/arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c
+++ b/arch/arm/cortex-m33/gcc/NTZ/los_interrupt.c
@@ -41,10 +41,8 @@
#include "los_membox.h"
#define DEF_HANDLER_START_INDEX 2
-/*lint -save -e40 -e522 -e533*/
UINT32 g_intCount = 0;
-/*lint -restore*/
/* *
* @ingroup los_hwi
@@ -189,7 +187,6 @@ inline UINT32 ArchIsIntActive(VOID)
Output : None
Return : None
**************************************************************************** */
-/*lint -e529*/
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
{
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HwiNumGet());
@@ -593,7 +590,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
-
+
/* Enable DIV 0 and unaligned exception */
#ifdef LOSCFG_ARCH_UNALIGNED_EXC
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
diff --git a/arch/arm/cortex-m33/gcc/NTZ/los_timer.c b/arch/arm/cortex-m33/gcc/NTZ/los_timer.c
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/TZ/non_secure/los_arch_atomic.h b/arch/arm/cortex-m33/gcc/TZ/non_secure/los_arch_atomic.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/TZ/non_secure/los_arch_context.h b/arch/arm/cortex-m33/gcc/TZ/non_secure/los_arch_context.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/TZ/non_secure/los_arch_interrupt.h b/arch/arm/cortex-m33/gcc/TZ/non_secure/los_arch_interrupt.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/TZ/non_secure/los_exc.S b/arch/arm/cortex-m33/gcc/TZ/non_secure/los_exc.S
old mode 100755
new mode 100644
index e507da65..4e769cca
--- a/arch/arm/cortex-m33/gcc/TZ/non_secure/los_exc.S
+++ b/arch/arm/cortex-m33/gcc/TZ/non_secure/los_exc.S
@@ -247,7 +247,7 @@ _hwiActiveCheck:
CMP R3, #0
BEQ _hwiActiveCheckNext
- // exc occured in IRQ
+ // exc occurred in IRQ
ORR R0, R0, #FLAG_HWI_ACTIVE
RBIT R2, R3
CLZ R2, R2
@@ -300,19 +300,19 @@ _hwiActiveCheckNext:
AND R2, R2,R3
CMP R2,#0
BNE _ExcInMSP
- // exc occured in Task or Init or exc
+ // exc occurred in Task or Init or exc
// reserved for register info from task stack
LDR R2, =g_taskScheduled
LDR R2, [R2]
TST R2, #1 // OS_FLG_BGD_ACTIVE
- BEQ _ExcInMSP // if exc occured in Init then branch
+ BEQ _ExcInMSP // if exc occurred in Init then branch
CMP LR, #0xFFFFFFED //auto push floating registers
BNE _NoFloatInPsp
- // exc occured in Task
+ // exc occurred in Task
MOV R2, R13
SUB R13, #96 // add 8 Bytes reg(for STMFD)
diff --git a/arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c b/arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c
old mode 100755
new mode 100644
index 5339e7eb..f0e54875
--- a/arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c
+++ b/arch/arm/cortex-m33/gcc/TZ/non_secure/los_interrupt.c
@@ -41,11 +41,8 @@
#include "los_membox.h"
#define DEF_HANDLER_START_INDEX 2
-/*lint -save -e40 -e522 -e533*/
UINT32 g_intCount = 0;
-/*lint -restore*/
-
/* *
* @ingroup los_hwi
* Hardware interrupt form mapping handling function array.
@@ -593,7 +590,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
-
+
/* Enable DIV 0 and unaligned exception */
#ifdef LOSCFG_ARCH_UNALIGNED_EXC
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
diff --git a/arch/arm/cortex-m33/gcc/TZ/non_secure/los_timer.c b/arch/arm/cortex-m33/gcc/TZ/non_secure/los_timer.c
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/TZ/non_secure/los_trustzone.c b/arch/arm/cortex-m33/gcc/TZ/non_secure/los_trustzone.c
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/TZ/non_secure/los_trustzone.h b/arch/arm/cortex-m33/gcc/TZ/non_secure/los_trustzone.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/TZ/secure/los_secure_context.c b/arch/arm/cortex-m33/gcc/TZ/secure/los_secure_context.c
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/TZ/secure/los_secure_context.h b/arch/arm/cortex-m33/gcc/TZ/secure/los_secure_context.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/TZ/secure/los_secure_context_asm.S b/arch/arm/cortex-m33/gcc/TZ/secure/los_secure_context_asm.S
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/TZ/secure/los_secure_heap.c b/arch/arm/cortex-m33/gcc/TZ/secure/los_secure_heap.c
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/TZ/secure/los_secure_heap.h b/arch/arm/cortex-m33/gcc/TZ/secure/los_secure_heap.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/gcc/TZ/secure/los_secure_macros.h b/arch/arm/cortex-m33/gcc/TZ/secure/los_secure_macros.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m33/iar/NTZ/los_exc.S b/arch/arm/cortex-m33/iar/NTZ/los_exc.S
index 4b560685..5e6b05a5 100644
--- a/arch/arm/cortex-m33/iar/NTZ/los_exc.S
+++ b/arch/arm/cortex-m33/iar/NTZ/los_exc.S
@@ -56,8 +56,8 @@ FLAG_ADDR_VALID EQU 0x10000
FLAG_HWI_ACTIVE EQU 0x20000
FLAG_NO_FLOAT EQU 0x10000000
-OS_NVIC_FSR EQU 0xE000ED28 ;include BusFault/MemFault/UsageFault State Regeister
-OS_NVIC_HFSR EQU 0xE000ED2C ;HardFault State Regeister
+OS_NVIC_FSR EQU 0xE000ED28 ;include BusFault/MemFault/UsageFault State Register
+OS_NVIC_HFSR EQU 0xE000ED2C ;HardFault State Register
OS_NVIC_BFAR EQU 0xE000ED38
OS_NVIC_MMAR EQU 0xE000ED34
OS_NVIC_ACT_BASE EQU 0xE000E300
@@ -190,7 +190,7 @@ _hwiActiveCheck
CMP R3, #0
BEQ _hwiActiveCheckNext
- ; exc occured in IRQ
+ ; exc occurred in IRQ
ORR R0, R0, #FLAG_HWI_ACTIVE
RBIT R2, R3
CLZ R2, R2
@@ -228,19 +228,19 @@ _hwiActiveCheckNext
AND R2, R2,R3
CMP R2,#0
BNE _ExcInMSP
- ; exc occured in Task or Init or exc
+ ; exc occurred in Task or Init or exc
; reserved for register info from task stack
LDR R2, =g_taskScheduled
LDR R2, [R2]
TST R2, #1 ; OS_FLG_BGD_ACTIVE
- BEQ _ExcInMSP ; if exc occured in Init then branch
+ BEQ _ExcInMSP ; if exc occurred in Init then branch
CMP LR, #0xFFFFFFED ;auto push floating registers
BNE _NoFloatInPsp
- ; exc occured in Task
+ ; exc occurred in Task
MOV R2, R13
SUB R13, #96 ; add 8 Bytes reg(for STMFD)
diff --git a/arch/arm/cortex-m33/iar/NTZ/los_interrupt.c b/arch/arm/cortex-m33/iar/NTZ/los_interrupt.c
index 8858df67..59b86aeb 100644
--- a/arch/arm/cortex-m33/iar/NTZ/los_interrupt.c
+++ b/arch/arm/cortex-m33/iar/NTZ/los_interrupt.c
@@ -46,7 +46,7 @@ UINT32 g_intCount = 0;
/*lint -restore*/
#pragma location = ".data.vector"
-#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN
+#pragma data_alignment = LOSCFG_ARCH_HWI_VECTOR_ALIGN
/* *
* @ingroup los_hwi
* hardware interrupt form mapping handling function array.
diff --git a/arch/arm/cortex-m33/iar/TZ/non_secure/los_exc.S b/arch/arm/cortex-m33/iar/TZ/non_secure/los_exc.S
index d592de54..c15c0382 100644
--- a/arch/arm/cortex-m33/iar/TZ/non_secure/los_exc.S
+++ b/arch/arm/cortex-m33/iar/TZ/non_secure/los_exc.S
@@ -55,8 +55,8 @@ FLAG_ADDR_VALID EQU 0x10000
FLAG_HWI_ACTIVE EQU 0x20000
FLAG_NO_FLOAT EQU 0x10000000
-OS_NVIC_FSR EQU 0xE000ED28 ;include BusFault/MemFault/UsageFault State Regeister
-OS_NVIC_HFSR EQU 0xE000ED2C ;HardFault State Regeister
+OS_NVIC_FSR EQU 0xE000ED28 ;include BusFault/MemFault/UsageFault State Register
+OS_NVIC_HFSR EQU 0xE000ED2C ;HardFault State Register
OS_NVIC_BFAR EQU 0xE000ED38
OS_NVIC_MMAR EQU 0xE000ED34
OS_NVIC_ACT_BASE EQU 0xE000E300
@@ -179,7 +179,7 @@ _hwiActiveCheck
CMP R3, #0
BEQ _hwiActiveCheckNext
- ; exc occured in IRQ
+ ; exc occurred in IRQ
ORR R0, R0, #FLAG_HWI_ACTIVE
RBIT R2, R3
CLZ R2, R2
@@ -217,19 +217,19 @@ _hwiActiveCheckNext
AND R2, R2,R3
CMP R2,#0
BNE _ExcInMSP
- ; exc occured in Task or Init or exc
+ ; exc occurred in Task or Init or exc
; reserved for register info from task stack
LDR R2, =g_taskScheduled
LDR R2, [R2]
TST R2, #1 ; OS_FLG_BGD_ACTIVE
- BEQ _ExcInMSP ; if exc occured in Init then branch
+ BEQ _ExcInMSP ; if exc occurred in Init then branch
CMP LR, #0xFFFFFFED ;auto push floating registers
BNE _NoFloatInPsp
- ; exc occured in Task
+ ; exc occurred in Task
MOV R2, R13
SUB R13, #96 ; add 8 Bytes reg(for STMFD)
diff --git a/arch/arm/cortex-m33/iar/TZ/non_secure/los_interrupt.c b/arch/arm/cortex-m33/iar/TZ/non_secure/los_interrupt.c
index 8858df67..59b86aeb 100644
--- a/arch/arm/cortex-m33/iar/TZ/non_secure/los_interrupt.c
+++ b/arch/arm/cortex-m33/iar/TZ/non_secure/los_interrupt.c
@@ -46,7 +46,7 @@ UINT32 g_intCount = 0;
/*lint -restore*/
#pragma location = ".data.vector"
-#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN
+#pragma data_alignment = LOSCFG_ARCH_HWI_VECTOR_ALIGN
/* *
* @ingroup los_hwi
* hardware interrupt form mapping handling function array.
diff --git a/arch/arm/cortex-m33/iar/TZ/secure/los_secure_heap.c b/arch/arm/cortex-m33/iar/TZ/secure/los_secure_heap.c
index 2c7f15ae..7f0077e0 100644
--- a/arch/arm/cortex-m33/iar/TZ/secure/los_secure_heap.c
+++ b/arch/arm/cortex-m33/iar/TZ/secure/los_secure_heap.c
@@ -34,7 +34,7 @@
#include "los_config.h"
#include "los_list.h"
-#pragma data_alignment=0x4
+#pragma data_alignment = 0x4
STATIC UINT8 g_secureHeap[LOSCFG_SECURE_HEAP_SIZE] = {0};
STATIC LOS_DL_LIST g_secureHeapFreeList = {NULL, NULL};
diff --git a/arch/arm/cortex-m4/gcc/los_exc.S b/arch/arm/cortex-m4/gcc/los_exc.S
index 761f6c44..97c0db16 100644
--- a/arch/arm/cortex-m4/gcc/los_exc.S
+++ b/arch/arm/cortex-m4/gcc/los_exc.S
@@ -263,7 +263,7 @@ _hwiActiveCheck:
CMP R3, #0
BEQ _hwiActiveCheckNext
- // exc occured in IRQ
+ // exc occurred in IRQ
ORR R0, R0, #FLAG_HWI_ACTIVE
RBIT R2, R3
CLZ R2, R2
@@ -316,19 +316,19 @@ _hwiActiveCheckNext:
AND R2, R2,R3
CMP R2,#0
BNE _ExcInMSP
- // exc occured in Task or Init or exc
+ // exc occurred in Task or Init or exc
// reserved for register info from task stack
LDR R2, =g_taskScheduled
LDR R2, [R2]
TST R2, #1 // OS_FLG_BGD_ACTIVE
- BEQ _ExcInMSP // if exc occured in Init then branch
+ BEQ _ExcInMSP // if exc occurred in Init then branch
CMP LR, #0xFFFFFFED //auto push floating registers
BNE _NoFloatInPsp
- // exc occured in Task
+ // exc occurred in Task
MOV R2, R13
SUB R13, #96 // add 8 Bytes reg(for STMFD)
diff --git a/arch/arm/cortex-m4/gcc/los_interrupt.c b/arch/arm/cortex-m4/gcc/los_interrupt.c
index c6a09db2..a71c31d7 100644
--- a/arch/arm/cortex-m4/gcc/los_interrupt.c
+++ b/arch/arm/cortex-m4/gcc/los_interrupt.c
@@ -40,11 +40,8 @@
#include "los_memory.h"
#include "los_membox.h"
-/*lint -save -e40 -e522 -e533*/
UINT32 g_intCount = 0;
-/*lint -restore*/
-
/* *
* @ingroup los_hwi
* Hardware interrupt form mapping handling function array.
@@ -193,7 +190,6 @@ inline UINT32 ArchIsIntActive(VOID)
Output : None
Return : None
**************************************************************************** */
-/*lint -e529*/
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
{
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HwiNumGet());
@@ -607,7 +603,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
-
+
/* Enable DIV 0 and unaligned exception */
#ifdef LOSCFG_ARCH_UNALIGNED_EXC
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
diff --git a/arch/arm/cortex-m4/iar/los_exc.S b/arch/arm/cortex-m4/iar/los_exc.S
index b85290f1..2a3183e1 100644
--- a/arch/arm/cortex-m4/iar/los_exc.S
+++ b/arch/arm/cortex-m4/iar/los_exc.S
@@ -190,7 +190,7 @@ _hwiActiveCheck
CMP R3, #0
BEQ _hwiActiveCheckNext
- ; exc occured in IRQ
+ ; exc occurred in IRQ
ORR R0, R0, #FLAG_HWI_ACTIVE
RBIT R2, R3
CLZ R2, R2
@@ -228,19 +228,19 @@ _hwiActiveCheckNext
AND R2, R2,R3
CMP R2,#0
BNE _ExcInMSP
- ; exc occured in Task or Init or exc
+ ; exc occurred in Task or Init or exc
; reserved for register info from task stack
LDR R2, =g_taskScheduled
LDR R2, [R2]
TST R2, #1 ; OS_FLG_BGD_ACTIVE
- BEQ _ExcInMSP ; if exc occured in Init then branch
+ BEQ _ExcInMSP ; if exc occurred in Init then branch
CMP LR, #0xFFFFFFED ;auto push floating registers
BNE _NoFloatInPsp
- ; exc occured in Task
+ ; exc occurred in Task
MOV R2, R13
SUB R13, #96 ; add 8 Bytes reg(for STMFD)
diff --git a/arch/arm/cortex-m4/iar/los_interrupt.c b/arch/arm/cortex-m4/iar/los_interrupt.c
index f589c996..3ab655f7 100644
--- a/arch/arm/cortex-m4/iar/los_interrupt.c
+++ b/arch/arm/cortex-m4/iar/los_interrupt.c
@@ -41,13 +41,11 @@
#include "los_memory.h"
#include "los_membox.h"
-/*lint -save -e40 -e522 -e533*/
UINT32 g_intCount = 0;
-/*lint -restore*/
#ifdef __ICCARM__
#pragma location = ".data.vector"
-#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN
+#pragma data_alignment = LOSCFG_ARCH_HWI_VECTOR_ALIGN
#elif defined(__CC_ARM) || defined(__GNUC__)
LITE_OS_SEC_VEC
#endif
@@ -603,7 +601,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
-
+
/* Enable DIV 0 and unaligned exception */
#ifdef LOSCFG_ARCH_UNALIGNED_EXC
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
diff --git a/arch/arm/cortex-m55/gcc/BUILD.gn b/arch/arm/cortex-m55/gcc/BUILD.gn
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m55/gcc/NTZ/BUILD.gn b/arch/arm/cortex-m55/gcc/NTZ/BUILD.gn
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m55/gcc/NTZ/los_arch_atomic.h b/arch/arm/cortex-m55/gcc/NTZ/los_arch_atomic.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m55/gcc/NTZ/los_arch_context.h b/arch/arm/cortex-m55/gcc/NTZ/los_arch_context.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m55/gcc/NTZ/los_arch_interrupt.h b/arch/arm/cortex-m55/gcc/NTZ/los_arch_interrupt.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m55/gcc/NTZ/los_arch_timer.h b/arch/arm/cortex-m55/gcc/NTZ/los_arch_timer.h
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m55/gcc/NTZ/los_context.c b/arch/arm/cortex-m55/gcc/NTZ/los_context.c
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m55/gcc/NTZ/los_dispatch.S b/arch/arm/cortex-m55/gcc/NTZ/los_dispatch.S
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m55/gcc/NTZ/los_exc.S b/arch/arm/cortex-m55/gcc/NTZ/los_exc.S
old mode 100755
new mode 100644
index c23af56f..9d996855
--- a/arch/arm/cortex-m55/gcc/NTZ/los_exc.S
+++ b/arch/arm/cortex-m55/gcc/NTZ/los_exc.S
@@ -260,7 +260,7 @@ _hwiActiveCheck:
CMP R3, #0
BEQ _hwiActiveCheckNext
- // exc occured in IRQ
+ // exc occurred in IRQ
ORR R0, R0, #FLAG_HWI_ACTIVE
RBIT R2, R3
CLZ R2, R2
@@ -313,19 +313,19 @@ _hwiActiveCheckNext:
AND R2, R2, R3
CMP R2, #0
BNE _ExcInMSP
- // exc occured in Task or Init or exc
+ // exc occurred in Task or Init or exc
// reserved for register info from task stack
LDR R2, =g_taskScheduled
LDR R2, [R2]
TST R2, #1 // OS_FLG_BGD_ACTIVE
- BEQ _ExcInMSP // if exc occured in Init then branch
+ BEQ _ExcInMSP // if exc occurred in Init then branch
CMP LR, #0xFFFFFFED //auto push floating registers
BNE _NoFloatInPsp
- // exc occured in Task
+ // exc occurred in Task
MOV R2, R13
SUB R13, #96 // add 8 Bytes reg(for STMFD)
diff --git a/arch/arm/cortex-m55/gcc/NTZ/los_interrupt.c b/arch/arm/cortex-m55/gcc/NTZ/los_interrupt.c
old mode 100755
new mode 100644
index b468ee73..b7572b9b
--- a/arch/arm/cortex-m55/gcc/NTZ/los_interrupt.c
+++ b/arch/arm/cortex-m55/gcc/NTZ/los_interrupt.c
@@ -40,10 +40,8 @@
#include "los_membox.h"
#define DEF_HANDLER_START_INDEX 2
-/*lint -save -e40 -e522 -e533*/
UINT32 g_intCount = 0;
-/*lint -restore*/
/* *
* @ingroup los_hwi
@@ -193,7 +191,6 @@ inline UINT32 ArchIsIntActive(VOID)
Output : None
Return : None
**************************************************************************** */
-/*lint -e529*/
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
{
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HwiNumGet());
diff --git a/arch/arm/cortex-m55/gcc/NTZ/los_timer.c b/arch/arm/cortex-m55/gcc/NTZ/los_timer.c
old mode 100755
new mode 100644
diff --git a/arch/arm/cortex-m7/gcc/los_exc.S b/arch/arm/cortex-m7/gcc/los_exc.S
index 74cfaa98..2fb5656d 100644
--- a/arch/arm/cortex-m7/gcc/los_exc.S
+++ b/arch/arm/cortex-m7/gcc/los_exc.S
@@ -263,7 +263,7 @@ _hwiActiveCheck:
CMP R3, #0
BEQ _hwiActiveCheckNext
- // exc occured in IRQ
+ // exc occurred in IRQ
ORR R0, R0, #FLAG_HWI_ACTIVE
RBIT R2, R3
CLZ R2, R2
@@ -316,19 +316,19 @@ _hwiActiveCheckNext:
AND R2, R2,R3
CMP R2,#0
BNE _ExcInMSP
- // exc occured in Task or Init or exc
+ // exc occurred in Task or Init or exc
// reserved for register info from task stack
LDR R2, =g_taskScheduled
LDR R2, [R2]
TST R2, #1 // OS_FLG_BGD_ACTIVE
- BEQ _ExcInMSP // if exc occured in Init then branch
+ BEQ _ExcInMSP // if exc occurred in Init then branch
CMP LR, #0xFFFFFFED //auto push floating registers
BNE _NoFloatInPsp
- // exc occured in Task
+ // exc occurred in Task
MOV R2, R13
SUB R13, #96 // add 8 Bytes reg(for STMFD)
diff --git a/arch/arm/cortex-m7/gcc/los_interrupt.c b/arch/arm/cortex-m7/gcc/los_interrupt.c
index a0a944e2..bfff8de4 100644
--- a/arch/arm/cortex-m7/gcc/los_interrupt.c
+++ b/arch/arm/cortex-m7/gcc/los_interrupt.c
@@ -40,11 +40,8 @@
#include "los_memory.h"
#include "los_membox.h"
-/*lint -save -e40 -e522 -e533*/
UINT32 g_intCount = 0;
-/*lint -restore*/
-
/* *
* @ingroup los_hwi
* Hardware interrupt form mapping handling function array.
@@ -188,7 +185,6 @@ inline UINT32 ArchIsIntActive(VOID)
Output : None
Return : None
**************************************************************************** */
-/*lint -e529*/
LITE_OS_SEC_TEXT_MINOR VOID HalHwiDefaultHandler(VOID)
{
PRINT_ERR("%s irqnum:%u\n", __FUNCTION__, HwiNumGet());
@@ -592,7 +588,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
-
+
/* Enable DIV 0 and unaligned exception */
#ifdef LOSCFG_ARCH_UNALIGNED_EXC
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
diff --git a/arch/arm/cortex-m7/iar/los_exc.S b/arch/arm/cortex-m7/iar/los_exc.S
index 31d787cb..409166e0 100644
--- a/arch/arm/cortex-m7/iar/los_exc.S
+++ b/arch/arm/cortex-m7/iar/los_exc.S
@@ -190,7 +190,7 @@ _hwiActiveCheck
CMP R3, #0
BEQ _hwiActiveCheckNext
- ; exc occured in IRQ
+ ; exc occurred in IRQ
ORR R0, R0, #FLAG_HWI_ACTIVE
RBIT R2, R3
CLZ R2, R2
@@ -228,19 +228,19 @@ _hwiActiveCheckNext
AND R2, R2,R3
CMP R2,#0
BNE _ExcInMSP
- ; exc occured in Task or Init or exc
+ ; exc occurred in Task or Init or exc
; reserved for register info from task stack
LDR R2, =g_taskScheduled
LDR R2, [R2]
TST R2, #1 ; OS_FLG_BGD_ACTIVE
- BEQ _ExcInMSP ; if exc occured in Init then branch
+ BEQ _ExcInMSP ; if exc occurred in Init then branch
CMP LR, #0xFFFFFFED ;auto push floating registers
BNE _NoFloatInPsp
- ; exc occured in Task
+ ; exc occurred in Task
MOV R2, R13
SUB R13, #96 ; add 8 Bytes reg(for STMFD)
diff --git a/arch/arm/cortex-m7/iar/los_interrupt.c b/arch/arm/cortex-m7/iar/los_interrupt.c
index c930a7d5..36795fe0 100644
--- a/arch/arm/cortex-m7/iar/los_interrupt.c
+++ b/arch/arm/cortex-m7/iar/los_interrupt.c
@@ -41,12 +41,10 @@
#include "los_memory.h"
#include "los_membox.h"
-/*lint -save -e40 -e522 -e533*/
UINT32 g_intCount = 0;
-/*lint -restore*/
#pragma location = ".data.vector"
-#pragma data_alignment=LOSCFG_ARCH_HWI_VECTOR_ALIGN
+#pragma data_alignment = LOSCFG_ARCH_HWI_VECTOR_ALIGN
/* *
* @ingroup los_hwi
* Hardware interrupt form mapping handling function array.
@@ -599,7 +597,7 @@ LITE_OS_SEC_TEXT_INIT VOID HalHwiInit(VOID)
/* Enable USGFAULT, BUSFAULT, MEMFAULT */
*(volatile UINT32 *)OS_NVIC_SHCSR |= (USGFAULT | BUSFAULT | MEMFAULT);
-
+
/* Enable DIV 0 and unaligned exception */
*(volatile UINT32 *)OS_NVIC_CCR |= (DIV0FAULT | UNALIGNFAULT);
diff --git a/arch/csky/v2/gcc/BUILD.gn b/arch/csky/v2/gcc/BUILD.gn
old mode 100755
new mode 100644
diff --git a/arch/include/los_atomic.h b/arch/include/los_atomic.h
old mode 100755
new mode 100644
diff --git a/arch/risc-v/nuclei/gcc/los_exc.S b/arch/risc-v/nuclei/gcc/los_exc.S
index fea0f9ad..5f19277c 100644
--- a/arch/risc-v/nuclei/gcc/los_exc.S
+++ b/arch/risc-v/nuclei/gcc/los_exc.S
@@ -179,7 +179,6 @@ exc_entry:
csrr a0, mcause
mv a1, sp
/*
- * TODO: Call the exception handler function
* By default, the function template is provided in
* system_Device.c, you can adjust it as you want
*/
diff --git a/arch/risc-v/nuclei/gcc/nmsis/Core/Include/core_feature_dsp.h b/arch/risc-v/nuclei/gcc/nmsis/Core/Include/core_feature_dsp.h
index 4d41e553..ee3aab8f 100644
--- a/arch/risc-v/nuclei/gcc/nmsis/Core/Include/core_feature_dsp.h
+++ b/arch/risc-v/nuclei/gcc/nmsis/Core/Include/core_feature_dsp.h
@@ -105,7 +105,7 @@
* Based on the types of the four 8-bit arithmetic operations, the SIMD 8-bit add/subtract instructions
* can be classified into 2 main categories: Addition (four 8-bit addition), and Subtraction (four 8-bit
* subtraction).
- * Based on the way of how an overflow condition is handled for singed or unsigned operation, the
+ * Based on the way of how an overflow condition is handled for signed or unsigned operation, the
* SIMD 8-bit add/subtract instructions can be classified into 5 groups: Wrap-around (dropping
* overflow), Signed Halving (keeping overflow by dropping 1 LSB bit), Unsigned Halving, Signed
* Saturation (clipping overflow), and Unsigned Saturation.
diff --git a/arch/risc-v/riscv32/gcc/los_arch_atomic.h b/arch/risc-v/riscv32/gcc/los_arch_atomic.h
index 5f409a20..8703d6a2 100644
--- a/arch/risc-v/riscv32/gcc/los_arch_atomic.h
+++ b/arch/risc-v/riscv32/gcc/los_arch_atomic.h
@@ -33,6 +33,7 @@
#define _LOS_ARCH_ATOMIC_H
#include "los_compiler.h"
+#include "los_interrupt.h"
#ifdef __cplusplus
#if __cplusplus
diff --git a/arch/risc-v/riscv32/gcc/los_interrupt.c b/arch/risc-v/riscv32/gcc/los_interrupt.c
index fa05051a..7533eefb 100644
--- a/arch/risc-v/riscv32/gcc/los_interrupt.c
+++ b/arch/risc-v/riscv32/gcc/los_interrupt.c
@@ -332,7 +332,7 @@ VOID HalExcEntry(const LosExcContext *excBufAddr)
ExcInfoDisplay(excBufAddr);
if (LOS_TaskIsRunning()) {
- PRINTK("----------------All Task infomation ------------\n");
+ PRINTK("----------------All Task information ------------\n");
OsGetAllTskInfo();
}
diff --git a/components/backtrace/los_backtrace.h b/components/backtrace/los_backtrace.h
index 1ed52f13..87c8c612 100644
--- a/components/backtrace/los_backtrace.h
+++ b/components/backtrace/los_backtrace.h
@@ -52,8 +52,8 @@ extern "C" {
#define CODE_SECTION_NAME ".text"
/* The default C stack section name is CSTACK */
#define CSTACK_SECTION_NAME "CSTACK"
-#pragma section=CODE_SECTION_NAME
-#pragma section=CSTACK_SECTION_NAME
+#pragma section = CODE_SECTION_NAME
+#pragma section = CSTACK_SECTION_NAME
/* Default only one code section. In fact, there may be more than one.
You can define more than one and redefine the OsStackDataIsCodeAddr function
diff --git a/components/cpup/los_cpup.c b/components/cpup/los_cpup.c
index 9c0c31ba..cffe7398 100644
--- a/components/cpup/los_cpup.c
+++ b/components/cpup/los_cpup.c
@@ -82,7 +82,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsCpupInit()
/*****************************************************************************
Function : OsTskCycleStart
-Description: start task to get cycles count in current task begining
+Description: start task to get cycles count in current task beginning
Input : None
Return : None
*****************************************************************************/
diff --git a/components/dynlink/los_dynlink.c b/components/dynlink/los_dynlink.c
old mode 100755
new mode 100644
index f62b1b4f..cfcae348
--- a/components/dynlink/los_dynlink.c
+++ b/components/dynlink/los_dynlink.c
@@ -73,8 +73,8 @@ const SymInfo symTableEnd __attribute__((section(".table.end"))) = {
.name = "end",
.addr = 0
};
-#pragma section=".TABLE.START"
-#pragma section=".table.end"
+#pragma section = ".TABLE.START"
+#pragma section = ".table.end"
#elif defined(__CLANG_ARM) || defined(__GNUC__)
/**
* Place instructions below in rodata segment of .ld linker file:
@@ -796,13 +796,13 @@ VOID *LOS_SoLoad(const CHAR *fileName, VOID *pool)
return dso;
ERR2:
- LOS_MemFree(dso->pool, (VOID *)dso->loadBase);
+ (VOID)LOS_MemFree(dso->pool, (VOID *)dso->loadBase);
ERR1:
close(dso->fd);
(VOID)LOS_MuxPost(g_dynlinkMux);
- LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo->elfPhdr);
- LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo);
- LOS_MemFree(OS_SYS_MEM_ADDR, dso);
+ (VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo->elfPhdr);
+ (VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo);
+ (VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dso);
return NULL;
}
@@ -902,9 +902,12 @@ INT32 LOS_SoUnload(VOID *handle)
LOS_ListDelete(&dso->dsoNode);
(VOID)LOS_MuxPost(g_dynlinkMux);
- LOS_MemFree(dso->pool, (VOID *)dso->loadBase);
- LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo);
- LOS_MemFree(OS_SYS_MEM_ADDR, dso);
+ (VOID)LOS_MemFree(dso->pool, (VOID *)dso->loadBase);
+ if (dso->dlInfo != NULL) {
+ (VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo->elfPhdr);
+ }
+ (VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dso->dlInfo);
+ (VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dso);
return LOS_OK;
ERR:
diff --git a/components/dynlink/los_dynlink.h b/components/dynlink/los_dynlink.h
old mode 100755
new mode 100644
index e6b60440..c152c373
--- a/components/dynlink/los_dynlink.h
+++ b/components/dynlink/los_dynlink.h
@@ -169,7 +169,7 @@ VOID *LOS_SoLoad(const CHAR *fileName, VOID *pool);
VOID *LOS_FindSym(VOID *handle, const CHAR *name);
/*
- * @brief Decrement the reference count on the loaded shared library refered to by handle.
+ * @brief Decrement the reference count on the loaded shared library referred to by handle.
* If the reference count drops to zero, then the library is unloaded.
*
* This function validates that the handle is valid.
diff --git a/components/exchook/los_exc_info.c b/components/exchook/los_exc_info.c
index a4ab3452..334d852a 100644
--- a/components/exchook/los_exc_info.c
+++ b/components/exchook/los_exc_info.c
@@ -55,7 +55,7 @@ STATIC ExcInfoArray g_excArray[OS_EXC_TYPE_MAX];
STATIC UINT32 OsExcSaveIntStatus(UINT32 type, VOID *arg)
{
- UINT32 ret;
+ errno_t ret;
UINTPTR excContentEnd = (UINTPTR)MAX_INT_INFO_SIZE + (UINTPTR)g_excContent;
(VOID)arg;
diff --git a/components/fs/littlefs/lfs_api.c b/components/fs/littlefs/lfs_api.c
index 5c3e21cb..3e9d930e 100644
--- a/components/fs/littlefs/lfs_api.c
+++ b/components/fs/littlefs/lfs_api.c
@@ -336,19 +336,19 @@ int LfsMount(const char *source, const char *target, const char *fileSystemType,
if (target == NULL || fileSystemType == NULL || data == NULL) {
errno = EFAULT;
ret = VFS_ERROR;
- goto errout;
+ goto ERROUT;
}
if (strcmp(fileSystemType, "littlefs") != 0) {
errno = ENODEV;
ret = VFS_ERROR;
- goto errout;
+ goto ERROUT;
}
if (CheckPathIsMounted(target, &fileOpInfo)) {
errno = EBUSY;
ret = VFS_ERROR;
- goto errout;
+ goto ERROUT;
}
// select free mount resource
@@ -356,7 +356,7 @@ int LfsMount(const char *source, const char *target, const char *fileSystemType,
if (fileOpInfo == NULL) {
errno = ENODEV;
ret = VFS_ERROR;
- goto errout;
+ goto ERROUT;
}
ret = lfs_mount(&(fileOpInfo->lfsInfo), (struct lfs_config*)data);
@@ -372,7 +372,7 @@ int LfsMount(const char *source, const char *target, const char *fileSystemType,
ret = VFS_ERROR;
}
-errout:
+ERROUT:
return ret;
}
@@ -483,23 +483,23 @@ DIR *LfsOpendir(const char *dirName)
if (dirName == NULL) {
errno = EFAULT;
- goto errout;
+ goto ERROUT;
}
if (CheckPathIsMounted(dirName, &fileOpInfo) == FALSE || fileOpInfo == NULL) {
errno = ENOENT;
- goto errout;
+ goto ERROUT;
}
if (CheckDirIsOpen(dirName)) {
errno = EBUSY;
- goto errout;
+ goto ERROUT;
}
FileDirInfo *dirInfo = GetFreeDir(dirName);
if (dirInfo == NULL) {
errno = ENFILE;
- goto errout;
+ goto ERROUT;
}
ret = lfs_dir_open(&(fileOpInfo->lfsInfo), (lfs_dir_t *)(&(dirInfo->dir)), dirName);
@@ -507,14 +507,14 @@ DIR *LfsOpendir(const char *dirName)
if (ret != 0) {
FreeDirInfo(dirName);
errno = LittlefsErrno(ret);
- goto errout;
+ goto ERROUT;
}
dirInfo->lfsHandle = &(fileOpInfo->lfsInfo);
return (DIR *)dirInfo;
-errout:
+ERROUT:
return NULL;
}
@@ -584,23 +584,23 @@ int LfsOpen(const char *pathName, int openFlag, ...)
if (pathName == NULL) {
errno = EFAULT;
- goto errout;
+ goto ERROUT;
}
if (CheckPathIsMounted(pathName, &fileOpInfo) == FALSE || fileOpInfo == NULL) {
errno = ENOENT;
- goto errout;
+ goto ERROUT;
}
// if file is already open, return invalid fd
if (CheckFileIsOpen(pathName)) {
errno = EBUSY;
- goto errout;
+ goto ERROUT;
}
LittleFsHandleStruct *fsHandle = LfsAllocFd(pathName, &fd);
if (fd == INVALID_FD) {
errno = ENFILE;
- goto errout;
+ goto ERROUT;
}
int lfsOpenFlag = ConvertFlagToLfsOpenFlag(openFlag);
@@ -608,13 +608,13 @@ int LfsOpen(const char *pathName, int openFlag, ...)
if (err != 0) {
LfsFreeFd(fd);
errno = LittlefsErrno(err);
- goto errout;
+ goto ERROUT;
}
g_handle[fd].lfsHandle = &(fileOpInfo->lfsInfo);
return fd;
-errout:
+ERROUT:
return INVALID_FD;
}
diff --git a/components/iar_tls/los_iar_tls.c b/components/iar_tls/los_iar_tls.c
index 03db7ebd..3f94cf18 100644
--- a/components/iar_tls/los_iar_tls.c
+++ b/components/iar_tls/los_iar_tls.c
@@ -54,7 +54,7 @@ void __DLIB_TLS_MEMORY *__iar_dlib_perthread_access(void _DLIB_TLS_MEMORY *symbp
}
#else /* IAR version 8 or above. */
-#pragma section="__iar_tls$$DATA"
+#pragma section = "__iar_tls$$DATA"
void *__aeabi_read_tp(void)
{
if (!LOS_TaskIsRunning()) {
@@ -211,4 +211,4 @@ void __iar_file_Mtxunlock(__iar_Rmtx *m)
if (LOS_TaskIsRunning()) {
(void)LOS_MuxPost(muxInfo->muxID);
}
-}
\ No newline at end of file
+}
diff --git a/components/lmk/los_lmk.h b/components/lmk/los_lmk.h
index d06704f6..c5a0637f 100644
--- a/components/lmk/los_lmk.h
+++ b/components/lmk/los_lmk.h
@@ -128,7 +128,7 @@ typedef struct {
* @param lmkNode [IN] The LosLmkOpsNode node to be registered.
*
* @retval LOS_OK The LosLmkOpsNode node is registered successfully.
- * @retval LOS_ERRNO_LMK_INVALID_PARAMETER The paramter is invalid.
+ * @retval LOS_ERRNO_LMK_INVALID_PARAMETER The parameter is invalid.
* @retval LOS_ERRNO_LMK_ALREADY_REGISTERED The LosLmkOpsNode node already registered.
* @par Dependency:
*
- los_lmk.h: the header file that contains the API declaration.
diff --git a/components/lms/lms_libc.c b/components/lms/lms_libc.c
old mode 100755
new mode 100644
diff --git a/components/lms/los_lms.c b/components/lms/los_lms.c
old mode 100755
new mode 100644
index be43c415..8886305b
--- a/components/lms/los_lms.c
+++ b/components/lms/los_lms.c
@@ -182,11 +182,12 @@ VOID LOS_LmsCheckPoolDel(const VOID *pool)
LmsMemListNode *delNode = OsLmsGetPoolNode(pool);
if (delNode == NULL) {
PRINT_ERR("[LMS]pool %p is not on lms checklist !\n", pool);
- goto Release;
+ goto REALEASE;
}
delNode->used = LMS_POOL_UNUSED;
LOS_ListDelete(&(delNode->node));
-Release:
+
+REALEASE:
LMS_UNLOCK(intSave);
}
diff --git a/components/lms/los_lms.h b/components/lms/los_lms.h
old mode 100755
new mode 100644
diff --git a/components/lms/los_lms_pri.h b/components/lms/los_lms_pri.h
old mode 100755
new mode 100644
diff --git a/components/net/lwip-2.1/enhancement/src/fixme.c b/components/net/lwip-2.1/enhancement/src/fixme.c
index 19e83eb9..6e33765b 100644
--- a/components/net/lwip-2.1/enhancement/src/fixme.c
+++ b/components/net/lwip-2.1/enhancement/src/fixme.c
@@ -124,7 +124,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
u16_t *a16 = (u16_t *)addr->addr;
int squash_pos = ipv6_blocks;
int i;
- const char *sc = cp;
+ const unsigned char *sc = (const unsigned char *)cp;
const char *ss = cp-1;
for (; ; sc++) {
diff --git a/components/net/lwip-2.1/porting/src/api_shell.c b/components/net/lwip-2.1/porting/src/api_shell.c
index 959db672..ec4da034 100644
--- a/components/net/lwip-2.1/porting/src/api_shell.c
+++ b/components/net/lwip-2.1/porting/src/api_shell.c
@@ -217,19 +217,11 @@ void lwip_ifconfig_show_internal(void *arg)
sys_sem_signal(&ifconfig_cmd->cb_completed);
}
-/*lint -e838 -e438*/
u32_t lwip_ifconfig(int argc, const char **argv)
{
static struct ifconfig_option ifconfig_cmd;
err_t ret;
-#if LWIP_STATS
- u32_t stat_err_cnt;
- u32_t stat_drop_cnt;
- u32_t stat_rx_or_tx_cnt;
- u32_t stat_rx_or_tx_bytes;
-#endif
-
(void)memset_s(&ifconfig_cmd, sizeof(ifconfig_cmd), 0, sizeof(ifconfig_cmd));
if (sys_sem_new(&ifconfig_cmd.cb_completed, 0) != ERR_OK) {
PRINTK("%s: sys_sem_new fail\n", __FUNCTION__);
@@ -252,7 +244,6 @@ u32_t lwip_ifconfig(int argc, const char **argv)
return 0;
}
-/*lint +e838 +e438*/
#if LWIP_DNS
#ifndef LWIP_TESTBED
@@ -278,7 +269,7 @@ struct hostent *gethostnameinfo(const char *host, char *tmphstbuf, size_t hstbuf
LWIP_STATIC unsigned int get_hostip(const char *hname)
{
unsigned int ip = 0;
- int ret;
+ errno_t ret;
const size_t hstbuflen = 1024;
char *tmphstbuf = NULL;
@@ -292,7 +283,7 @@ LWIP_STATIC unsigned int get_hostip(const char *hname)
return 0;
}
ret = memcpy_s(&ip, sizeof(ip), pent->h_addr, 4);
- if (ret != 0) {
+ if (ret != EOK) {
free(tmphstbuf);
return 0;
}
@@ -497,7 +488,7 @@ LWIP_STATIC int OsPingFunc(u32_t *parg)
PRINTK("\nPing: parameter problem ...");
break;
default:
- PRINTK("\nPing: unknow error ...");
+ PRINTK("\nPing: unknown error ...");
break;
}
i++;
@@ -527,7 +518,7 @@ static void ping_cmd(u32_t *parg)
if (ret < 0) {
PRINTK("Ping cmd failed due to some errors\n");
}
-
+ free(parg);
ping_taskid = -1;
}
@@ -589,7 +580,6 @@ u32_t OsShellPing(int argc, const char **argv)
stPingTask.uwArg = (UINTPTR)parg;
ret = LOS_TaskCreate((UINT32 *)(&ping_taskid), &stPingTask);
if (ret != LOS_OK) {
- free(parg);
PRINTK("ping_task create failed 0x%08x.\n", ret);
count = LWIP_SHELL_CMD_PING_RETRY_TIMES;
} else {
@@ -605,6 +595,8 @@ u32_t OsShellPing(int argc, const char **argv)
PRINTK("Ping cmd failed due some errors\n");
}
+ free(parg);
+
return LOS_OK;
ping_error:
lwip_ping_usage();
diff --git a/components/net/lwip-2.1/porting/src/driverif.c b/components/net/lwip-2.1/porting/src/driverif.c
index d16ba5cc..f1d8abe5 100644
--- a/components/net/lwip-2.1/porting/src/driverif.c
+++ b/components/net/lwip-2.1/porting/src/driverif.c
@@ -34,8 +34,6 @@
#include
#include
#include
-#include
-#include
#include
#define LWIP_NETIF_HOSTNAME_DEFAULT "default"
diff --git a/components/net/lwip-2.1/porting/src/sys_arch.c b/components/net/lwip-2.1/porting/src/sys_arch.c
index 35661397..1378e134 100644
--- a/components/net/lwip-2.1/porting/src/sys_arch.c
+++ b/components/net/lwip-2.1/porting/src/sys_arch.c
@@ -33,11 +33,9 @@
#include
#include
#include
-#include
#include
#include
#include
-#include
#include
#ifndef LOSCFG_KERNEL_SMP
@@ -151,7 +149,7 @@ err_t sys_mbox_new(sys_mbox_t *mbox, int size)
}
CHAR qName[] = "lwIP";
- UINT32 ret = LOS_QueueCreate(qName, (UINT16)size, mbox, 0, sizeof(void *));
+ UINT32 ret = LOS_QueueCreate(qName, (UINT16)size, (UINT32 *)mbox, 0, sizeof(void *));
switch (ret) {
case LOS_OK:
return ERR_OK;
@@ -202,6 +200,8 @@ err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg)
err_t sys_mbox_trypost_fromisr(sys_mbox_t *mbox, void *msg)
{
+ (void)mbox;
+ (void)msg;
return ERR_ARG;
}
@@ -292,7 +292,7 @@ err_t sys_sem_new(sys_sem_t *sem, u8_t count)
return ERR_ARG;
}
- UINT32 ret = LOS_SemCreate(count, sem);
+ UINT32 ret = LOS_SemCreate(count, (UINT32 *)(sem));
if (ret != LOS_OK) {
return ERR_ARG;
}
@@ -367,7 +367,7 @@ err_t sys_mutex_new(sys_mutex_t *mutex)
return ERR_ARG;
}
- UINT32 ret = LOS_MuxCreate(mutex);
+ UINT32 ret = LOS_MuxCreate((UINT32 *)mutex);
if (ret != LOS_OK) {
return ERR_ARG;
}
diff --git a/components/net/test/net_socket_test_011.c b/components/net/test/net_socket_test_011.c
index 32174654..57884381 100644
--- a/components/net/test/net_socket_test_011.c
+++ b/components/net/test/net_socket_test_011.c
@@ -217,7 +217,6 @@ static void ParsePackageIpUdp(struct netif *netif, struct pbuf *btBuf)
ICUNIT_ASSERT_EQUAL(dataLen, strlen(MSG), 4);
LogPrintln("=================================");
- // 回应udp报文
ReplayUdpTask();
}
@@ -229,7 +228,6 @@ static void ParsePackageEthernet(struct netif *netif, struct pbuf *p)
ethhdr = (struct eth_hdr *)p->payload;
u16_t type = ethhdr->type;
- LogPrintln("ParsePackageEthernet type is %d", type);
switch (type) {
#if LWIP_IPV4 && LWIP_ARP
/* IP packet? */
@@ -322,7 +320,6 @@ static void UdpTestNetifTask(void *p)
struct ifreq nif;
int ret;
- // 注册网卡
btProxyNf = CreateBtNetIf();
/* socket creation */
@@ -335,7 +332,6 @@ static void UdpTestNetifTask(void *p)
ret = bind(sfd, (struct sockaddr*)&srvAddr, sizeof(srvAddr));
LWIP_ASSERT("socket invalid param.", ret == 0);
- /* 指定网卡接口 */
char *inface = NETIF_NAME_BT;
(void)strcpy_s(nif.ifr_name, sizeof(nif.ifr_name), inface);
if (setsockopt(sfd, SOL_SOCKET, SO_BINDTODEVICE, (char *)&nif, sizeof(nif)) < 0) {
@@ -393,7 +389,6 @@ static void ArpPackageProc(struct netif *netif, struct pbuf *p)
return;
}
- // 回应arp报文
ReplayArpTask();
}
@@ -446,4 +441,4 @@ static void ReplayArpTask()
ret = sys_thread_new("replay_arp", ReplayArp, NULL,
STACK_TEST_SIZE, TCPIP_THREAD_PRIO);
ICUNIT_ASSERT_NOT_EQUAL(ret, -1, 23);
-}
\ No newline at end of file
+}
diff --git a/components/shell/include/shell.h b/components/shell/include/shell.h
index 20a69356..24e9dc37 100644
--- a/components/shell/include/shell.h
+++ b/components/shell/include/shell.h
@@ -115,7 +115,7 @@ typedef enum {
/*
* Hook for user-defined debug function
- * Unify differnt module's func for registration
+ * Unify different module's func for registration
*/
typedef UINT32 (*CmdCallBackFunc)(UINT32 argc, const CHAR **argv);
diff --git a/components/shell/src/base/shcmd.c b/components/shell/src/base/shcmd.c
old mode 100755
new mode 100644
index 703065e1..97b91d01
--- a/components/shell/src/base/shcmd.c
+++ b/components/shell/src/base/shcmd.c
@@ -69,10 +69,10 @@ CmdModInfo *OsCmdInfoGet(VOID)
}
/*
- * Description: Pass in the string and clear useless space ,which inlcude:
+ * Description: Pass in the string and clear useless space ,which include:
* 1) The overmatch space which is not be marked by Quote's area
* Squeeze the overmatch space into one space
- * 2) Clear all space before first vaild charatctor
+ * 2) Clear all space before first vaild character
* Input: cmdKey : Pass in the buff string, which is ready to be operated
* cmdOut : Pass out the buffer string ,which has already been operated
* size : cmdKey length
@@ -98,6 +98,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsCmdKeyShift(const CHAR *cmdKey, CHAR *cmdOut, UI
PRINTK("malloc failure in %s[%d]", __FUNCTION__, __LINE__);
return (UINT32)OS_ERROR;
}
+ (VOID)memset_s(output, len + 1, 0, len + 1);
/* Backup the 'output' start address */
outputBak = output;
/* Scan each charactor in 'cmdKey',and squeeze the overmuch space and ignore invaild charactor */
@@ -110,7 +111,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsCmdKeyShift(const CHAR *cmdKey, CHAR *cmdOut, UI
/* 1) Quotes matching status is FALSE (which said that the space is not been marked by double quotes) */
/* 2) Current charactor is a space */
/* 3) Next charactor is a space too, or the string is been seeked to the end already(\0) */
- /* 4) Invaild charactor, such as single quotes */
+ /* 4) Invalid charactor, such as single quotes */
if ((*cmdKey == ' ') && ((*(cmdKey + 1) == ' ') || (*(cmdKey + 1) == '\0')) && QUOTES_STATUS_CLOSE(quotes)) {
continue;
}
diff --git a/components/shell/src/base/shcmdparse.c b/components/shell/src/base/shcmdparse.c
old mode 100755
new mode 100644
diff --git a/components/shell/src/base/shmsg.c b/components/shell/src/base/shmsg.c
index f30472e4..8cc37ff2 100644
--- a/components/shell/src/base/shmsg.c
+++ b/components/shell/src/base/shmsg.c
@@ -96,7 +96,7 @@ CHAR *GetCmdName(const CHAR *cmdline, UINT32 len)
continue;
}
/* If detected a space which the quotes matching status is false */
- /* which said has detected the first space for seperator, finish this scan operation */
+ /* which said has detected the first space for separator, finish this scan operation */
if ((*tmpStr == ' ') && (QUOTES_STATUS_CLOSE(quotes))) {
break;
}
diff --git a/components/shell/src/base/show.c b/components/shell/src/base/show.c
old mode 100755
new mode 100644
diff --git a/components/shell/src/cmds/date_shell.c b/components/shell/src/cmds/date_shell.c
old mode 100755
new mode 100644
diff --git a/components/shell/src/cmds/fullpath.c b/components/shell/src/cmds/fullpath.c
old mode 100755
new mode 100644
index f98a734a..b5a01a12
--- a/components/shell/src/cmds/fullpath.c
+++ b/components/shell/src/cmds/fullpath.c
@@ -203,14 +203,14 @@ STATIC CHAR *VfsNormalizeFullpath(const CHAR *directory, const CHAR *filename, C
CHAR *fullpath = NULL;
if (filename[0] != '/') {
- /* not a absolute path */
+ /* not an absolute path */
fullpath = VfsNotAbsolutePath(directory, filename, pathname, namelen);
if (fullpath == NULL) {
return (CHAR *)NULL;
}
} else {
- /* it's a absolute path, use it directly */
+ /* it's an absolute path, use it directly */
fullpath = strdup(filename); /* copy string */
if (fullpath == NULL) {
diff --git a/components/shell/src/cmds/mempt_shellcmd.c b/components/shell/src/cmds/mempt_shellcmd.c
old mode 100755
new mode 100644
diff --git a/components/shell/src/cmds/shell_shellcmd.c b/components/shell/src/cmds/shell_shellcmd.c
old mode 100755
new mode 100644
diff --git a/components/shell/src/cmds/task_shellcmd.c b/components/shell/src/cmds/task_shellcmd.c
old mode 100755
new mode 100644
diff --git a/components/shell/src/cmds/vfs_shellcmd.c b/components/shell/src/cmds/vfs_shellcmd.c
old mode 100755
new mode 100644
index fe9efca8..9210e3c5
--- a/components/shell/src/cmds/vfs_shellcmd.c
+++ b/components/shell/src/cmds/vfs_shellcmd.c
@@ -209,6 +209,7 @@ VOID OsLs(const CHAR *pathname)
}
} while (pdirent != NULL);
+ free(path);
(VOID)closedir(d);
}
}
diff --git a/components/trace/los_trace.c b/components/trace/los_trace.c
index 523eea95..23241e87 100644
--- a/components/trace/los_trace.c
+++ b/components/trace/los_trace.c
@@ -106,7 +106,7 @@ STATIC VOID OsTraceSetFrame(TraceEventFrame *frame, UINT32 eventType, UINTPTR id
#if (LOSCFG_TRACE_FRAME_CORE_MSG == 1)
frame->core.cpuId = ArchCurrCpuid();
frame->core.hwiActive = OS_INT_ACTIVE ? TRUE : FALSE;
- frame->core.taskLockCnt = MIN(OsPercpuGet()->taskLockCnt, 0xF); /* taskLockCnt is 4 bits, max vaule = 0xF */
+ frame->core.taskLockCnt = MIN(OsPercpuGet()->taskLockCnt, 0xF); /* taskLockCnt is 4 bits, max value = 0xF */
frame->core.paramCount = paramCount;
#endif
diff --git a/components/trace/los_trace.h b/components/trace/los_trace.h
index fb089117..8aa15b4d 100644
--- a/components/trace/los_trace.h
+++ b/components/trace/los_trace.h
@@ -223,7 +223,7 @@ typedef struct {
/**
* @ingroup los_trace
- * struct to store the event infomation
+ * struct to store the event information
*/
typedef struct {
UINT32 eventType; /**< event type */
@@ -304,9 +304,9 @@ extern TRACE_EVENT_HOOK g_traceEventHook;
* The first param is treat as key, keep at least this param if you want trace this event.
* All parameters were treated as UINTPTR.
*
- * eg. Trace a event as:
+ * eg. Trace an event as:
* #define TASK_PRIOSET_PARAMS(taskId, taskStatus, oldPrio, newPrio) taskId, taskStatus, oldPrio, newPrio
- * eg. Not Trace a event as:
+ * eg. Not Trace an event as:
* #define TASK_PRIOSET_PARAMS(taskId, taskStatus, oldPrio, newPrio)
* eg. Trace only you need parmas as:
* #define TASK_PRIOSET_PARAMS(taskId, taskStatus, oldPrio, newPrio) taskId
diff --git a/components/trace/los_trace_pri.h b/components/trace/los_trace_pri.h
index a011e425..8c5a8cab 100644
--- a/components/trace/los_trace_pri.h
+++ b/components/trace/los_trace_pri.h
@@ -96,7 +96,7 @@ typedef struct {
/**
* @ingroup los_trace
- * struct to store the event infomation
+ * struct to store the event information
*/
typedef struct {
UINT32 cmd; /* trace start or stop cmd */
diff --git a/components/trace/pipeline/trace_pipeline.c b/components/trace/pipeline/trace_pipeline.c
index 9fc1ffc9..1e096e2d 100644
--- a/components/trace/pipeline/trace_pipeline.c
+++ b/components/trace/pipeline/trace_pipeline.c
@@ -134,7 +134,7 @@ VOID OsTraceDataSend(UINT8 type, UINT16 len, UINT8 *data)
UINT32 intSave;
UINT8 outBuf[LOSCFG_TRACE_TLV_BUF_SIZE] = {0};
- if ((type > TRACE_MSG_MAX) || (len > LOSCFG_TRACE_TLV_BUF_SIZE)) {
+ if ((type >= TRACE_MSG_MAX) || (len > LOSCFG_TRACE_TLV_BUF_SIZE)) {
return;
}
diff --git a/components/trace/trace_offline.c b/components/trace/trace_offline.c
index d9ee1cfb..71c408bd 100644
--- a/components/trace/trace_offline.c
+++ b/components/trace/trace_offline.c
@@ -186,7 +186,7 @@ STATIC VOID OsTraceInfoEventData(VOID)
UINT32 taskLockCnt = frame->core.taskLockCnt;
#if (LOSCFG_KERNEL_SMP == 1)
/*
- * For smp systems, TRACE_LOCK will requst taskLock, and this counter
+ * For smp systems, TRACE_LOCK will request taskLock, and this counter
* will increase by 1 in that case.
*/
taskLockCnt -= 1;
diff --git a/kal/cmsis/cmsis_liteos2.c b/kal/cmsis/cmsis_liteos2.c
index dc8a529e..0be444f7 100644
--- a/kal/cmsis/cmsis_liteos2.c
+++ b/kal/cmsis/cmsis_liteos2.c
@@ -1634,7 +1634,7 @@ uint32_t osMemoryPoolGetSpace(osMemoryPoolId_t mp_id)
if ((mp->status & MEM_POOL_VALID) != MEM_POOL_VALID) {
space = 0;
} else {
- space = mp->poolInfo.uwBlkCnt - mp->poolInfo.uwBlkCnt;
+ space = mp->poolInfo.uwBlkNum - mp->poolInfo.uwBlkCnt;
}
LOS_IntRestore(intSave);
diff --git a/kal/libc/newlib/porting/src/other_adapt.c b/kal/libc/newlib/porting/src/other_adapt.c
index 4d215b1c..eff0be4d 100644
--- a/kal/libc/newlib/porting/src/other_adapt.c
+++ b/kal/libc/newlib/porting/src/other_adapt.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021-2021 Huawei Device Co., Ltd. All rights reserved.
+ * Copyright (c) 2021-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -37,7 +37,7 @@
int _isatty(int file)
{
- return file <= 2;
+ return (int)(file <= 2); // 2: stderr
}
int _kill(int i, int j)
@@ -52,7 +52,7 @@ int _getpid(void)
void _exit(int status)
{
- write(1, "exit\n", 5);
+ write(1, "exit\n", 5); // 1: stdout; 5: string length
(VOID)pthread_exit(&status);
while (1) {
}
diff --git a/kal/posix/src/pipe.c b/kal/posix/src/pipe.c
index 0aa10a8d..a5d59a73 100644
--- a/kal/posix/src/pipe.c
+++ b/kal/posix/src/pipe.c
@@ -174,7 +174,7 @@ STATIC size_t PipeRingbufferRead(struct PipeDev *dev, VOID *buf, size_t len)
}
}
nbytes = (nbytes > len) ? len : nbytes;
- (VOID)memcpy_s((char *)buf, len, dev->ringBuffer + dev->readIndex, nbytes);
+ (VOID)memcpy_s(buf, len, dev->ringBuffer + dev->readIndex, nbytes);
dev->readIndex += nbytes;
if (dev->readIndex >= dev->bufferSize) {
dev->readIndex = 0;
@@ -184,7 +184,7 @@ STATIC size_t PipeRingbufferRead(struct PipeDev *dev, VOID *buf, size_t len)
return nbytes;
}
-STATIC size_t PipeRingbufferWrite(struct PipeDev *dev, VOID *buf, size_t len)
+STATIC size_t PipeRingbufferWrite(struct PipeDev *dev, const VOID *buf, size_t len)
{
size_t nbytes;
@@ -220,7 +220,6 @@ STATIC INT32 PipeDevRegister(CHAR *devName, UINT32 len)
return -ENODEV;
}
- struct PipeDev *devTemp = NULL;
struct PipeDev *dev = LOS_MemAlloc(OS_SYS_MEM_ADDR, sizeof(struct PipeDev));
if (dev == NULL) {
ret = -ENOMEM;
@@ -230,7 +229,7 @@ STATIC INT32 PipeDevRegister(CHAR *devName, UINT32 len)
(VOID)snprintf_s(dev->devName, PIPE_DEV_NAME_MAX, PIPE_DEV_NAME_MAX - 1, "%s%d", PIPE_DEV_PATH, num);
(VOID)memcpy_s(devName, len, dev->devName, strlen(dev->devName));
- devTemp = PipeDevFind(dev->devName);
+ struct PipeDev *devTemp = PipeDevFind(dev->devName);
if (devTemp != NULL) {
ret = -EEXIST;
goto ERROR;
@@ -389,22 +388,15 @@ INT32 PipeOpen(const CHAR *path, INT32 openFlag, INT32 minFd)
dev->ringBuffer = LOS_MemAlloc(OS_SYS_MEM_ADDR, PIPE_DEV_BUF_SIZE);
if (dev->ringBuffer == NULL) {
PIPE_DEV_UNLOCK(dev->mutex);
+ PipeDevFdFree(fd);
errno = ENOMEM;
- goto ERROR;
+ return -1;
}
dev->bufferSize = PIPE_DEV_BUF_SIZE;
}
PIPE_DEV_UNLOCK(dev->mutex);
return (fd + minFd);
-ERROR:
- if (dev->ringBuffer != NULL) {
- (VOID)LOS_MemFree(OS_SYS_MEM_ADDR, dev->ringBuffer);
- dev->ringBuffer = NULL;
- }
-
- PipeDevFdFree(fd);
- return -1;
}
STATIC INLINE struct PipeFdDev *PipeFdDevGet(INT32 fd)
@@ -448,9 +440,7 @@ INT32 PipeClose(INT32 fd)
PIPE_DEV_LOCK(dev->mutex);
if (openFlag == O_RDONLY) {
dev->readerCnt--;
- }
-
- if (openFlag == O_WRONLY) {
+ } else if (openFlag == O_WRONLY) {
dev->writerCnt--;
}
@@ -676,8 +666,19 @@ int pipe(int filedes[2])
return -1;
}
+ struct PipeDev *dev = PipeDevFind(devName);
filedes[0] = open(devName, O_RDONLY);
+ if (filedes[0] < 0) {
+ (VOID)PipeDevUnregister(dev);
+ return -1;
+ }
+
filedes[1] = open(devName, O_WRONLY);
+ if (filedes[1] < 0) {
+ (VOID)PipeDevUnregister(dev);
+ (VOID)close(filedes[0]);
+ return -1;
+ }
return 0;
}
diff --git a/kal/posix/src/poll.c b/kal/posix/src/poll.c
index 18c2fd94..2bf82e08 100644
--- a/kal/posix/src/poll.c
+++ b/kal/posix/src/poll.c
@@ -128,6 +128,10 @@ VOID PollNotify(struct PollWaitQueue *waitQueue, PollEvent event)
UINT32 intSave;
struct PollWaitNode *waitNode = NULL;
+ if (waitQueue == NULL) {
+ return;
+ }
+
intSave = LOS_IntLock();
LOS_DL_LIST_FOR_EACH_ENTRY(waitNode, &waitQueue->queue, struct PollWaitNode, node) {
if (!event || (event & waitNode->table->event)) {
diff --git a/kal/posix/src/pthread_mutex.c b/kal/posix/src/pthread_mutex.c
index bda54788..ea90b76f 100644
--- a/kal/posix/src/pthread_mutex.c
+++ b/kal/posix/src/pthread_mutex.c
@@ -35,7 +35,6 @@
#include "los_compiler.h"
#include "los_mux.h"
#include "errno.h"
-#include "los_mux.h"
#include "los_debug.h"
#include "los_hook.h"
#include "los_sched.h"
diff --git a/kernel/include/los_memory.h b/kernel/include/los_memory.h
index 2c29601c..ea1b5fcb 100644
--- a/kernel/include/los_memory.h
+++ b/kernel/include/los_memory.h
@@ -103,11 +103,11 @@ extern UINT32 LOS_MemDeInit(VOID *pool);
/**
* @ingroup los_memory
- * @brief Print infomation about all pools.
+ * @brief Print information about all pools.
*
* @par Description:
*
- * - This API is used to print infomation about all pools.
+ * - This API is used to print information about all pools.
*
*
* @retval #UINT32 The pool number.
@@ -394,11 +394,11 @@ extern UINT32 LOS_MemTotalUsedGet(VOID *pool);
/**
* @ingroup los_memory
- * @brief Get the infomation of memory pool.
+ * @brief Get the information of memory pool.
*
* @par Description:
*
- * - This API is used to get the infomation of memory pool.
+ * - This API is used to get the information of memory pool.
*
* @attention
*
@@ -409,7 +409,7 @@ extern UINT32 LOS_MemTotalUsedGet(VOID *pool);
* @param poolStatus [IN] A pointer for storage the pool status
*
* @retval #LOS_NOK The incoming parameter pool is NULL or invalid.
- * @retval #LOS_OK Success to get memory infomation.
+ * @retval #LOS_OK Success to get memory information.
* @par Dependency:
* - los_memory.h: the header file that contains the API declaration.
* @see None.
diff --git a/kernel/include/los_queue.h b/kernel/include/los_queue.h
index e1d43104..f012d6f3 100644
--- a/kernel/include/los_queue.h
+++ b/kernel/include/los_queue.h
@@ -323,7 +323,7 @@ extern "C" {
/**
* @ingroup los_queue
- * Queue error code: The buffer size passed in during queue readding is smaller than the queue size.
+ * Queue error code: The buffer size passed in during queue reading is smaller than the queue size.
*
* Value: 0x0200061f
*
@@ -333,7 +333,7 @@ extern "C" {
/**
* @ingroup los_queue
- * Queue error code: The buffer size passed in during queue readding or writting is bigger than the biggest size.
+ * Queue error code: The buffer size passed in during queue reading or writing is bigger than the biggest size.
*
* Value: 0x02000620
*
diff --git a/kernel/include/los_swtmr.h b/kernel/include/los_swtmr.h
index 1b060e9e..857abd9a 100644
--- a/kernel/include/los_swtmr.h
+++ b/kernel/include/los_swtmr.h
@@ -342,7 +342,7 @@ extern UINT32 LOS_SwtmrStop(UINT32 swtmrID);
* specified by usSwTmrID.
* @attention
*
- * - The specific timer should be created and started successfully, error happends otherwise.
+ * - The specific timer should be created and started successfully, error happens otherwise.
*
*
* @param swtmrID [IN] Software timer ID created by LOS_SwtmrCreate.
diff --git a/kernel/src/los_queue.c b/kernel/src/los_queue.c
index 5d64248c..686e5d14 100644
--- a/kernel/src/los_queue.c
+++ b/kernel/src/los_queue.c
@@ -120,7 +120,10 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_QueueCreate(const CHAR *queueName,
/* Memory allocation is time-consuming, to shorten the time of disable interrupt,
move the memory allocation to here. */
- queue = (UINT8 *)LOS_MemAlloc(m_aucSysMem0, len * msgSize);
+ if ((UINT32_MAX / msgSize) < len) {
+ return LOS_ERRNO_QUEUE_SIZE_TOO_BIG;
+ }
+ queue = (UINT8 *)LOS_MemAlloc(m_aucSysMem0, (UINT32)len * msgSize);
if (queue == NULL) {
return LOS_ERRNO_QUEUE_CREATE_NO_MEMORY;
}
@@ -492,7 +495,7 @@ LITE_OS_SEC_TEXT VOID *OsQueueMailAlloc(UINT32 queueID, VOID *mailPool, UINT32 t
runTsk->taskStatus &= (~OS_TASK_STATUS_TIMEOUT);
goto END;
} else {
- /* When enters the current branch, means the current task already got a available membox,
+ /* When enters the current branch, means the current task already got an available membox,
* so the runTsk->msg can not be NULL.
*/
mem = runTsk->msg;
diff --git a/kernel/src/los_sched.c b/kernel/src/los_sched.c
index ed6a6f12..cdc05ab8 100644
--- a/kernel/src/los_sched.c
+++ b/kernel/src/los_sched.c
@@ -87,7 +87,7 @@ STATIC INLINE VOID OsTimeSliceUpdate(LosTaskCB *taskCB, UINT64 currTime)
STATIC INLINE VOID OsSchedSetNextExpireTime(UINT32 responseID, UINT64 taskEndTime)
{
- UINT64 nextResponseTime = 0;
+ UINT64 nextResponseTime;
BOOL isTimeSlice = FALSE;
UINT64 currTime = OsGetCurrSchedTimeCycle();
diff --git a/targets/riscv_nuclei_demo_soc_gcc/SoC/demosoc/Common/Include/demosoc_i2c.h b/targets/riscv_nuclei_demo_soc_gcc/SoC/demosoc/Common/Include/demosoc_i2c.h
index eb90eedf..86428dbe 100644
--- a/targets/riscv_nuclei_demo_soc_gcc/SoC/demosoc/Common/Include/demosoc_i2c.h
+++ b/targets/riscv_nuclei_demo_soc_gcc/SoC/demosoc/Common/Include/demosoc_i2c.h
@@ -32,7 +32,7 @@ extern "C" {
#define I2C_SR_RXACK (1 << 7)//0:received; 1:no ack resceived
#define I2C_SR_BUSY (1 << 6)//0:after 'STOP' detected; 1:after 'START' detected
#define I2C_SR_AL (1 << 5)
-#define I2C_SR_TIP (1 << 1)//0:transfer complete; 1:transfering
+#define I2C_SR_TIP (1 << 1)//0:transfer complete; 1:transferring
#define I2C_SR_IF (1 << 0)
#if 0
/*fileds*/
diff --git a/targets/riscv_nuclei_demo_soc_gcc/SoC/demosoc/Common/Source/GCC/intexc_demosoc.S b/targets/riscv_nuclei_demo_soc_gcc/SoC/demosoc/Common/Source/GCC/intexc_demosoc.S
index a449f14c..1fc0ced9 100644
--- a/targets/riscv_nuclei_demo_soc_gcc/SoC/demosoc/Common/Source/GCC/intexc_demosoc.S
+++ b/targets/riscv_nuclei_demo_soc_gcc/SoC/demosoc/Common/Source/GCC/intexc_demosoc.S
@@ -169,7 +169,6 @@ exc_entry:
csrr a0, mcause
mv a1, sp
/*
- * TODO: Call the exception handler function
* By default, the function template is provided in
* system_Device.c, you can adjust it as you want
*/
diff --git a/targets/riscv_nuclei_demo_soc_gcc/SoC/demosoc/Common/Source/system_demosoc.c b/targets/riscv_nuclei_demo_soc_gcc/SoC/demosoc/Common/Source/system_demosoc.c
index c8bd1def..fa183135 100644
--- a/targets/riscv_nuclei_demo_soc_gcc/SoC/demosoc/Common/Source/system_demosoc.c
+++ b/targets/riscv_nuclei_demo_soc_gcc/SoC/demosoc/Common/Source/system_demosoc.c
@@ -30,8 +30,6 @@
/*----------------------------------------------------------------------------
Define clocks
*----------------------------------------------------------------------------*/
-/* ToDo: add here your necessary defines for device initialization
- following is an example for different system frequencies */
#ifndef SYSTEM_CLOCK
#define SYSTEM_CLOCK (80000000UL)
#endif
@@ -71,9 +69,6 @@
/*----------------------------------------------------------------------------
System Core Clock Variable
*----------------------------------------------------------------------------*/
-/* ToDo: initialize SystemCoreClock with the system core clock frequency value
- achieved after system intitialization.
- This means system core clock frequency after call to SystemInit() */
/**
* \brief Variable to hold the system core clock value
* \details
@@ -101,9 +96,7 @@ uint32_t SystemCoreClock = SYSTEM_CLOCK; /* System Clock Frequency (Core Clock)
*/
void SystemCoreClockUpdate(void) /* Get Core Clock Frequency */
{
- /* ToDo: add code to calculate the system frequency based upon the current
- * register settings.
- * Note: This function can be used to retrieve the system core clock frequeny
+ /* Note: This function can be used to retrieve the system core clock frequeny
* after user changed register settings.
*/
SystemCoreClock = SYSTEM_CLOCK;
@@ -119,8 +112,7 @@ void SystemCoreClockUpdate(void) /* Get Core Clock Frequency */
*/
void SystemInit(void)
{
- /* ToDo: add code to initialize the system
- * Warn: do not use global variables because this function is called before
+ /* Warn: do not use global variables because this function is called before
* reaching pre-main. RW section maybe overwritten afterwards.
*/
SystemCoreClock = SYSTEM_CLOCK;
@@ -164,7 +156,6 @@ typedef void (*EXC_HANDLER)(unsigned long mcause, unsigned long sp);
*/
static void system_default_exception_handler(unsigned long mcause, unsigned long sp)
{
- /* TODO: Uncomment this if you have implement printf function */
printf("MCAUSE : 0x%lx\r\n", mcause);
printf("MDCAUSE: 0x%lx\r\n", __RV_CSR_READ(CSR_MDCAUSE));
printf("MEPC : 0x%lx\r\n", __RV_CSR_READ(CSR_MEPC));
@@ -276,7 +267,6 @@ void SystemBannerPrint(void)
void ECLIC_Init(void)
{
/* Global Configuration about MTH and NLBits.
- * TODO: Please adapt it according to your system requirement.
* This function is called in _init function */
ECLIC_SetMth(0);
ECLIC_SetCfgNlbits(__ECLIC_INTCTLBITS);
@@ -290,7 +280,7 @@ void ECLIC_Init(void)
* \param [in] IRQn NMI interrupt handler address
* \param [in] shv \ref ECLIC_NON_VECTOR_INTERRUPT means non-vector mode, and \ref ECLIC_VECTOR_INTERRUPT is vector mode
* \param [in] trig_mode see \ref ECLIC_TRIGGER_Type
- * \param [in] lvl interupt level
+ * \param [in] lvl interrupt level
* \param [in] priority interrupt priority
* \param [in] handler interrupt handler, if NULL, handler will not be installed
* \return -1 means invalid input parameter. 0 means successful.
@@ -333,7 +323,6 @@ int32_t ECLIC_Register_IRQ(IRQn_Type IRQn, uint8_t shv, ECLIC_TRIGGER_Type trig_
*/
void _premain_init(void)
{
- /* TODO: Add your own initialization code here, called before main */
/* __ICACHE_PRESENT and __DCACHE_PRESENT are defined in demosoc.h */
#if defined(__ICACHE_PRESENT) && __ICACHE_PRESENT == 1
EnableICache();
@@ -363,7 +352,6 @@ void _premain_init(void)
*/
void _postmain_fini(int status)
{
- /* TODO: Add your own finishing code here, called after main */
#ifdef SIMULATION_XLSPIKE
extern void xlspike_exit(int status);
xlspike_exit(status);
diff --git a/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/Drivers/Usb/drv_usbd_int.c b/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/Drivers/Usb/drv_usbd_int.c
index 14d2d1e3..7bf1ac0e 100644
--- a/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/Drivers/Usb/drv_usbd_int.c
+++ b/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/Drivers/Usb/drv_usbd_int.c
@@ -8,27 +8,27 @@
/*
Copyright (c) 2019, GigaDevice Semiconductor Inc.
- Redistribution and use in source and binary forms, with or without modification,
+ Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright notice, this
+ 1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
+ 2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- 3. Neither the name of the copyright holder nor the names of its contributors
- may be used to endorse or promote products derived from this software without
+ 3. Neither the name of the copyright holder nor the names of its contributors
+ may be used to endorse or promote products derived from this software without
specific prior written permission.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
*/
#include "gd32vf103_libopt.h"
@@ -80,7 +80,6 @@ uint32_t USBD_OTG_EP1OUT_ISR_Handler (usb_core_driver *udev)
{
oeplen = udev->regs.er_out[1]->DOEPLEN;
- /* ToDo : handle more than one single MPS size packet */
udev->dev.transc_out[1].xfer_count = udev->dev.transc_out[1].usb_transc - \
oeplen & DEPLEN_TLEN;
}
@@ -182,7 +181,7 @@ void usbd_isr (usb_core_driver *udev)
/* start of frame interrupt */
if (intr & GINTF_SOF) {
if (udev->dev.class_core->SOF) {
- udev->dev.class_core->SOF(udev);
+ udev->dev.class_core->SOF(udev);
}
if (0U != setupc_flag) {
diff --git a/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_spi.c b/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_spi.c
index 2e1b3a16..e2d1828c 100644
--- a/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_spi.c
+++ b/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/Drivers/gd32vf103_spi.c
@@ -98,7 +98,7 @@ void spi_struct_para_init(spi_parameter_struct* spi_struct)
/*!
\brief initialize SPI parameter
\param[in] spi_periph: SPIx(x=0,1,2)
- \param[in] spi_struct: SPI parameter initialization stuct members of the structure
+ \param[in] spi_struct: SPI parameter initialization struct members of the structure
and the member values are shown as below:
device_mode: SPI_MASTER, SPI_SLAVE
trans_mode: SPI_TRANSMODE_FULLDUPLEX, SPI_TRANSMODE_RECEIVEONLY,
diff --git a/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/GCC/intexc_gd32vf103.S b/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/GCC/intexc_gd32vf103.S
index 9298f554..b7bfd553 100644
--- a/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/GCC/intexc_gd32vf103.S
+++ b/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/GCC/intexc_gd32vf103.S
@@ -169,7 +169,6 @@ exc_entry:
csrr a0, mcause
mv a1, sp
/*
- * TODO: Call the exception handler function
* By default, the function template is provided in
* system_Device.c, you can adjust it as you want
*/
diff --git a/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/system_gd32vf103.c b/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/system_gd32vf103.c
index 3ed8d65d..d6b9843e 100644
--- a/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/system_gd32vf103.c
+++ b/targets/riscv_nuclei_gd32vf103_soc_gcc/SoC/gd32vf103/Common/Source/system_gd32vf103.c
@@ -31,8 +31,6 @@
/*----------------------------------------------------------------------------
Define clocks
*----------------------------------------------------------------------------*/
-/* ToDo: add here your necessary defines for device initialization
- following is an example for different system frequencies */
#ifndef SYSTEM_CLOCK
#define SYSTEM_CLOCK __SYSTEM_CLOCK_108M_PLL_HXTAL
#endif
@@ -66,9 +64,6 @@
/*----------------------------------------------------------------------------
System Core Clock Variable
*----------------------------------------------------------------------------*/
-/* ToDo: initialize SystemCoreClock with the system core clock frequency value
- achieved after system intitialization.
- This means system core clock frequency after call to SystemInit() */
/**
* \brief Variable to hold the system core clock value
* \details
@@ -200,9 +195,7 @@ static void system_clock_config(void)
*/
void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */
{
- /* ToDo: add code to calculate the system frequency based upon the current
- * register settings.
- * Note: This function can be used to retrieve the system core clock
+ /* Note: This function can be used to retrieve the system core clock
* frequeny after user changed register settings.
*/
uint32_t scss;
@@ -288,8 +281,7 @@ void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */
*/
void SystemInit (void)
{
- /* ToDo: add code to initialize the system
- * Warn: do not use global variables because this function is called before
+ /* Warn: do not use global variables because this function is called before
* reaching pre-main. RW section maybe overwritten afterwards.
*/
/* reset the RCC clock configuration to the default reset state */
@@ -359,7 +351,6 @@ typedef void (*EXC_HANDLER) (unsigned long mcause, unsigned long sp);
*/
static void system_default_exception_handler(unsigned long mcause, unsigned long sp)
{
- /* TODO: Uncomment this if you have implement printf function */
printf("MCAUSE: 0x%lx\r\n", mcause);
printf("MEPC : 0x%lx\r\n", __RV_CSR_READ(CSR_MEPC));
printf("MTVAL : 0x%lx\r\n", __RV_CSR_READ(CSR_MBADADDR));
@@ -432,10 +423,10 @@ uint32_t core_exception_handler(unsigned long mcause, unsigned long sp)
uint32_t EXCn = (uint32_t)(mcause & 0X00000fff);
EXC_HANDLER exc_handler;
- PRINTK("----------------All Task infomation ------------\r\n");
+ PRINTK("----------------All Task information ------------\r\n");
HalDisplayTaskInfo();
- PRINTK("---------------exc handler infomation -----------\r\n");
-
+ PRINTK("---------------exc handler information -----------\r\n");
+
if ((EXCn < MAX_SYSTEM_EXCEPTION_NUM) && (EXCn >= 0)) {
exc_handler = (EXC_HANDLER)SystemExceptionHandlers[EXCn];
} else if (EXCn == NMI_EXCn) {
@@ -471,7 +462,6 @@ void SystemBannerPrint(void)
*/
void ECLIC_Init(void)
{
- /* TODO: Add your own initialization code here. This function will be called by main */
ECLIC_SetMth(0);
ECLIC_SetCfgNlbits(__ECLIC_INTCTLBITS);
}
@@ -484,7 +474,7 @@ void ECLIC_Init(void)
* \param [in] IRQn NMI interrupt handler address
* \param [in] shv \ref ECLIC_NON_VECTOR_INTERRUPT means non-vector mode, and \ref ECLIC_VECTOR_INTERRUPT is vector mode
* \param [in] trig_mode see \ref ECLIC_TRIGGER_Type
- * \param [in] lvl interupt level
+ * \param [in] lvl interrupt level
* \param [in] priority interrupt priority
* \param [in] handler interrupt handler, if NULL, handler will not be installed
* \return -1 means invalid input parameter. 0 means successful.
@@ -527,7 +517,6 @@ int32_t ECLIC_Register_IRQ(IRQn_Type IRQn, uint8_t shv, ECLIC_TRIGGER_Type trig_
*/
void _premain_init(void)
{
- /* TODO: Add your own initialization code here, called before main */
SystemCoreClock = get_cpu_freq();
/* configure USART */
gd_com_init(SOC_DEBUG_UART);
@@ -550,7 +539,6 @@ void _premain_init(void)
*/
void _postmain_fini(int status)
{
- /* TODO: Add your own finishing code here, called after main */
}
/**
diff --git a/testsuites/include/osTest.h b/testsuites/include/osTest.h
index 3c56a018..65736820 100644
--- a/testsuites/include/osTest.h
+++ b/testsuites/include/osTest.h
@@ -297,7 +297,7 @@ extern UINT32 TaskUsedCountGet(VOID);
#define HWI_NUM_TEST3 36
#define LOS_KERNEL_MULTI_HWI_TEST 1 // default enable multiple hwi number test case
#elif __CSKY_V2__
-#define HWI_NUM_TEST 31 // csky_v2 only suppport one software interrupt number
+#define HWI_NUM_TEST 31 // csky_v2 only support one software interrupt number
#define LOS_KERNEL_MULTI_HWI_TEST 0 // csky_v2 not support multiple hwi number test case
#elif __XTENSA_LX6__
#define HWI_NUM_TEST 7 // xtensa_lx6 only suppport one software interrupt number
diff --git a/testsuites/sample/kernel/atomic/it_los_atomic_011.c b/testsuites/sample/kernel/atomic/it_los_atomic_011.c
index 2decabb8..f48156ce 100644
--- a/testsuites/sample/kernel/atomic/it_los_atomic_011.c
+++ b/testsuites/sample/kernel/atomic/it_los_atomic_011.c
@@ -43,13 +43,13 @@ static VOID TaskF01(VOID)
Atomic atomicTestCounter = 0;
INT32 readCounter = 0;
INT32 atomicRet = 0;
-
+
Atomic64 atomic64TestCounter = 0;
INT64 read64Counter = 0;
INT64 atomic64Ret = 0;
ICUNIT_ASSERT_EQUAL(g_testCount, 0, g_testCount);
-
+
atomicTestCounter = 0x88888888;
LOS_AtomicSet(&atomicTestCounter, 0x88888888);
atomicRet = LOS_AtomicAdd(&atomicTestCounter, 0x33333333);
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink.c b/testsuites/sample/kernel/dynlink/It_los_dynlink.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink.h b/testsuites/sample/kernel/dynlink/It_los_dynlink.h
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_001.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_001.c
old mode 100755
new mode 100644
index 282c4f55..466fc55f
--- a/testsuites/sample/kernel/dynlink/It_los_dynlink_001.c
+++ b/testsuites/sample/kernel/dynlink/It_los_dynlink_001.c
@@ -35,7 +35,7 @@ STATIC UINT32 TestCase(VOID)
{
INT32 ret;
VOID *handle = NULL;
- INT32 (*func)(INT32 ,INT32) = NULL;
+ INT32 (*func)(INT32, INT32) = NULL;
handle = (VOID *)LOS_SoLoad(NULL, NULL);
ICUNIT_ASSERT_EQUAL(handle, NULL, handle);
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_002.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_002.c
old mode 100755
new mode 100644
index 8911a6fd..954fe7ce
--- a/testsuites/sample/kernel/dynlink/It_los_dynlink_002.c
+++ b/testsuites/sample/kernel/dynlink/It_los_dynlink_002.c
@@ -30,7 +30,7 @@
#include "los_dynlink.h"
#include "It_los_dynlink.h"
-/* Test invalide params */
+/* Test invalid params */
STATIC UINT32 TestCase(VOID)
{
VOID *handle = NULL;
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_003.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_003.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_004.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_004.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_005.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_005.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_006.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_006.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_007.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_007.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_008.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_008.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_009.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_009.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_011.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_011.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_012.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_012.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_013.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_013.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_014.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_014.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_015.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_015.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_016.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_016.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_017.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_017.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_018.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_018.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_019.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_019.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/dynlink/It_los_dynlink_020.c b/testsuites/sample/kernel/dynlink/It_los_dynlink_020.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/hwi/it_los_hwi_039.c b/testsuites/sample/kernel/hwi/it_los_hwi_039.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/hwi/it_los_hwi_040.c b/testsuites/sample/kernel/hwi/it_los_hwi_040.c
old mode 100755
new mode 100644
diff --git a/testsuites/sample/kernel/lmk/It_los_lmk_003.c b/testsuites/sample/kernel/lmk/It_los_lmk_003.c
index d4aa5c72..18f94ea2 100644
--- a/testsuites/sample/kernel/lmk/It_los_lmk_003.c
+++ b/testsuites/sample/kernel/lmk/It_los_lmk_003.c
@@ -96,9 +96,9 @@ STATIC UINT32 TestCase(VOID)
ICUNIT_ASSERT_EQUAL(ret, LOS_ERRNO_LMK_RESTORE_NOT_NEEDED, ret);
firstOpsNode.freeMem = release_OK;
- firstOpsNode.restoreTask =restore_OK;
+ firstOpsNode.restoreTask = restore_OK;
anotherOpsNode.freeMem = release_OK;
- anotherOpsNode.restoreTask =restore_OK;
+ anotherOpsNode.restoreTask = restore_OK;
ret = LOS_LmkTasksKill();
ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret);
ret = LOS_LmkTasksRestore();
diff --git a/testsuites/sample/kernel/lms/It_los_lms_020.c b/testsuites/sample/kernel/lms/It_los_lms_020.c
index 16719d2a..add0077a 100644
--- a/testsuites/sample/kernel/lms/It_los_lms_020.c
+++ b/testsuites/sample/kernel/lms/It_los_lms_020.c
@@ -36,9 +36,9 @@ static UINT32 TestCase(VOID)
{
CHAR *p = (CHAR *)LOS_MemAlloc(g_testLmsPool, INDEX_MAX);
ICUNIT_ASSERT_NOT_EQUAL(p, NULL, 0);
- memset_s(p, INDEX_MAX, 0, INDEX_MAX + 1);
+ (void)memset_s(p, INDEX_MAX, 0, INDEX_MAX + 1);
PRINTK("p[0] = %d\n", p[0]);
- memset_s(p, INDEX_MAX + 1, 0, INDEX_MAX + 1); /* trigger overflow */
+ (void)memset_s(p, INDEX_MAX + 1, 0, INDEX_MAX + 1); /* trigger overflow */
return LOS_OK;
}
diff --git a/testsuites/sample/kernel/lms/It_los_lms_021.c b/testsuites/sample/kernel/lms/It_los_lms_021.c
index dd6895e4..08195fc7 100644
--- a/testsuites/sample/kernel/lms/It_los_lms_021.c
+++ b/testsuites/sample/kernel/lms/It_los_lms_021.c
@@ -40,7 +40,7 @@ static UINT32 TestCase(VOID)
memcpy_s(p, INDEX_MAX, src, INDEX_MAX + 1);
PRINTK("p[0] = %d\n", p[0]);
- memcpy_s(p, INDEX_MAX + 1, 0, INDEX_MAX + 1); /* trigger overflow */
+ (void)memcpy_s(p, INDEX_MAX + 1, 0, INDEX_MAX + 1); /* trigger overflow */
return LOS_OK;
}
diff --git a/testsuites/sample/kernel/mem/It_los_mem_006.c b/testsuites/sample/kernel/mem/It_los_mem_006.c
index 07b722ea..2ef753f5 100644
--- a/testsuites/sample/kernel/mem/It_los_mem_006.c
+++ b/testsuites/sample/kernel/mem/It_los_mem_006.c
@@ -52,7 +52,6 @@ static UINT32 TestCase(VOID)
ICUNIT_GOTO_EQUAL(1, 0, 0, EXIT);
}
- size = size;
p0 = LOS_MemAlloc(g_memPool, size);
ICUNIT_GOTO_EQUAL(p0, NULL, p0, EXIT);
diff --git a/testsuites/sample/kernel/mem/It_los_mem_046.c b/testsuites/sample/kernel/mem/It_los_mem_046.c
index 2a36be9b..6a1bdadc 100644
--- a/testsuites/sample/kernel/mem/It_los_mem_046.c
+++ b/testsuites/sample/kernel/mem/It_los_mem_046.c
@@ -33,21 +33,23 @@
#include "It_los_mem.h"
#if (LOSCFG_MEM_MUL_REGIONS == 1)
+#define TC_POOL_SIZE_1 0x200
+#define TC_POOL_SIZE_2 0x400
+#define TC_GAP_SIZE 0x10
// simulate two non-continuous memory regions
-STATIC UINT8 g_memPool_TC46_01[0x200];
-STATIC UINT8 g_memGap_TC46[0x10];
-STATIC UINT8 g_memPool_TC46_02[0x400];
+STATIC UINT8 g_memPool_TC46_01[TC_POOL_SIZE_1];
+STATIC UINT8 g_memGap_TC46[TC_GAP_SIZE];
+STATIC UINT8 g_memPool_TC46_02[TC_POOL_SIZE_2];
static UINT32 TestCase(VOID)
{
UINT32 ret;
void *p = NULL;
- LosMemRegion memRegions[] =
- {
- {g_memPool_TC46_01, 0x200},
- {g_memPool_TC46_02, 0x400}
- };
+ LosMemRegion memRegions[] = {
+ {g_memPool_TC46_01, TC_POOL_SIZE_1},
+ {g_memPool_TC46_02, TC_POOL_SIZE_2}
+ };
// Initialize the LOS_MemRegionsAdd
ret = LOS_MemRegionsAdd(m_aucSysMem0, memRegions, sizeof(memRegions) / sizeof(memRegions[0]));
@@ -56,8 +58,8 @@ static UINT32 TestCase(VOID)
}
// p points to the start address of the gap node between g_memPool_TC46_01 and g_memPool_TC46_02
- p = g_memPool_TC46_01 + 0x200;
- (void)memset_s(g_memGap_TC46, 0x10, 1, 0x10);
+ p = g_memPool_TC46_01 + TC_POOL_SIZE_1;
+ (void)memset_s(g_memGap_TC46, TC_GAP_SIZE, 1, TC_GAP_SIZE);
ret = LOS_MemFree(m_aucSysMem0, p);
ICUNIT_GOTO_EQUAL(ret, LOS_NOK, ret, EXIT);
@@ -76,6 +78,3 @@ VOID ItLosMem046(void)
{
TEST_ADD_CASE("ItLosMem046", TestCase, TEST_LOS, TEST_MEM, TEST_LEVEL1, TEST_FUNCTION);
}
-
-
-
diff --git a/testsuites/sample/kernel/swtmr/It_los_swtmr_040.c b/testsuites/sample/kernel/swtmr/It_los_swtmr_040.c
index 6d094ae3..ef34ff2e 100644
--- a/testsuites/sample/kernel/swtmr/It_los_swtmr_040.c
+++ b/testsuites/sample/kernel/swtmr/It_los_swtmr_040.c
@@ -68,7 +68,7 @@ static UINT32 Testcase(VOID)
g_testCount1 = 0;
// 1, Timeout interval of a periodic software timer.
- ret = LOS_SwtmrCreate(1, LOS_SWTMR_MODE_PERIOD, (SWTMR_PROC_FUNC)Case2, &g_swtmrId1, &irqParam
+ ret = LOS_SwtmrCreate(1, LOS_SWTMR_MODE_PERIOD, (SWTMR_PROC_FUNC)Case2, &g_swtmrId1, (UINT32)&irqParam
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
, OS_SWTMR_ROUSES_ALLOW, OS_SWTMR_ALIGN_INSENSITIVE
#endif
diff --git a/testsuites/sample/kernel/swtmr/It_los_swtmr_041.c b/testsuites/sample/kernel/swtmr/It_los_swtmr_041.c
index bb3beabe..f4aa5dea 100644
--- a/testsuites/sample/kernel/swtmr/It_los_swtmr_041.c
+++ b/testsuites/sample/kernel/swtmr/It_los_swtmr_041.c
@@ -82,14 +82,14 @@ static UINT32 Testcase(VOID)
TestHwiClear(HWI_NUM_TEST);
// 10, Timeout interval of a periodic software timer.
- ret = LOS_SwtmrCreate(10, LOS_SWTMR_MODE_ONCE, (SWTMR_PROC_FUNC)Case3, &g_swtmrId1, &irqParam
+ ret = LOS_SwtmrCreate(10, LOS_SWTMR_MODE_ONCE, (SWTMR_PROC_FUNC)Case3, &g_swtmrId1, (UINT32)&irqParam
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
, OS_SWTMR_ROUSES_ALLOW, OS_SWTMR_ALIGN_INSENSITIVE
#endif
);
ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT);
// 20, Timeout interval of a periodic software timer.
- ret = LOS_SwtmrCreate(20, LOS_SWTMR_MODE_PERIOD, (SWTMR_PROC_FUNC)Case2, &g_swtmrId2, &irqParam
+ ret = LOS_SwtmrCreate(20, LOS_SWTMR_MODE_PERIOD, (SWTMR_PROC_FUNC)Case2, &g_swtmrId2, (UINT32)&irqParam
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
, OS_SWTMR_ROUSES_ALLOW, OS_SWTMR_ALIGN_INSENSITIVE
#endif
diff --git a/testsuites/unittest/fuzz/src/semaphore/sem_timedwait_fuzz.c b/testsuites/unittest/fuzz/src/semaphore/sem_timedwait_fuzz.c
index 0d5b76a9..9695f989 100644
--- a/testsuites/unittest/fuzz/src/semaphore/sem_timedwait_fuzz.c
+++ b/testsuites/unittest/fuzz/src/semaphore/sem_timedwait_fuzz.c
@@ -65,7 +65,7 @@ void SemTimedWaitFuzzTest(void)
absTimeout.tv_sec = (*(int *)DT_SetGetS32(&g_element[elemSecIndex], 0)) % SEC_MODE_VALUE;
absTimeout.tv_nsec = (*(int *)DT_SetGetS32(&g_element[elemNsecIndex], 0) % NSEC_MODE_VALUE);
- memset_s(&sem, sizeof(sem), 0, sizeof(sem_t));
+ (void)memset_s(&sem, sizeof(sem), 0, sizeof(sem_t));
pshared = (*(int *)DT_SetGetS32(&g_element[1], DEFAULT_SHARED_VALUE));
value = (*(unsigned int *)DT_SetGetU32(&g_element[1], 0)) % MAX_SEM_VALUE;
sem_init(&sem, pshared, value);
diff --git a/testsuites/unittest/fuzz/src/socket/net_fuzz.c b/testsuites/unittest/fuzz/src/socket/net_fuzz.c
index e702c084..301e371b 100644
--- a/testsuites/unittest/fuzz/src/socket/net_fuzz.c
+++ b/testsuites/unittest/fuzz/src/socket/net_fuzz.c
@@ -123,7 +123,7 @@ static void *SampleUdpClient()
clnAddr.sin_port = htons(g_udpPort);
printf("c3\r\n");
- strcpy_s(buf, sizeof(buf), UDPMSG);
+ (void)strcpy_s(buf, sizeof(buf), UDPMSG);
usleep(sleepSec);
printf("c4, %s, %d\r\n", buf, strlen(buf));
@@ -211,7 +211,6 @@ static void *SampleTcpServer()
struct sockaddr_in clnAddr = { 0 };
int ret;
- // socket had fuzz test in udpfun. now must create a useful fd, wwx520273
lsfd = socket(AF_INET, SOCK_STREAM, 0);
srvAddr.sin_family = AF_INET;
@@ -264,9 +263,10 @@ static void *SampleTcpClient()
/* send */
ret = memset_s(buf, sizeof(buf), 0, BUF_SIZE);
if (err != EOK) {
+ close(sfd);
return (void *)(intptr_t)ret;
}
- strcpy_s(buf, sizeof(buf), CLI_MSG);
+ (void)strcpy_s(buf, sizeof(buf), CLI_MSG);
int num2 = *(int *)DT_SetGetS32(&g_element[1], 0);
send(num1, buf, strlen(CLI_MSG), num2);
@@ -304,7 +304,7 @@ static UINT32 TcpFun(VOID)
stTask1.uwResved = LOS_TASK_STATUS_DETACHED;
(void)LOS_TaskCreate(&g_testTaskID01, &stTask1);
}
- };
+ }
DT_Clear(g_element);
CLOSE_Log();
diff --git a/testsuites/unittest/fuzz/src/stdlib/realloc_fuzz.c b/testsuites/unittest/fuzz/src/stdlib/realloc_fuzz.c
index 96a6d97e..5663fa93 100644
--- a/testsuites/unittest/fuzz/src/stdlib/realloc_fuzz.c
+++ b/testsuites/unittest/fuzz/src/stdlib/realloc_fuzz.c
@@ -46,6 +46,7 @@ extern int g_iteration;
void ReallocFuzzTest(void)
{
char *source = NULL;
+ char *buf = NULL;
int c;
printf("Fuzz test in line [%d] realloc start\n", __LINE__);
@@ -56,9 +57,12 @@ void ReallocFuzzTest(void)
return;
}
+ (void)memset_s(source, TEST_BUF_LEN, 0, TEST_BUF_LEN);
+
INIT_FuzzEnvironment();
CreatPrecondForQueue();
for (int i = 0; i < CYCLE_TOTAL_TIMES; i++) {
+ source = buf;
hi_watchdog_feed();
heartbeatPrint(i);
@@ -66,10 +70,13 @@ void ReallocFuzzTest(void)
if ((c <= 0) || (c > TEST_MAX_BUF_LEN)) {
c = TEST_BUF_LEN;
}
- source = (char *)realloc(source, c);
+ buf = (char *)realloc(source, c);
+ if (buf == NULL) {
+ break;
+ }
}
- if (source == NULL) {
+ if (buf == NULL) {
free(source);
}
diff --git a/testsuites/unittest/posix/src/pthread/pthread_cond_func_test.c b/testsuites/unittest/posix/src/pthread/pthread_cond_func_test.c
index ce08df7e..4d180ead 100644
--- a/testsuites/unittest/posix/src/pthread/pthread_cond_func_test.c
+++ b/testsuites/unittest/posix/src/pthread/pthread_cond_func_test.c
@@ -680,7 +680,7 @@ LITE_TEST_CASE(PthreadFuncTestSuite, testPthread009, Function | MediumTest | Lev
ret = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
-
+
for (i = 0; i < TEST_THREAD_COUNT; i++) {
ret = pthread_create(&thread[i], &attr, pthread_prio_f01, TEST_THREAD_COUNT - i);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
@@ -731,7 +731,7 @@ LITE_TEST_CASE(PthreadFuncTestSuite, testPthread010, Function | MediumTest | Lev
ret = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
-
+
for (i = 0; i < TEST_THREAD_COUNT; i++) {
ret = pthread_once(&onceControl, pthread_once_f01);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
@@ -779,7 +779,7 @@ LITE_TEST_CASE(PthreadFuncTestSuite, testPthread011, Function | MediumTest | Lev
ret = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
-
+
ret = pthread_create(&thread, &attr, pthread_cancel_f01, NULL);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
@@ -842,7 +842,7 @@ LITE_TEST_CASE(PthreadFuncTestSuite, testPthread012, Function | MediumTest | Lev
ret = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
-
+
ret = pthread_create(&thread, &attr, pthread_testcancel_f01, NULL);
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
@@ -965,8 +965,7 @@ LITE_TEST_CASE(PthreadFuncTestSuite, testPthread016, Function | MediumTest | Lev
int ret;
pthread_mutexattr_init(&mutex_attr);
ret = pthread_mutexattr_settype(NULL, PTHREAD_MUTEX_ERRORCHECK);
- if (ret == 0)
- {
+ if (ret == 0) {
ICUNIT_ASSERT_EQUAL(ret, 0, ret);
}
pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_ERRORCHECK);
diff --git a/testsuites/unittest/posix/src/string/memory_func_test.c b/testsuites/unittest/posix/src/string/memory_func_test.c
index 6faf65f7..58d54d9c 100644
--- a/testsuites/unittest/posix/src/string/memory_func_test.c
+++ b/testsuites/unittest/posix/src/string/memory_func_test.c
@@ -268,21 +268,24 @@ LITE_TEST_CASE(PosixMemFuncTestSuite, testOsMemRealloc001, Function | MediumTest
mem = malloc(mlen);
TEST_ASSERT_NOT_NULL(mem);
- memset(mem, testChar, mlen);
+ (void)memset_s(mem, mlen, testChar, mlen);
rlen = rand() % (1024) + mlen;
- mem = realloc(mem, rlen);
- TEST_ASSERT_NOT_NULL(mem);
+ char *mem1 = realloc(mem, rlen);
+ if (mem1 == NULL) {
+ free(mem);
+ }
+ TEST_ASSERT_NOT_NULL(mem1);
len = mlen <= rlen ? mlen : rlen;
- data = (char *)mem;
+ data = (char *)mem1;
for (k = 0; k < len; k++) {
if (data[k] != testChar) {
failure = 1;
}
}
- free(mem);
+ free(mem1);
TEST_ASSERT_EQUAL_INT(failure, 0);
}
};
diff --git a/testsuites/unittest/posix/src/string/string_func_test_03.c b/testsuites/unittest/posix/src/string/string_func_test_03.c
index 658babe4..9b381fbd 100644
--- a/testsuites/unittest/posix/src/string/string_func_test_03.c
+++ b/testsuites/unittest/posix/src/string/string_func_test_03.c
@@ -211,7 +211,7 @@ LITE_TEST_CASE(PosixStringFuncTestSuite, testStrStrcspn002, Function | MediumTes
LITE_TEST_CASE(PosixStringFuncTestSuite, testStrStrptime001, Function | MediumTest | Level1)
{
struct tm tmData;
- memset_s(&tmData, sizeof(struct tm), 0, sizeof(struct tm));
+ (void)memset_s(&tmData, sizeof(struct tm), 0, sizeof(struct tm));
char *ret = strptime("2020-10-29 21:24:00abc", "%Y-%m-%d %H:%M:%S", &tmData);
TEST_ASSERT_EQUAL_CHAR_ARRAY(ret, "abc", 3);
TEST_ASSERT_EQUAL_INT(tmData.tm_year, 120);
diff --git a/utils/los_compiler.h b/utils/los_compiler.h
index 450d7aa9..1c60a306 100644
--- a/utils/los_compiler.h
+++ b/utils/los_compiler.h
@@ -498,7 +498,7 @@ static inline UINT64 __atomic_load_8(const volatile void *mem, int model)
ret = *(UINT64 *)mem;
free_lock (memP, model);
return ret;
-}
+}
static inline void __atomic_store_8(volatile void *mem, UINT64 val, int model)
{
@@ -511,7 +511,7 @@ static inline void __atomic_store_8(volatile void *mem, UINT64 val, int model)
static inline UINT64 __atomic_exchange_8(volatile void *mem, UINT64 val, int model)
{
UINT64 ret;
-
+
void *memP = (void *)mem;
get_lock (memP, model);
ret = *(UINT64 *)mem;
diff --git a/utils/los_debug.h b/utils/los_debug.h
index 8649cc0f..c2de19a5 100644
--- a/utils/los_debug.h
+++ b/utils/los_debug.h
@@ -121,7 +121,7 @@ typedef enum {
*
* @param type [IN] Type LogModuleType indicates the log type.
* @param level [IN] Type LogLevel indicates the log level.
- * @param fmt [IN] Type char* controls the ouput as in C printf.
+ * @param fmt [IN] Type char* controls the output as in C printf.
*
* @retval None
* @par Dependency:
diff --git a/utils/los_error.c b/utils/los_error.c
index 0b783b3d..b8792c89 100644
--- a/utils/los_error.c
+++ b/utils/los_error.c
@@ -52,7 +52,6 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_ErrHandle(CHAR *fileName,
UINT32 paraLen,
VOID *para)
{
-
if (g_userErrFunc.pfnHook != NULL) {
g_userErrFunc.pfnHook(fileName, lineNo, errorNo, paraLen, para);
}
diff --git a/utils/los_list.h b/utils/los_list.h
index 90fcf4b5..4fce20ef 100644
--- a/utils/los_list.h
+++ b/utils/los_list.h
@@ -248,7 +248,7 @@ LITE_OS_SEC_ALW_INLINE STATIC_INLINE BOOL LOS_ListEmpty(LOS_DL_LIST *node)
* - los_list.h: the header file that contains the API declaration.
* @see
*/
-#define LOS_OFF_SET_OF(type, member) ((UINT32)&(((type *)0)->member)) /*lint -e(413) */
+#define LOS_OFF_SET_OF(type, member) ((UINT32)&(((type *)0)->member))
/**
* @ingroup los_list