fix:消除编译告警

【背景】
 消除编译告警

【修改方案】
 消除编译告警

 re #I3ZC1R

 Change-Id: I594d0f57e4cbbdb246a6bef1c978a38228123a34

 Signed-off-by: x-xiny <1301913191@qq.com>

Change-Id: I1d75cdcdcf9d06ec28e541cdfea77300da7c6bb1
This commit is contained in:
x_xiny 2021-07-06 16:37:10 +08:00
parent abbeca1cb2
commit e4ff04586f
13 changed files with 24 additions and 26 deletions

View File

@ -38,7 +38,6 @@
#include "los_excinfo_pri.h" #include "los_excinfo_pri.h"
#endif #endif
#include "los_sys_stack_pri.h" #include "los_sys_stack_pri.h"
#include "los_stackinfo_pri.h"
#ifdef LOSCFG_COREDUMP #ifdef LOSCFG_COREDUMP
#include "los_coredump.h" #include "los_coredump.h"
#endif #endif
@ -1007,7 +1006,7 @@ STATIC VOID OsCheckAllCpuStatus(VOID)
OsWaitOtherCoresHandleExcEnd(currCpuID); OsWaitOtherCoresHandleExcEnd(currCpuID);
} else { } else {
if (g_excFromUserMode[g_currHandleExcCpuID] == TRUE) { if ((g_currHandleExcCpuID < LOSCFG_KERNEL_CORE_NUM) && (g_excFromUserMode[g_currHandleExcCpuID] == TRUE)) {
g_currHandleExcCpuID = currCpuID; g_currHandleExcCpuID = currCpuID;
LOS_SpinUnlock(&g_excSerializerSpin); LOS_SpinUnlock(&g_excSerializerSpin);
target = (UINT32)(OS_MP_CPU_ALL & ~CPUID_TO_AFFI_MASK(currCpuID)); target = (UINT32)(OS_MP_CPU_ALL & ~CPUID_TO_AFFI_MASK(currCpuID));

View File

@ -456,7 +456,7 @@ static int PthreadGetCputime(clockid_t clockID, struct timespec *ats)
{ {
uint64_t runtime; uint64_t runtime;
UINT32 intSave; UINT32 intSave;
UINT32 tid = ((UINT32) ~((clockID) >> CPUCLOCK_ID_OFFSET)); UINT32 tid = ((UINT32) ~((UINT32)(clockID) >> CPUCLOCK_ID_OFFSET));
if (OS_TID_CHECK_INVALID(tid)) { if (OS_TID_CHECK_INVALID(tid)) {
return -EINVAL; return -EINVAL;
@ -482,7 +482,7 @@ static int ProcessGetCputime(clockid_t clockID, struct timespec *ats)
{ {
UINT64 runtime; UINT64 runtime;
UINT32 intSave; UINT32 intSave;
const pid_t pid = ((pid_t) ~((clockID) >> CPUCLOCK_ID_OFFSET)); const pid_t pid = ((pid_t) ~((UINT32)(clockID) >> CPUCLOCK_ID_OFFSET));
LosProcessCB *spcb = NULL; LosProcessCB *spcb = NULL;
if (OsProcessIDUserCheckInvalid(pid) || pid < 0) { if (OsProcessIDUserCheckInvalid(pid) || pid < 0) {
@ -524,7 +524,7 @@ static int GetCputime(clockid_t clockID, struct timespec *tp)
static int CheckClock(const clockid_t clockID) static int CheckClock(const clockid_t clockID)
{ {
int error = 0; int error = 0;
const pid_t pid = ((pid_t) ~((clockID) >> CPUCLOCK_ID_OFFSET)); const pid_t pid = ((pid_t) ~((UINT32)(clockID) >> CPUCLOCK_ID_OFFSET));
if (!((UINT32)clockID & CPUCLOCK_PERTHREAD_MASK)) { if (!((UINT32)clockID & CPUCLOCK_PERTHREAD_MASK)) {
LosProcessCB *spcb = NULL; LosProcessCB *spcb = NULL;

View File

@ -238,7 +238,8 @@ static mode_t fatfs_get_mode(BYTE attribute, mode_t fs_mode)
return fs_mode; return fs_mode;
} }
static enum VnodeType fatfstype_2_vnodetype(BYTE type) { static enum VnodeType fatfstype_2_vnodetype(BYTE type)
{
switch (type) { switch (type) {
case AM_ARC: case AM_ARC:
return VNODE_TYPE_REG; return VNODE_TYPE_REG;
@ -286,7 +287,7 @@ static FRESULT init_cluster(DIR_FILE *pdfp, DIR *dp_new, FATFS *fs, int type, co
mem_set(dir, 0, SS(fs)); mem_set(dir, 0, SS(fs));
if (type == AM_LNK && target) { if (type == AM_LNK && target) {
/* Write target to symlink */ /* Write target to symlink */
strcpy_s((char *)dir, SS(fs), target); (void)strcpy_s((char *)dir, SS(fs), target);
} else { } else {
/* Write the dir cluster */ /* Write the dir cluster */
mem_set(dir, 0, SS(fs)); mem_set(dir, 0, SS(fs));

View File

@ -406,7 +406,7 @@ int CopyFdToProc(int fd, unsigned int targetPid)
return -ESRCH; return -ESRCH;
} }
procFd = AssignProcessFd(fdt, 3); procFd = AssignProcessFd(fdt, 3); // minfd is 3
if (procFd < 0) { if (procFd < 0) {
if (sem_post(&semId) == -1) { if (sem_post(&semId) == -1) {
PRINT_ERR("sem_post error, errno %d \n", get_errno()); PRINT_ERR("sem_post error, errno %d \n", get_errno());

View File

@ -44,7 +44,7 @@
#include "vnode.h" #include "vnode.h"
#ifndef UNUSED #ifndef UNUSED
#define UNUSED(x) (VOID)x #define UNUSED(x) (VOID)(x)
#endif #endif
#ifdef LOSCFG_DEBUG_VERSION #ifdef LOSCFG_DEBUG_VERSION

View File

@ -34,7 +34,6 @@
#include "los_vm_zone.h" #include "los_vm_zone.h"
#include "los_vm_common.h" #include "los_vm_common.h"
#include "los_vm_map.h" #include "los_vm_map.h"
#include "los_vm_lock.h"
#include "los_memory.h" #include "los_memory.h"

View File

@ -437,7 +437,7 @@ STATIC VOID StoreReadChar(CONSOLE_CB *consoleCB, char ch, INT32 readcount)
VOID KillPgrp() VOID KillPgrp()
{ {
INT32 consoleId = -1; INT32 consoleId;
LosProcessCB *process = OsCurrProcessGet(); LosProcessCB *process = OsCurrProcessGet();
if ((process->consoleID > CONSOLE_NUM - 1) || (process->consoleID < 0)) { if ((process->consoleID > CONSOLE_NUM - 1) || (process->consoleID < 0)) {

View File

@ -83,7 +83,7 @@ LITE_OS_SEC_TEXT_INIT STATIC UINT32 EarliestInit(VOID)
LITE_OS_SEC_TEXT_INIT STATIC UINT32 ArchEarlyInit(VOID) LITE_OS_SEC_TEXT_INIT STATIC UINT32 ArchEarlyInit(VOID)
{ {
UINT32 ret = LOS_OK; UINT32 ret;
/* set system counter freq */ /* set system counter freq */
#ifndef LOSCFG_TEE_ENABLE #ifndef LOSCFG_TEE_ENABLE

View File

@ -35,7 +35,6 @@
#include "sys/resource.h" #include "sys/resource.h"
#include "sys/times.h" #include "sys/times.h"
#include "sys/utsname.h" #include "sys/utsname.h"
#include "time.h"
#include "capability_type.h" #include "capability_type.h"
#include "capability_api.h" #include "capability_api.h"
#include "los_process_pri.h" #include "los_process_pri.h"