From a36d5d9058910656013064057e133da72b7797a2 Mon Sep 17 00:00:00 2001 From: yinjiaming Date: Wed, 20 Jul 2022 09:42:09 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=86=85=E6=A0=B8=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E3=80=90=E8=83=8C=E6=99=AF=E3=80=91=20?= =?UTF-8?q?=E5=86=85=E6=A0=B8=E4=BB=A3=E7=A0=81=E7=BB=8F=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=89=AB=E6=8F=8F=E5=B7=A5=E5=85=B7=E5=8F=91=E7=8E=B0=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E4=B8=80=E4=BA=9B=E5=85=B3=E4=BA=8E=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E7=9A=84=E5=91=8A=E8=AD=A6=EF=BC=8C=20?= =?UTF-8?q?=E7=8E=B0=E7=BB=8F=E4=BF=AE=E6=94=B9=E8=A7=A3=E9=99=A4=E6=8E=89?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【修改方案】 修改了代码中格式不规范的地方,修改的点有: 1.代码中一行过长 2.没有合理的添加空格和空行 3.没有按照规范进行缩进 4.括号的格式没有按照规范 5.注释的格式不对以及存在魔数字 6.函数的声明与定义的格式不一致 并更新了修改文件的版权头时间 【影响】 对现有的产品编译不会有影响。 re #I5H6F5 Signed-off-by: yinjiaming Change-Id: Id8eb0450d03fae537ea4c73190fdadb76b29253d --- .../iar/TZ/secure/los_secure_context.h | 4 +- .../iar/TZ/secure/los_secure_context.h | 4 +- arch/include/los_interrupt.h | 23 ++++++---- components/cpup/los_cpup.c | 4 +- components/cpup/los_cpup.h | 11 +++-- components/dynlink/los_dynlink.c | 4 +- components/dynlink/los_dynlink.h | 6 +-- components/exchook/los_exc_info.h | 10 +++-- components/fs/vfs/los_fs.h | 4 +- components/fs/vfs/vfs_fs.c | 3 +- components/fs/vfs/vfs_maps.c | 5 ++- components/fs/vfs/vfs_maps.h | 2 +- components/fs/vfs/vfs_mount.c | 4 +- components/lmk/los_lmk.c | 4 +- components/lmk/los_lmk.h | 4 +- components/lms/lms_libc.c | 4 +- kal/libc/newlib/porting/include/netdb.h | 5 ++- kernel/include/los_event.h | 14 +++--- kernel/include/los_memory.h | 6 +-- kernel/include/los_queue.h | 5 ++- kernel/src/los_queue.c | 3 +- kernel/src/los_swtmr.c | 3 +- tools/mem_analysis.py | 44 +++++++++---------- utils/los_error.h | 5 +-- 24 files changed, 95 insertions(+), 86 deletions(-) diff --git a/arch/arm/cortex-m33/iar/TZ/secure/los_secure_context.h b/arch/arm/cortex-m33/iar/TZ/secure/los_secure_context.h index c988598e..accec59a 100644 --- a/arch/arm/cortex-m33/iar/TZ/secure/los_secure_context.h +++ b/arch/arm/cortex-m33/iar/TZ/secure/los_secure_context.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -63,5 +63,3 @@ extern VOID HalSecureContextSaveAsm(OsSecureContext *secureContext); #endif /* __cplusplus */ #endif - - diff --git a/arch/arm/cortex-m55/iar/TZ/secure/los_secure_context.h b/arch/arm/cortex-m55/iar/TZ/secure/los_secure_context.h index c988598e..accec59a 100644 --- a/arch/arm/cortex-m55/iar/TZ/secure/los_secure_context.h +++ b/arch/arm/cortex-m55/iar/TZ/secure/los_secure_context.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -63,5 +63,3 @@ extern VOID HalSecureContextSaveAsm(OsSecureContext *secureContext); #endif /* __cplusplus */ #endif - - diff --git a/arch/include/los_interrupt.h b/arch/include/los_interrupt.h index 257e4a77..fcb1d880 100644 --- a/arch/include/los_interrupt.h +++ b/arch/include/los_interrupt.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -107,13 +107,16 @@ UINT32 ArchIntUnLock(VOID); * * @attention * * - * @param hwiNum [IN] Type#HWI_HANDLE_T: hardware interrupt number. The value range applicable for a Cortex-A7 platform is [32,95]. + * @param hwiNum [IN] Type#HWI_HANDLE_T: hardware interrupt number. The value range applicable + * for a Cortex-A7 platform is [32,95]. * @param irqParam [IN] Type #HwiIrqParam *. ID of hardware interrupt which will base on * when delete the hardware interrupt. * @retval #OS_ERRNO_HWI_NUM_INVALID 0x02000900: Invalid interrupt number. @@ -133,13 +136,16 @@ UINT32 ArchHwiDelete(HWI_HANDLE_T hwiNum, HwiIrqParam *irqParam); * * @attention * * - * @param hwiNum [IN] Type#HWI_HANDLE_T: hardware interrupt number. The value range applicable for a Cortex-A7 platform is [32,95]. + * @param hwiNum [IN] Type#HWI_HANDLE_T: hardware interrupt number. The value range applicable for a + * Cortex-A7 platform is [32,95]. * @param hwiPrio [IN] Type#HWI_PRIOR_T: hardware interrupt priority. Ignore this parameter temporarily. * @param mode [IN] Type#HWI_MODE_T: hardware interrupt mode. Ignore this parameter temporarily. * @param handler [IN] Type#HWI_PROC_FUNC: interrupt handler used when a hardware interrupt is triggered. @@ -149,7 +155,8 @@ UINT32 ArchHwiDelete(HWI_HANDLE_T hwiNum, HwiIrqParam *irqParam); * @retval #OS_ERRNO_HWI_PROC_FUNC_NULL 0x02000901: Null hardware interrupt handling function. * @retval #OS_ERRNO_HWI_NUM_INVALID 0x02000900: Invalid interrupt number. * @retval #OS_ERRNO_HWI_NO_MEMORY 0x02000903: Insufficient memory for hardware interrupt creation. - * @retval #OS_ERRNO_HWI_ALREADY_CREATED 0x02000904: The interrupt handler being created has already been created. + * @retval #OS_ERRNO_HWI_ALREADY_CREATED 0x02000904: The interrupt handler being created has + * already been created. * @retval #LOS_OK 0 : The interrupt is successfully created. * @par Dependency: * diff --git a/components/cpup/los_cpup.c b/components/cpup/los_cpup.c index b403ee31..fe33dce9 100644 --- a/components/cpup/los_cpup.c +++ b/components/cpup/los_cpup.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -209,7 +209,6 @@ LITE_OS_SEC_TEXT_MINOR VOID OsTskCycleEnd(VOID) } cpuCycle = LOS_SysCycleGet(); - if (cpuCycle < g_cpup[taskID].startTime) { cpuCycle += g_cyclesPerTick; } @@ -625,7 +624,6 @@ LITE_OS_SEC_TEXT_MINOR VOID OsCpupIrqEnd(UINT32 intNum) } cpuCycle = LOS_SysCycleGet(); - if (cpuCycle < g_irqCpup[intNum].startTime) { cpuCycle += g_cyclesPerTick; } diff --git a/components/cpup/los_cpup.h b/components/cpup/los_cpup.h index 89e20cb5..5148459b 100644 --- a/components/cpup/los_cpup.h +++ b/components/cpup/los_cpup.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -250,7 +250,8 @@ extern UINT32 LOS_SysCpuUsage(VOID); * This API is used to obtain the historical CPU usage. * @attention * * * @param mode [IN] UINT16. Task mode. The parameter value 0 indicates that the CPU usage within 10s will be @@ -273,7 +274,8 @@ extern UINT32 LOS_HistorySysCpuUsage(UINT16 mode); * This API is used to obtain the CPU usage of a task specified by a passed-in task ID. * @attention * @@ -327,7 +329,8 @@ extern UINT32 LOS_HistoryTaskCpuUsage(UINT32 taskID, UINT16 mode); * This API is used to obtain the CPU usage of all tasks according to maximum number of threads. * @attention * * diff --git a/components/dynlink/los_dynlink.c b/components/dynlink/los_dynlink.c index cfcae348..8d503a85 100644 --- a/components/dynlink/los_dynlink.c +++ b/components/dynlink/los_dynlink.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: @@ -867,7 +867,7 @@ STATIC VOID OsDoFini(DynSharedObj *dso) --func; finiFunc = (INIT_FINI_FUNC)(*func); finiFunc(); - } + } } if (initFiniTab->fini.func != 0) { diff --git a/components/dynlink/los_dynlink.h b/components/dynlink/los_dynlink.h index ad7b1973..0ec9ea08 100644 --- a/components/dynlink/los_dynlink.h +++ b/components/dynlink/los_dynlink.h @@ -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: @@ -129,8 +129,8 @@ typedef struct { } DynSharedObj; typedef struct { - CHAR *name; - UINTPTR addr; + CHAR *name; + UINTPTR addr; } SymInfo; #define SYM_EXPORT(func) \ diff --git a/components/exchook/los_exc_info.h b/components/exchook/los_exc_info.h index 27a6bc92..c2840abd 100644 --- a/components/exchook/los_exc_info.h +++ b/components/exchook/los_exc_info.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -54,13 +54,15 @@ extern "C" { #endif #if (LOSCFG_BASE_CORE_EXC_TSK_SWITCH == 1) -#define MAX_SWITCH_INFO_SIZE (INFO_TYPE_AND_SIZE + (sizeof(UINT32) + sizeof(CHAR) * LOS_TASK_NAMELEN) * OS_TASK_SWITCH_INFO_COUNT) +#define MAX_SWITCH_INFO_SIZE (INFO_TYPE_AND_SIZE + (sizeof(UINT32) + sizeof(CHAR) * LOS_TASK_NAMELEN) \ + * OS_TASK_SWITCH_INFO_COUNT) #else #define MAX_SWITCH_INFO_SIZE (0) #endif - + #define MAX_MEM_INFO_SIZE (INFO_TYPE_AND_SIZE + sizeof(MemInfoCB) * OS_SYS_MEM_NUM) -#define MAX_EXC_MEM_SIZE (INFO_TYPE_AND_SIZE + MAX_SCENE_INFO_SIZE + MAX_TSK_INFO_SIZE + MAX_QUEUE_INFO_SIZE + MAX_INT_INFO_SIZE + MAX_SWITCH_INFO_SIZE + MAX_MEM_INFO_SIZE) +#define MAX_EXC_MEM_SIZE (INFO_TYPE_AND_SIZE + MAX_SCENE_INFO_SIZE + MAX_TSK_INFO_SIZE + MAX_QUEUE_INFO_SIZE \ + + MAX_INT_INFO_SIZE + MAX_SWITCH_INFO_SIZE + MAX_MEM_INFO_SIZE) typedef enum { OS_EXC_TYPE_CONTEXT = 0, diff --git a/components/fs/vfs/los_fs.h b/components/fs/vfs/los_fs.h index 9aed69d2..8bc6af20 100644 --- a/components/fs/vfs/los_fs.h +++ b/components/fs/vfs/los_fs.h @@ -80,8 +80,8 @@ int LOS_Ftruncate(int fd, off_t length); int LOS_FsUmount(const char *target); int LOS_FsUmount2(const char *target, int flag); int LOS_FsMount(const char *source, const char *target, - const char *fsType, unsigned long mountflags, - const void *data); + const char *fsType, unsigned long mountflags, + const void *data); /* * @brief Divide the device into partitions. * diff --git a/components/fs/vfs/vfs_fs.c b/components/fs/vfs/vfs_fs.c index b3af9b3f..30564871 100644 --- a/components/fs/vfs/vfs_fs.c +++ b/components/fs/vfs/vfs_fs.c @@ -909,7 +909,8 @@ static int MapToPosixRet(int ret) int LOS_Open(const char *path, int flags, ...) { #ifdef LOSCFG_RANDOM_DEV - unsigned flagMask = O_RDONLY | O_WRONLY | O_RDWR | O_APPEND | O_CREAT | O_LARGEFILE | O_TRUNC | O_EXCL | O_DIRECTORY; + unsigned flagMask = O_RDONLY | O_WRONLY | O_RDWR | O_APPEND | O_CREAT | O_LARGEFILE \ + | O_TRUNC | O_EXCL | O_DIRECTORY; if ((unsigned)flags & ~flagMask) { errno = EINVAL; return LOS_NOK; diff --git a/components/fs/vfs/vfs_maps.c b/components/fs/vfs/vfs_maps.c index f9d17970..ac4e9753 100644 --- a/components/fs/vfs/vfs_maps.c +++ b/components/fs/vfs/vfs_maps.c @@ -4,7 +4,8 @@ * 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 list of * conditions and the following disclaimer. * + * 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 and/or other materials * provided with the distribution. @@ -54,7 +55,7 @@ struct FsMap *VfsFsMapGet(const char *fsType) } int OsFsRegister(const char *fsType, struct MountOps *fsMops, - struct FileOps *fsFops, struct FsManagement *fsMgt) + struct FileOps *fsFops, struct FsManagement *fsMgt) { if ((fsMops == NULL) || (fsFops == NULL)) { return LOS_NOK; diff --git a/components/fs/vfs/vfs_maps.h b/components/fs/vfs/vfs_maps.h index 78bb63df..027d6623 100644 --- a/components/fs/vfs/vfs_maps.h +++ b/components/fs/vfs/vfs_maps.h @@ -57,7 +57,7 @@ struct FsMap { }; int OsFsRegister(const char *fsType, struct MountOps *fsMops, - struct FileOps *fsFops, struct FsManagement *fsMgt); + struct FileOps *fsFops, struct FsManagement *fsMgt); struct FsMap *VfsFsMapGet(const char *fsType); #ifdef __cplusplus diff --git a/components/fs/vfs/vfs_mount.c b/components/fs/vfs/vfs_mount.c index 9b09a188..8d28a614 100644 --- a/components/fs/vfs/vfs_mount.c +++ b/components/fs/vfs/vfs_mount.c @@ -123,8 +123,8 @@ struct MountPoint *VfsMpFind(const char *path, const char **pathInMp) } int LOS_FsMount(const char *source, const char *target, - const char *fsType, unsigned long mountflags, - const void *data) + const char *fsType, unsigned long mountflags, + const void *data) { int ret; struct MountPoint *mp = NULL; diff --git a/components/lmk/los_lmk.c b/components/lmk/los_lmk.c index 38700ef0..9cefcd60 100644 --- a/components/lmk/los_lmk.c +++ b/components/lmk/los_lmk.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -191,7 +191,7 @@ VOID LOS_LmkOpsNodeInfoShow(VOID) intSave = LOS_IntLock(); LOS_DL_LIST_FOR_EACH_ENTRY(opsNode, &g_losLmkOps.lmkOpsList, LosLmkOpsNode, node) { - PRINTK("Priority: %-4u Free:0x%-8x Restore:0x%-8x\n", opsNode->priority, + PRINTK("Priority: %-4u Free:0x%-8x Restore:0x%-8x\n", opsNode->priority, (UINT32)(UINTPTR)opsNode->freeMem, (UINT32)(UINTPTR)opsNode->restoreTask); } LOS_IntRestore(intSave); diff --git a/components/lmk/los_lmk.h b/components/lmk/los_lmk.h index c5a0637f..2bd20d5d 100644 --- a/components/lmk/los_lmk.h +++ b/components/lmk/los_lmk.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -199,7 +199,7 @@ UINT32 LOS_LmkTasksRestore(VOID); * @brief Kill the tasks to release the used memory. * * @par Description: - * This API is used to kill the tasks to release the used memory when low memory killer is triggered. + * This API is used to kill the tasks to release the used memory when low memory killer is triggered. * * @attention None. * diff --git a/components/lms/lms_libc.c b/components/lms/lms_libc.c index 101cba13..c2dbc5a7 100644 --- a/components/lms/lms_libc.c +++ b/components/lms/lms_libc.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -56,7 +56,7 @@ void *memcpy(void *dest, const void *src, size_t len) } #undef strcat -char *strcat (char *s, const char *append) +char *strcat(char *s, const char *append) { if ((s == NULL) || (append == NULL)) { return NULL; diff --git a/kal/libc/newlib/porting/include/netdb.h b/kal/libc/newlib/porting/include/netdb.h index 7cd1329e..24e1d570 100644 --- a/kal/libc/newlib/porting/include/netdb.h +++ b/kal/libc/newlib/porting/include/netdb.h @@ -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: @@ -175,7 +175,8 @@ int gethostbyname2_r(const char * __restrict name, int af, struct hostent * __re int * __restrict h_errnop); struct hostent *gethostbyname2(const char *name, int af); int gethostbyaddr_r(const void * __restrict addr, __socklen_t len, int type, struct hostent * __restrict result_buf, \ - char * __restrict buf, size_t buflen, struct hostent ** __restrict result, int * __restrict h_errnop); + char * __restrict buf, size_t buflen, struct hostent ** __restrict result, \ + int * __restrict h_errnop); int getservbyport_r(int port, const char * __restrict proto, struct servent * __restrict result_buf, \ char * __restrict buf, size_t buflen, struct servent ** __restrict result); int getservbyname_r(const char *name, const char *proto, struct servent *result_buf, char *buf, size_t buflen, \ diff --git a/kernel/include/los_event.h b/kernel/include/los_event.h index b568e680..2a917a94 100644 --- a/kernel/include/los_event.h +++ b/kernel/include/los_event.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -200,7 +200,8 @@ extern UINT32 LOS_EventInit(PEVENT_CB_S eventCB); * * @par Description: * This API is used to check whether an event expected by the user occurs according to the event ID, event mask, - * and event reading mode, and process the event based on the event reading mode. The event ID must point to valid memory. + * and event reading mode, and process the event based on the event reading mode. The event ID must point to + * valid memory. * @attention * * @attention @@ -234,13 +236,15 @@ extern UINT32 LOS_EventPoll(UINT32 *eventID, UINT32 eventMask, UINT32 mode); * the event mask is forbidden to be used. * * - * @param eventCB [IN/OUT] Pointer to the event control block to be checked. This parameter must point to valid memory. + * @param eventCB [IN/OUT] Pointer to the event control block to be checked. This parameter must point to + * valid memory. * @param eventMask [IN] Mask of the event expected to occur by the user, indicating the event obtained after * it is logically processed that matches the ID pointed to by eventID. * @param mode [IN] Event reading mode. * @param timeOut [IN] Timeout interval of event reading (unit: Tick). * - * @retval #LOS_ERRNO_EVENT_SETBIT_INVALID Bit 25 of the event mask cannot be set because it is set to an error number. + * @retval #LOS_ERRNO_EVENT_SETBIT_INVALID Bit 25 of the event mask cannot be set because + * it is set to an error number. * @retval #LOS_ERRNO_EVENT_EVENTMASK_INVALID The passed-in event reading mode is incorrect. * @retval #LOS_ERRNO_EVENT_READ_IN_INTERRUPT The event is being read during an interrupt. * @retval #LOS_ERRNO_EVENT_FLAGS_INVALID The event mode is invalid. diff --git a/kernel/include/los_memory.h b/kernel/include/los_memory.h index a6d23227..bfe0f023 100644 --- a/kernel/include/los_memory.h +++ b/kernel/include/los_memory.h @@ -156,9 +156,9 @@ typedef struct { * * @par Description: * * * @attention diff --git a/kernel/include/los_queue.h b/kernel/include/los_queue.h index f012d6f3..6bed1cb8 100644 --- a/kernel/include/los_queue.h +++ b/kernel/include/los_queue.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -344,7 +344,8 @@ extern "C" { /** * @ingroup los_queue * In struct QueueInfo, the length of each waitReadTask/waitWriteTask/waitMemTask array depends on the value - * LOSCFG_BASE_CORE_TSK_LIMIT. The type of each array element is UINT32, which means that each element could mark 32(=2^5) tasks. + * LOSCFG_BASE_CORE_TSK_LIMIT. The type of each array element is UINT32, which means that each element could + * mark 32(=2^5) tasks. * OS_WAIT_TASK_ARRAY_LEN is used to calculate the array length. * OS_WAIT_TASK_ID_TO_ARRAY_IDX is used to transfer task ID to array index. * OS_WAIT_TASK_ARRAY_ELEMENT_MASK is the mask for each element. diff --git a/kernel/src/los_queue.c b/kernel/src/los_queue.c index 8f72cec6..d9ab7927 100644 --- a/kernel/src/los_queue.c +++ b/kernel/src/los_queue.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -325,7 +325,6 @@ UINT32 OsQueueOperate(UINT32 queueID, UINT32 operateType, VOID *bufferAddr, UINT OsQueueBufferOperate(queueCB, operateType, bufferAddr, bufferSize); - if (!LOS_ListEmpty(&queueCB->readWriteList[readWriteTmp])) { resumedTask = OS_TCB_FROM_PENDLIST(LOS_DL_LIST_FIRST(&queueCB->readWriteList[readWriteTmp])); OsSchedTaskWake(resumedTask); diff --git a/kernel/src/los_swtmr.c b/kernel/src/los_swtmr.c index bcba0382..76411679 100644 --- a/kernel/src/los_swtmr.c +++ b/kernel/src/los_swtmr.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -101,7 +101,6 @@ LITE_OS_SEC_TEXT VOID OsSwtmrTask(VOID) tick = LOS_TickCountGet(); swtmrHandle.handler(swtmrHandle.arg); tick = LOS_TickCountGet() - tick; - if (tick >= SWTMR_MAX_RUNNING_TICKS) { PRINT_WARN("timer_handler(%p) cost too many ms(%d)\n", swtmrHandle.handler, diff --git a/tools/mem_analysis.py b/tools/mem_analysis.py index 7d576518..ac36b383 100644 --- a/tools/mem_analysis.py +++ b/tools/mem_analysis.py @@ -29,7 +29,7 @@ g_row_num = 0 try: from openpyxl import Workbook except: - print ("excel output is not support, need install openpyxl") + print("excel output is not support, need install openpyxl") else: g_excel_support = True @@ -60,21 +60,21 @@ def store_static_excel(): wb = Workbook() ws = wb.active for base_address, values in static_map.items(): - c = ws.cell(row = base_address + 1, column = 1) + c = ws.cell(row=base_address + 1, column=1) c.value = values.get('offsets') - c = ws.cell(row = base_address + 1, column = 2) + c = ws.cell(row=base_address + 1, column=2) c.value = values.get('section') - c = ws.cell(row = base_address + 1, column = 3) + c = ws.cell(row=base_address + 1, column=3) c.value = values.get('sizeH') - c = ws.cell(row = base_address + 1, column = 4) + c = ws.cell(row=base_address + 1, column=4) c.value = values.get('sizeD') - c = ws.cell(row = base_address + 1, column = 5) + c = ws.cell(row=base_address + 1, column=5) c.value = values.get('symbol') - c = ws.cell(row = base_address + 1, column = 6) + c = ws.cell(row=base_address + 1, column=6) c.value = values.get('lib') - c = ws.cell(row = base_address + 1, column = 7) + c = ws.cell(row=base_address + 1, column=7) c.value = values.get('obj') - wb.save('static_symbol-%s.xlsx' %datetime.datetime.now().strftime('%Y-%m-%d %H_%M_%S')) + wb.save('static_symbol-%s.xlsx' % datetime.datetime.now().strftime('%Y-%m-%d %H_%M_%S')) return def format_store_static(): @@ -152,7 +152,7 @@ def store_dync_excel(): c = ws.cell(row, column + 3) c.value = values.get('lib') column = column + 3 - wb.save('dync_mem-%s.xlsx' %datetime.datetime.now().strftime('%Y-%m-%d %H_%M_%S')) + wb.save('dync_mem-%s.xlsx' % datetime.datetime.now().strftime('%Y-%m-%d %H_%M_%S')) return def format_store_dync(): @@ -296,7 +296,7 @@ def parse_log(log_path): get_valid_log = False for index, line in enumerate(logline): char_list = line.split() - if len (char_list) < 3: + if len(char_list) < 3: continue if ("node" == char_list[0]) & ("LR[0]" == char_list[2]): storage_dync_head(len(char_list) - 2) @@ -318,34 +318,34 @@ def parse_log(log_path): continue def main(): - print ("memory parses tool ver.%2f\r\n" %g_version) + print("memory parses tool ver.%2f\r\n" % g_version) parser = argparse.ArgumentParser() - parser.add_argument('--m', help = 'map path.') - parser.add_argument('--l', help = 'dynamic mem log path.') - parser.add_argument('--d', help = 'objdump path.') + parser.add_argument('--m', help='map path.') + parser.add_argument('--l', help='dynamic mem log path.') + parser.add_argument('--d', help='objdump path.') args = parser.parse_args() - print ("map path: %s\r\n" %args.m) + print("map path: %s\r\n" % args.m) if args.m == None : - print ("arg error, input -h get the help list\r\n") + print("arg error, input -h get the help list\r\n") return parse_map(args.m) - print ("dump path: %s" %args.d) + print("dump path: %s" % args.d) if args.d != None : parse_dump(args.d) format_store_static() else: - print ("dump path unspecified, will not be static parser") - print ("you can enter the objdump -t command under the linux shell to obtain dump information\r\n") + print("dump path unspecified, will not be static parser") + print("you can enter the objdump -t command under the linux shell to obtain dump information\r\n") - print ("log path: %s" %args.l) + print("log path: %s" % args.l) if args.l != None : parse_log(args.l) format_store_dync() else: - print ("log path unspecified, will not be dynamic parser\r\n") + print("log path unspecified, will not be dynamic parser\r\n") return diff --git a/utils/los_error.h b/utils/los_error.h index 8747b993..a4cf2cc7 100644 --- a/utils/los_error.h +++ b/utils/los_error.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * Copyright (c) 2020-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: @@ -102,9 +102,6 @@ extern "C" { #define LOS_ERRNO_OS_NORMAL(moduleID, errno) \ (LOS_ERRTYPE_NORMAL | LOS_ERRNO_OS_ID | ((UINT32)(moduleID) << 8) | (errno)) - - - /** * @ingroup los_err * @brief Define the pointer to the error handling function.