From 4f12ab9a2a8ddb8fd4a0286ec0f8376bb8f7776a Mon Sep 17 00:00:00 2001 From: x_xiny <1301913191@qq.com> Date: Sat, 19 Mar 2022 19:04:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:3.1=E4=BB=A3=E7=A0=81=E6=A3=80=E8=A7=86?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: x_xiny <1301913191@qq.com> Change-Id: Ib69620ebf3c139b0e69c3fb5347eaf54cab275de --- arch/risc-v/riscv32/gcc/los_arch_atomic.h | 1 + components/net/lwip-2.1/porting/src/api_shell.c | 7 ------- components/net/lwip-2.1/porting/src/driverif.c | 2 -- components/net/lwip-2.1/porting/src/sys_arch.c | 7 +++---- components/shell/src/cmds/fullpath.c | 4 ++-- components/trace/los_trace.h | 4 ++-- kal/posix/src/pthread_mutex.c | 1 - kernel/src/los_queue.c | 2 +- kernel/src/los_sched.c | 2 +- testsuites/sample/kernel/swtmr/It_los_swtmr_040.c | 2 +- testsuites/sample/kernel/swtmr/It_los_swtmr_041.c | 4 ++-- testsuites/unittest/fuzz/src/socket/net_fuzz.c | 1 + utils/los_error.c | 1 - 13 files changed, 14 insertions(+), 24 deletions(-) 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/components/net/lwip-2.1/porting/src/api_shell.c b/components/net/lwip-2.1/porting/src/api_shell.c index d72775e6..68641831 100644 --- a/components/net/lwip-2.1/porting/src/api_shell.c +++ b/components/net/lwip-2.1/porting/src/api_shell.c @@ -223,13 +223,6 @@ 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__); 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..64309410 100644 --- a/components/net/lwip-2.1/porting/src/sys_arch.c +++ b/components/net/lwip-2.1/porting/src/sys_arch.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #ifndef LOSCFG_KERNEL_SMP @@ -151,7 +150,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; @@ -292,7 +291,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 +366,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/shell/src/cmds/fullpath.c b/components/shell/src/cmds/fullpath.c index f98a734a..b5a01a12 100755 --- 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/trace/los_trace.h b/components/trace/los_trace.h index fb089117..24812697 100644 --- a/components/trace/los_trace.h +++ b/components/trace/los_trace.h @@ -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/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/src/los_queue.c b/kernel/src/los_queue.c index 5d64248c..0d074bdc 100644 --- a/kernel/src/los_queue.c +++ b/kernel/src/los_queue.c @@ -492,7 +492,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/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/socket/net_fuzz.c b/testsuites/unittest/fuzz/src/socket/net_fuzz.c index e2534eff..bb49f2ad 100644 --- a/testsuites/unittest/fuzz/src/socket/net_fuzz.c +++ b/testsuites/unittest/fuzz/src/socket/net_fuzz.c @@ -263,6 +263,7 @@ static void *SampleTcpClient() /* send */ ret = memset_s(buf, sizeof(buf), 0, BUF_SIZE); if (err != EOK) { + close(sfd); return (void *)(intptr_t)ret; } (void)strcpy_s(buf, sizeof(buf), CLI_MSG); 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); }