diff --git a/components/exchook/los_exc_info.c b/components/exchook/los_exc_info.c index 334d852a7d418c9d4308e79cf6d27ad108744fde..6dcd49734fb30bf03eb6dd533e655f1a8c28dc99 100644 --- a/components/exchook/los_exc_info.c +++ b/components/exchook/los_exc_info.c @@ -92,6 +92,9 @@ STATIC UINT32 OsExcSaveIntStatus(UINT32 type, VOID *arg) /* save IRQ Priority reg group */ ret = memcpy_s(g_excContent, excContentEnd - (UINTPTR)g_excContent, (const VOID *)OS_NVIC_PRI_BASE, OS_NVIC_INT_PRI_SIZE); + if (ret != EOK) { + return LOS_NOK; + } g_excContent = (UINT8 *)g_excContent + OS_NVIC_INT_PRI_SIZE; /* save Exception Priority reg group */ @@ -294,5 +297,3 @@ VOID OsExcMsgDumpInit(VOID) (VOID)LOS_RegExcHook(EXC_INTERRUPT, (ExcHookFn)OsExcMsgDump); } #endif - - diff --git a/components/shell/include/show.h b/components/shell/include/show.h index 8520d36915e8636d6aed8aa6bb0f5774f7f29a1e..61d9d78c5274b5e330f7ab98401badc8b10079aa 100644 --- a/components/shell/include/show.h +++ b/components/shell/include/show.h @@ -54,7 +54,7 @@ STATIC INLINE VOID SetErrno(INT32 errcode) STATIC INLINE VOID SetErr(INT32 errcode, const CHAR *errMessage) { SetErrno(errcode); - PRINTK(errMessage); + PRINTK("%s", errMessage); } #ifdef __cplusplus diff --git a/components/shell/src/cmds/vfs_shellcmd.c b/components/shell/src/cmds/vfs_shellcmd.c index 9210e3c5a1433d3a482e3ad8bc97ea812977a467..6a478b714f15e2945e55d305d87906ca14b3abba 100644 --- a/components/shell/src/cmds/vfs_shellcmd.c +++ b/components/shell/src/cmds/vfs_shellcmd.c @@ -130,7 +130,7 @@ STATIC CHAR *OsLsGetFullpath(const CHAR *path, struct dirent *pdirent) goto exit_with_nomem; } - ret = snprintf_s(fullpath, pathLen, pathLen, "%s/%s", path, pdirent->d_name); + ret = snprintf_s(fullpath, pathLen, pathLen - 1, "%s/%s", path, pdirent->d_name); if (ret < 0) { free(fullpath); return NULL; 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 86428dbe5bb91bb9041904f23c194eea930d2c91..c3e887f0adcddc9a7b5459c0574cce539997a723 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 @@ -34,21 +34,6 @@ extern "C" { #define I2C_SR_AL (1 << 5) #define I2C_SR_TIP (1 << 1)//0:transfer complete; 1:transferring #define I2C_SR_IF (1 << 0) -#if 0 -/*fileds*/ - -#define I2C_CTR_ENABLE 1 -#define I2C_CTR_DISABLE 0 - -#define I2C_CTR_INTEN 1 -#define I2C_CTR_INTDIS 0 - -#define I2C_TXR_RFS 1 //read from slave -#define I2C_TXR_WTS 0 //write to slave - -#define I2C - -#endif #ifdef __cplusplus } diff --git a/testsuites/sample/kernel/hwi/llt_los_hwi_035.c b/testsuites/sample/kernel/hwi/llt_los_hwi_035.c index 6da5a92c93cfa899998d3d2eded514919df88776..3adfec9d62505620322c3158a581fae0b839fd8b 100644 --- a/testsuites/sample/kernel/hwi/llt_los_hwi_035.c +++ b/testsuites/sample/kernel/hwi/llt_los_hwi_035.c @@ -68,11 +68,6 @@ static UINT32 Testcase(VOID) ICUNIT_ASSERT_EQUAL(ret, LOS_OK, ret); return LOS_OK; - - LOS_TaskDelete(g_testTaskIdHwi); - TestHwiDelete(HWI_NUM_TEST); - - return LOS_OK; } /* ********** diff --git a/testsuites/sample/kernel/lms/It_los_lms_023.c b/testsuites/sample/kernel/lms/It_los_lms_023.c index 310ee2c5366b525eb48a72284862f536d608c8e1..71076cddfb43f3a6b268763515e42865fb5b9e51 100644 --- a/testsuites/sample/kernel/lms/It_los_lms_023.c +++ b/testsuites/sample/kernel/lms/It_los_lms_023.c @@ -54,6 +54,7 @@ static UINT32 TestCase(VOID) buf[7] = '\0'; /* end index 7 */ PRINTK("%d\n", __LINE__); ret = strcat_s(buf, 100, src); /* Check LMS detection information when the strcat dest max set 100 overflows. */ + ICUNIT_ASSERT_NOT_EQUAL(ret, 0, ret); PRINTK("%d\n", __LINE__); ret = LOS_MemFree(g_testLmsPool, buf); ICUNIT_ASSERT_NOT_EQUAL(ret, LOS_NOK, ret); diff --git a/testsuites/sample/kernel/queue/It_los_queue_head_015.c b/testsuites/sample/kernel/queue/It_los_queue_head_015.c index 1c6db5fec0bd65f7375d27dd4427fc40a044f579..262718bf16ea7138b1206cd9e4245cf49533e865 100644 --- a/testsuites/sample/kernel/queue/It_los_queue_head_015.c +++ b/testsuites/sample/kernel/queue/It_los_queue_head_015.c @@ -52,8 +52,6 @@ static UINT32 Testcase(VOID) ret = LOS_QueueRead(queueID[limit - 1], &buff2, QUEUE_BASE_MSGSIZE, 0); ICUNIT_GOTO_EQUAL(ret, LOS_OK, ret, EXIT); - ret = LOS_QueueCreate("Q1", QUEUE_BASE_NUM, &queueID[index], 0, QUEUE_BASE_MSGSIZE); - ret = LOS_QueueCreate("Q1", QUEUE_BASE_NUM, &queueID[index], 0, QUEUE_BASE_MSGSIZE); ICUNIT_GOTO_NOT_EQUAL(ret, LOS_OK, ret, EXIT); diff --git a/testsuites/unittest/fuzz/src/socket/net_fuzz.c b/testsuites/unittest/fuzz/src/socket/net_fuzz.c index 301e371b105b29aa49a0c721d215d46660c7eac2..768049648b2d31a5f27cac960023b569ae580122 100644 --- a/testsuites/unittest/fuzz/src/socket/net_fuzz.c +++ b/testsuites/unittest/fuzz/src/socket/net_fuzz.c @@ -226,7 +226,7 @@ static void *SampleTcpServer() sfd = accept(lsfd, (struct sockaddr *)&clnAddr, &num2); int num3 = *(int *)DT_SetGetS32(&g_element[NUM_2_INDEX], 0); - ret = recv(lsfd, buf, sizeof(buf), num3); + (void)recv(lsfd, buf, sizeof(buf), num3); int num4 = *(int *)DT_SetGetS32(&g_element[NUM_3_INDEX], 0); ret = shutdown(sfd, num4);