diff --git a/arch/arm/arm/src/los_exc.c b/arch/arm/arm/src/los_exc.c index 3c0897bf1dd401f1a086efcaaf404173a03ab5d3..a1ee6ea43743f0457f766feeca66432189916585 100644 --- a/arch/arm/arm/src/los_exc.c +++ b/arch/arm/arm/src/los_exc.c @@ -455,7 +455,7 @@ STATIC VOID OsDumpExcVaddrRegion(LosVmSpace *space, LosVmMapRegion *region) mmuFlag = FALSE; } PrintExcInfo(" 0x%08x 0x%08x 0x%08x\n", - startVaddr, LOS_PaddrToKVaddr(startPaddr), (UINT32)pageCount << PAGE_SHIFT); + startVaddr, (UINTPTR)LOS_PaddrToKVaddr(startPaddr), (UINT32)pageCount << PAGE_SHIFT); pageCount = 0; startPaddr = 0; } @@ -516,7 +516,7 @@ VOID OsDumpContextMem(const ExcContext *excBufAddr) for (excReg = &(excBufAddr->R0); count <= DUMPREGS; excReg++, count++) { if (IS_VALID_ADDR(*excReg)) { - PrintExcInfo("\ndump mem around R%u:%p", count, (*excReg)); + PrintExcInfo("\ndump mem around R%u:0x%x", count, (*excReg)); OsDumpMemByte(DUMPSIZE, ((*excReg) - (DUMPSIZE >> 1))); } } @@ -812,7 +812,7 @@ VOID OsCallStackInfo(VOID) PrintExcInfo("runTask->stackPointer = 0x%x\n" "runTask->topOfStack = 0x%x\n" "text_start:0x%x,text_end:0x%x\n", - stackPointer, runTask->topOfStack, &__text_start, &__text_end); + (UINTPTR)stackPointer, runTask->topOfStack, &__text_start, &__text_end); while ((stackPointer > (UINT32 *)runTask->topOfStack) && (count < OS_MAX_BACKTRACE)) { if ((*stackPointer > (UINTPTR)(&__text_start)) && diff --git a/compat/posix/src/pthread.c b/compat/posix/src/pthread.c index f8ee1bf68fd27cd0aa97a8fe8525820a41286ad7..89722445cbe2a68d0c72dbc6a1034ff07b9530a6 100644 --- a/compat/posix/src/pthread.c +++ b/compat/posix/src/pthread.c @@ -231,7 +231,7 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr, SetPthreadAttr(self, attr, &userAttr); - (VOID)snprintf_s(name, sizeof(name), sizeof(name) - 1, "pth%02d", pthreadNumber); + (VOID)snprintf_s(name, sizeof(name), sizeof(name) - 1, "pth%02u", pthreadNumber); pthreadNumber++; taskInitParam.pcName = name; diff --git a/fs/proc/os_adapt/fd_proc.c b/fs/proc/os_adapt/fd_proc.c index d357227ae2afe9ba018090c8cb69c6a6c6c92165..47b25c69ddd2409a887ecaf1ea1e330f902ed0b6 100644 --- a/fs/proc/os_adapt/fd_proc.c +++ b/fs/proc/os_adapt/fd_proc.c @@ -75,7 +75,7 @@ static void FillFdInfo(struct SeqBuf *seqBuf, struct filelist *fileList, unsigne } if (hasPrivilege) { - (void)LosBufPrintf(seqBuf, "%u\t%d\t%6d <%d>\t%s\n", pid, fd, sysFd, filp ? filp->f_refcount : 1, name); + (void)LosBufPrintf(seqBuf, "%u\t%d\t%6d <%lu>\t%s\n", pid, fd, sysFd, filp ? filp->f_refcount : 1, name); } else { (void)LosBufPrintf(seqBuf, "%u\t%d\t%s\n", pid, fd, name); } diff --git a/fs/vfs/operation/vfs_init.c b/fs/vfs/operation/vfs_init.c index fbb88a07fa22c38f3f2fde6f2413b3bf44a8b8ba..98f630af426c6697892ac73e2beaf22b1ff60f03 100644 --- a/fs/vfs/operation/vfs_init.c +++ b/fs/vfs/operation/vfs_init.c @@ -59,24 +59,24 @@ void los_vfs_init(void) retval = VnodesInit(); if (retval != LOS_OK) { - PRINT_ERR("los_vfs_init VnodeInit failed error %d\n", retval); + PRINT_ERR("los_vfs_init VnodeInit failed error %u\n", retval); return; } retval = PathCacheInit(); if (retval != LOS_OK) { - PRINT_ERR("los_vfs_init PathCacheInit failed error %d\n", retval); + PRINT_ERR("los_vfs_init PathCacheInit failed error %u\n", retval); return; } retval = VnodeHashInit(); if (retval != LOS_OK) { - PRINT_ERR("los_vfs_init VnodeHashInit failed error %d\n", retval); + PRINT_ERR("los_vfs_init VnodeHashInit failed error %u\n", retval); return; } retval = VnodeDevInit(); if (retval != LOS_OK) { - PRINT_ERR("los_vfs_init VnodeDevInit failed error %d\n", retval); + PRINT_ERR("los_vfs_init VnodeDevInit failed error %u\n", retval); return; } diff --git a/fs/vfs/operation/vfs_other.c b/fs/vfs/operation/vfs_other.c index 9d3a6e8bd22b64a35a0e213534e7f4e3c11dc80e..50e48c6aeeddae1907f2cb5e4739689a953690f4 100644 --- a/fs/vfs/operation/vfs_other.c +++ b/fs/vfs/operation/vfs_other.c @@ -535,7 +535,7 @@ static void PrintFileInfo64(const struct stat64 *stat64Info, const char *name) dirFlag = '-'; } - PRINTK("%c%s%s%s %-8lld u:%-5d g:%-5d %-10s\n", dirFlag, + PRINTK("%c%s%s%s %-8lld u:%-5u g:%-5u %-10s\n", dirFlag, str[0], str[1], str[UGO_NUMS - 1], stat64Info->st_size, stat64Info->st_uid, stat64Info->st_gid, name); } @@ -561,7 +561,7 @@ static void PrintFileInfo(const struct stat *statInfo, const char *name) dirFlag = '-'; } - PRINTK("%c%s%s%s %-8lld u:%-5d g:%-5d %-10s\n", dirFlag, + PRINTK("%c%s%s%s %-8lld u:%-5u g:%-5u %-10s\n", dirFlag, str[0], str[1], str[UGO_NUMS - 1], statInfo->st_size, statInfo->st_uid, statInfo->st_gid, name); } @@ -736,7 +736,7 @@ void lsfd(void) while (i < CONFIG_NFILE_DESCRIPTORS) { node = files_get_openfile(i); if (node) { - PRINTK("%5d %s\n", i, f_list->fl_files[i].f_path); + PRINTK("%5u %s\n", i, f_list->fl_files[i].f_path); } i++; } diff --git a/fs/vfs/path_cache.c b/fs/vfs/path_cache.c index ef80df6ae309cfa050465653511fcd4a4e954668..ffe98e283a4e354c0835669a1ffe8b9a19bab3ba 100644 --- a/fs/vfs/path_cache.c +++ b/fs/vfs/path_cache.c @@ -71,7 +71,7 @@ void PathCacheDump(void) LIST_HEAD *nhead = &g_pathCacheHashEntrys[i]; LOS_DL_LIST_FOR_EACH_ENTRY(pc, nhead, struct PathCache, hashEntry) { - PRINTK(" pathCache dump hash %d item %s %p %p %d\n", i, + PRINTK(" pathCache dump hash %d item %s %p %p %u\n", i, pc->name, pc->parentVnode, pc->childVnode, pc->nameLen); } } diff --git a/fs/vfs/vnode.c b/fs/vfs/vnode.c index c5933a3324185c9d3488af2d292e0c9baf59d7d6..795622f7ab4faab2788adae9f2e63fb80b5d1754 100644 --- a/fs/vfs/vnode.c +++ b/fs/vfs/vnode.c @@ -669,7 +669,7 @@ void VnodeMemoryDump(void) } PRINTK("Vnode number = %d\n", vnodeCount); - PRINTK("Vnode memory size = %d(B)\n", vnodeCount * sizeof(struct Vnode)); + PRINTK("Vnode memory size = %u(B)\n", vnodeCount * sizeof(struct Vnode)); } LIST_HEAD* GetVnodeFreeList() diff --git a/kernel/base/core/los_process.c b/kernel/base/core/los_process.c index f4e8a552039e167235e20907adb00e388bf492dc..839fd555b4c62f1f5c2e08e76ffbae523358385a 100644 --- a/kernel/base/core/los_process.c +++ b/kernel/base/core/los_process.c @@ -338,7 +338,7 @@ STATIC VOID OsWaitCheckAndWakeParentProcess(LosProcessCB *parentCB, const LosPro LITE_OS_SEC_TEXT VOID OsProcessResourcesToFree(LosProcessCB *processCB) { if (!(processCB->processStatus & (OS_PROCESS_STATUS_INIT | OS_PROCESS_STATUS_RUNNING))) { - PRINT_ERR("The process(%d) has no permission to release process(%d) resources!\n", + PRINT_ERR("The process(%u) has no permission to release process(%u) resources!\n", OsCurrProcessGet()->processID, processCB->processID); } diff --git a/kernel/base/core/los_task.c b/kernel/base/core/los_task.c index 67b7ab645d7de18c1646d20eb22e00fb71cf738a..c4a5c7345edc0a136ce0aaf8e0d5b0efab938bcf 100644 --- a/kernel/base/core/los_task.c +++ b/kernel/base/core/los_task.c @@ -478,7 +478,7 @@ LITE_OS_SEC_TEXT VOID OsTaskResourcesToFree(LosTaskCB *taskCB) LOS_ASSERT(!(processCB->vmSpace == NULL)); UINT32 ret = OsUnMMap(processCB->vmSpace, (UINTPTR)mapBase, mapSize); if ((ret != LOS_OK) && (mapBase != 0) && !(processCB->processStatus & OS_PROCESS_STATUS_INIT)) { - PRINT_ERR("process(%u) ummap user task(%u) stack failed! mapbase: 0x%x size :0x%x, error: %d\n", + PRINT_ERR("process(%u) ummap user task(%u) stack failed! mapbase: 0x%x size :0x%x, error: %u\n", processCB->processID, taskCB->taskID, mapBase, mapSize, ret); } diff --git a/kernel/base/ipc/los_futex.c b/kernel/base/ipc/los_futex.c index 1c6afd2cb13d015adfca03e53760c9fd4e9d1cf5..96cdfb7b8da53b02128952884ac822b1f727a1f4 100644 --- a/kernel/base/ipc/los_futex.c +++ b/kernel/base/ipc/los_futex.c @@ -519,7 +519,7 @@ STATIC INT32 OsFutexWaitParamCheck(const UINT32 *userVaddr, UINT32 flags, UINT32 } if (flags && (OsFutexKeyShmPermCheck(userVaddr, flags) != LOS_OK)) { - PRINT_ERR("Futex wait param check failed! error shared memory perm userVaddr: 0x%x\n", userVaddr); + PRINT_ERR("Futex wait param check failed! error shared memory perm userVaddr: 0x%x\n", (UINTPTR)userVaddr); return LOS_EINVAL; } @@ -663,12 +663,12 @@ STATIC INT32 OsFutexWakeParamCheck(const UINT32 *userVaddr, UINT32 flags) } if ((vaddr % sizeof(INT32)) || (vaddr < OS_FUTEX_KEY_BASE) || (vaddr >= OS_FUTEX_KEY_MAX)) { - PRINT_ERR("Futex wake param check failed! error userVaddr: 0x%x\n", userVaddr); + PRINT_ERR("Futex wake param check failed! error userVaddr: 0x%x\n", (UINTPTR)userVaddr); return LOS_EINVAL; } if (flags && (OsFutexKeyShmPermCheck(userVaddr, flags) != LOS_OK)) { - PRINT_ERR("Futex wake param check failed! error shared memory perm userVaddr: 0x%x\n", userVaddr); + PRINT_ERR("Futex wake param check failed! error shared memory perm userVaddr: 0x%x\n", (UINTPTR)userVaddr); return LOS_EINVAL; } @@ -941,12 +941,12 @@ STATIC INT32 OsFutexRequeueParamCheck(const UINT32 *oldUserVaddr, UINT32 flags, } if ((oldVaddr % sizeof(INT32)) || (oldVaddr < OS_FUTEX_KEY_BASE) || (oldVaddr >= OS_FUTEX_KEY_MAX)) { - PRINT_ERR("Futex requeue param check failed! error old userVaddr: 0x%x\n", oldUserVaddr); + PRINT_ERR("Futex requeue param check failed! error old userVaddr: 0x%x\n", (UINTPTR)oldUserVaddr); return LOS_EINVAL; } if ((newVaddr % sizeof(INT32)) || (newVaddr < OS_FUTEX_KEY_BASE) || (newVaddr >= OS_FUTEX_KEY_MAX)) { - PRINT_ERR("Futex requeue param check failed! error new userVaddr: 0x%x\n", newUserVaddr); + PRINT_ERR("Futex requeue param check failed! error new userVaddr: 0x%x\n", (UINTPTR)newUserVaddr); return LOS_EINVAL; } diff --git a/kernel/base/ipc/los_signal.c b/kernel/base/ipc/los_signal.c index 22618e2deaf5af75df513c025b1f9a8325da9724..e0e1728f7ec09baebeb07606b150d2c86a9c17ba 100644 --- a/kernel/base/ipc/los_signal.c +++ b/kernel/base/ipc/los_signal.c @@ -698,7 +698,7 @@ VOID *OsSaveSignalContext(VOID *sp, VOID *newSp) sigcb->sigFlag = 0; process->sigShare = 0; SCHEDULER_UNLOCK(intSave); - PRINT_ERR("The signal processing function for the current process pid =%d is NULL!\n", task->processID); + PRINT_ERR("The signal processing function for the current process pid =%u is NULL!\n", task->processID); return sp; } /* One pthread do the share signal */ @@ -732,7 +732,7 @@ VOID *OsRestorSignalContext(VOID *sp) SCHEDULER_LOCK(intSave); if (sigcb->count != 1) { SCHEDULER_UNLOCK(intSave); - PRINT_ERR("sig error count : %d\n", sigcb->count); + PRINT_ERR("sig error count : %u\n", sigcb->count); return sp; } diff --git a/kernel/base/mem/tlsf/los_memory.c b/kernel/base/mem/tlsf/los_memory.c index d5e5b99ab113b1c528c6d4ec015163c47487f65d..ded46c00cdf52fdbb98e6849fc050bb9a86b5fa7 100644 --- a/kernel/base/mem/tlsf/los_memory.c +++ b/kernel/base/mem/tlsf/los_memory.c @@ -312,7 +312,7 @@ STATIC INLINE struct OsMemNodeHead *PreSentinelNodeGet(const VOID *pool, const s sentinelNode = OS_MEM_END_NODE(pool, ((struct OsMemPoolHead *)pool)->info.totalSize); while (sentinelNode != NULL) { if (OsMemIsLastSentinelNode(sentinelNode)) { - PRINT_ERR("PreSentinelNodeGet can not find node %#x\n", node); + PRINT_ERR("PreSentinelNodeGet can not find node %#x\n", (UINTPTR)node); return NULL; } nextNode = OsMemSentinelNodeGet(sentinelNode); @@ -363,7 +363,7 @@ STATIC INLINE BOOL TryShrinkPool(const VOID *pool, const struct OsMemNodeHead *n } if (OsMemLargeNodeFree(node) != LOS_OK) { - PRINT_ERR("TryShrinkPool free %#x failed!\n", node); + PRINT_ERR("TryShrinkPool free %#x failed!\n", (UINTPTR)node); return FALSE; } @@ -1474,13 +1474,13 @@ STATIC UINT32 OsMemAddrValidCheckPrint(const VOID *pool, struct OsMemFreeNodeHea if (((*tmpNode)->prev != NULL) && !OsMemAddrValidCheck(pool, (*tmpNode)->prev)) { PRINT_ERR("[%s], %d, memory check error!\n" " freeNode.prev:%#x is out of legal mem range\n", - __FUNCTION__, __LINE__, (*tmpNode)->prev); + __FUNCTION__, __LINE__, (UINTPTR)(*tmpNode)->prev); return LOS_NOK; } if (((*tmpNode)->next != NULL) && !OsMemAddrValidCheck(pool, (*tmpNode)->next)) { PRINT_ERR("[%s], %d, memory check error!\n" " freeNode.next:%#x is out of legal mem range\n", - __FUNCTION__, __LINE__, (*tmpNode)->next); + __FUNCTION__, __LINE__, (UINTPTR)(*tmpNode)->next); return LOS_NOK; } return LOS_OK; @@ -1538,7 +1538,7 @@ STATIC VOID OsMemPoolHeadCheck(const struct OsMemPoolHead *pool) if (OsMemFreeListNodeCheck(pool, tmpNode)) { flag = 1; PRINT_ERR("FreeListIndex: %u, node: %#x, bNode: %#x, prev: %#x, next: %#x\n", - index, tmpNode, tmpNode->header.ptr.prev, tmpNode->prev, tmpNode->next); + index, (UINTPTR)tmpNode, (UINTPTR)tmpNode->header.ptr.prev, (UINTPTR)tmpNode->prev, (UINTPTR)tmpNode->next); goto OUT; } } @@ -1546,7 +1546,7 @@ STATIC VOID OsMemPoolHeadCheck(const struct OsMemPoolHead *pool) OUT: if (flag) { - PRINTK("mem pool info: poolAddr: %#x, poolSize: 0x%x\n", pool, pool->info.totalSize); + PRINTK("mem pool info: poolAddr: %#x, poolSize: 0x%x\n", (UINTPTR)pool, pool->info.totalSize); #ifdef LOSCFG_MEM_WATERLINE PRINTK("mem pool info: poolWaterLine: 0x%x, poolCurUsedSize: 0x%x\n", pool->info.waterLine, pool->info.curUsedSize); @@ -1559,7 +1559,7 @@ OUT: size = OS_MEM_NODE_GET_SIZE(sentinel->sizeAndFlag); node = OsMemSentinelNodeGet(sentinel); sentinel = OS_MEM_END_NODE(node, size); - PRINTK("expand node info: nodeAddr: %#x, nodeSize: 0x%x\n", node, size); + PRINTK("expand node info: nodeAddr: %#x, nodeSize: 0x%x\n", (UINTPTR)node, size); } #endif } @@ -1606,23 +1606,23 @@ STATIC VOID OsMemNodeInfo(const struct OsMemNodeHead *tmpNode, if (OS_MEM_NODE_GET_USED_FLAG(tmpNode->sizeAndFlag)) { usedNode = (struct OsMemUsedNodeHead *)tmpNode; PRINTK("\n broken node head: %#x %#x %#x, ", - usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag); + (UINTPTR)usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag); } else { freeNode = (struct OsMemFreeNodeHead *)tmpNode; PRINTK("\n broken node head: %#x %#x %#x %#x, ", - freeNode->header.ptr.prev, freeNode->next, freeNode->prev, freeNode->header.magic, - freeNode->header.sizeAndFlag); + (UINTPTR)freeNode->header.ptr.prev, (UINTPTR)freeNode->next, (UINTPTR)freeNode->prev, + freeNode->header.magic, freeNode->header.sizeAndFlag); } if (OS_MEM_NODE_GET_USED_FLAG(preNode->sizeAndFlag)) { usedNode = (struct OsMemUsedNodeHead *)preNode; PRINTK("prev node head: %#x %#x %#x\n", - usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag); + (UINTPTR)usedNode->header.ptr.prev, usedNode->header.magic, usedNode->header.sizeAndFlag); } else { freeNode = (struct OsMemFreeNodeHead *)preNode; PRINTK("prev node head: %#x %#x %#x %#x, ", - freeNode->header.ptr.prev, freeNode->next, freeNode->prev, freeNode->header.magic, - freeNode->header.sizeAndFlag); + (UINTPTR)freeNode->header.ptr.prev, (UINTPTR)freeNode->next, (UINTPTR)freeNode->prev, + freeNode->header.magic, freeNode->header.sizeAndFlag); } #ifdef LOSCFG_MEM_LEAKCHECK @@ -1630,11 +1630,11 @@ STATIC VOID OsMemNodeInfo(const struct OsMemNodeHead *tmpNode, #endif PRINTK("\n---------------------------------------------\n"); - PRINTK(" dump mem tmpNode:%#x ~ %#x\n", tmpNode, ((UINTPTR)tmpNode + OS_MEM_NODE_DUMP_SIZE)); + PRINTK(" dump mem tmpNode:%#x ~ %#x\n", (UINTPTR)tmpNode, ((UINTPTR)tmpNode + OS_MEM_NODE_DUMP_SIZE)); OsDumpMemByte(OS_MEM_NODE_DUMP_SIZE, (UINTPTR)tmpNode); PRINTK("\n---------------------------------------------\n"); if (preNode != tmpNode) { - PRINTK(" dump mem :%#x ~ tmpNode:%#x\n", ((UINTPTR)tmpNode - OS_MEM_NODE_DUMP_SIZE), tmpNode); + PRINTK(" dump mem :%#x ~ tmpNode:%#x\n", ((UINTPTR)tmpNode - OS_MEM_NODE_DUMP_SIZE), (UINTPTR)tmpNode); OsDumpMemByte(OS_MEM_NODE_DUMP_SIZE, ((UINTPTR)tmpNode - OS_MEM_NODE_DUMP_SIZE)); PRINTK("\n---------------------------------------------\n"); } @@ -1669,10 +1669,10 @@ STATIC VOID OsMemIntegrityCheckError(struct OsMemPoolHead *pool, } MEM_UNLOCK(pool, intSave); LOS_Panic("cur node: %#x\npre node: %#x\npre node was allocated by task:%s\n", - tmpNode, preNode, taskCB->taskName); + (UINTPTR)tmpNode, (UINTPTR)preNode, taskCB->taskName); #else MEM_UNLOCK(pool, intSave); - LOS_Panic("Memory interity check error, cur node: %#x, pre node: %#x\n", tmpNode, preNode); + LOS_Panic("Memory interity check error, cur node: %#x, pre node: %#x\n", (UINTPTR)tmpNode, (UINTPTR)preNode); #endif } @@ -1753,7 +1753,7 @@ UINT32 LOS_MemInfoGet(VOID *pool, LOS_MEM_POOL_STATUS *poolStatus) } if ((pool == NULL) || (poolInfo->info.pool != pool)) { - PRINT_ERR("wrong mem pool addr: %#x, line:%d\n", poolInfo, __LINE__); + PRINT_ERR("wrong mem pool addr: %#x, line:%d\n", (UINTPTR)poolInfo, __LINE__); return LOS_NOK; } diff --git a/kernel/base/misc/los_stackinfo.c b/kernel/base/misc/los_stackinfo.c index 5bac7160abb8ff6ccdb41a4a55bb37980c72e14e..ddb5159fe39277d1b5182a4cb9e67d702ff0c162 100644 --- a/kernel/base/misc/los_stackinfo.c +++ b/kernel/base/misc/los_stackinfo.c @@ -100,7 +100,7 @@ VOID OsExcStackInfo(VOID) stack = (UINTPTR *)((UINTPTR)stackTop + g_stackInfo[index].stackSize); (VOID)OsStackWaterLineGet(stack, stackTop, &size); - PrintExcInfo("%11s %-5d %-10p 0x%-8x 0x%-4x\n", g_stackInfo[index].stackName, + PrintExcInfo("%11s %-5u %-10p 0x%-8x 0x%-4x\n", g_stackInfo[index].stackName, LOSCFG_KERNEL_CORE_NUM - 1 - cpuid, stackTop, g_stackInfo[index].stackSize, size); } } diff --git a/kernel/base/misc/mempt_shellcmd.c b/kernel/base/misc/mempt_shellcmd.c index 7177ace6824ada216d73033f1107a5be8f3f14ce..147db68e7412aa404c82cd14d20ca256e5f5f013 100644 --- a/kernel/base/misc/mempt_shellcmd.c +++ b/kernel/base/misc/mempt_shellcmd.c @@ -63,7 +63,7 @@ VOID OsDumpMemByte(size_t length, UINTPTR addr) } while (dataLen) { if (IS_ALIGNED(count, sizeof(CHAR *))) { - PRINTK("\n 0x%lx :", alignAddr); + PRINTK("\n 0x%lx :", (UINTPTR)alignAddr); #ifdef LOSCFG_SAVE_EXCINFO WriteExcInfoToBuf("\n 0x%lx :", alignAddr); #endif diff --git a/kernel/base/mp/los_lockdep.c b/kernel/base/mp/los_lockdep.c index 2b850eb7de6e99bfc45c482578c1706188ebbcc8..d2e01b68b2bb75e103a43bc0be52152dfb876241 100644 --- a/kernel/base/mp/los_lockdep.c +++ b/kernel/base/mp/los_lockdep.c @@ -111,7 +111,7 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock, PrintExcInfo("lockdep check failed\n"); PrintExcInfo("error type : %s\n", OsLockDepErrorStringGet(errType)); - PrintExcInfo("request addr : 0x%x\n", requestAddr); + PrintExcInfo("request addr : 0x%x\n", (UINTPTR)requestAddr); while (1) { PrintExcInfo("task name : %s\n", temp->taskName); @@ -121,7 +121,7 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock, for (i = 0; i < lockDep->lockDepth; i++) { if (lockDep->heldLocks[i].lockPtr == lock) { PrintExcInfo("[%d] %s <-- addr:0x%x\n", i, LOCKDEP_GET_NAME(lockDep, i), - LOCKDEP_GET_ADDR(lockDep, i)); + (UINTPTR)LOCKDEP_GET_ADDR(lockDep, i)); } else { PrintExcInfo("[%d] %s \n", i, LOCKDEP_GET_NAME(lockDep, i)); } diff --git a/kernel/base/sched/sched_sq/los_sched.c b/kernel/base/sched/sched_sq/los_sched.c index dab0291c47b921da52c68d055a2ae3c754d96f29..e1f07620f4155a26eb11895b43555fd74b0d37d4 100644 --- a/kernel/base/sched/sched_sq/los_sched.c +++ b/kernel/base/sched/sched_sq/los_sched.c @@ -920,7 +920,7 @@ VOID OsSchedStart(VOID) OsPercpuGet()->responseID = OS_INVALID; OsSchedSetNextExpireTime(newTask->startTime, newTask->taskID, newTask->startTime + newTask->timeSlice, OS_INVALID); - PRINTK("cpu %d entering scheduler\n", cpuid); + PRINTK("cpu %u entering scheduler\n", cpuid); OsTaskContextLoad(newTask); } @@ -939,7 +939,7 @@ VOID OsSchedToUserReleaseLock(VOID) STATIC VOID OsTaskStackCheck(LosTaskCB *runTask, LosTaskCB *newTask) { if (!OS_STACK_MAGIC_CHECK(runTask->topOfStack)) { - LOS_Panic("CURRENT task ID: %s:%d stack overflow!\n", runTask->taskName, runTask->taskID); + LOS_Panic("CURRENT task ID: %s:%u stack overflow!\n", runTask->taskName, runTask->taskID); } if (((UINTPTR)(newTask->stackPointer) <= newTask->topOfStack) || diff --git a/kernel/base/vm/los_vm_dump.c b/kernel/base/vm/los_vm_dump.c index 83ef92b4331bc856897d185faae635ca2c8ea9fc..e156a2a82150827c14bfd81b8ddf5f89d5c0db94 100644 --- a/kernel/base/vm/los_vm_dump.c +++ b/kernel/base/vm/los_vm_dump.c @@ -374,8 +374,8 @@ VOID OsDumpRegion2(LosVmSpace *space, LosVmMapRegion *region) if (flagsStr == NULL) { return; } - PRINTK("\t %#010x %-32.32s %#010x %#010x %-15.15s %4d %4d\n", - region, OsGetRegionNameOrFilePath(region), region->range.base, + PRINTK("\t %#010x %-32.32s %#010x %#010x %-15.15s %4u %4u\n", + (UINTPTR)region, OsGetRegionNameOrFilePath(region), region->range.base, region->range.size, flagsStr, regionPages, pssPages); (VOID)LOS_MemFree(m_aucSysMem0, flagsStr); } @@ -395,7 +395,7 @@ VOID OsDumpAspace(LosVmSpace *space) spacePages = OsCountAspacePages(space); PRINTK("\r\n PID aspace name base size pages \n"); PRINTK(" ---- ------ ---- ---- ----- ----\n"); - PRINTK(" %-4d %#010x %-10.10s %#010x %#010x %d\n", pcb->processID, space, pcb->processName, + PRINTK(" %-4u %#010x %-10.10s %#010x %#010x %u\n", pcb->processID, space, pcb->processName, space->base, space->size, spacePages); PRINTK("\r\n\t region name base size mmu_flags pages pg/ref\n"); PRINTK("\t ------ ---- ---- ---- --------- ----- -----\n"); @@ -468,7 +468,7 @@ VOID OsDumpPte(VADDR_T vaddr) } return; ERR: - PRINTK("%s, error vaddr: %#x, l2Table: %#x, l2Index: %#x\n", __FUNCTION__, vaddr, l2Table, l2Index); + PRINTK("%s, error vaddr: %#x, l2Table: %#x, l2Index: %#x\n", __FUNCTION__, vaddr, (UINTPTR)l2Table, l2Index); } UINT32 OsVmPhySegPagesGet(LosVmPhysSeg *seg) @@ -505,7 +505,7 @@ VOID OsVmPhysDump(VOID) PRINTK("\r\n phys_seg base size free_pages \n"); PRINTK(" -------- ------- ---------- --------- \n"); #endif - PRINTK(" 0x%08x 0x%08x 0x%08x %8u \n", seg, seg->start, seg->size, segFreePages); + PRINTK(" 0x%08x 0x%08x 0x%08x %8u \n", (UINTPTR)seg, seg->start, seg->size, segFreePages); totalFreePages += segFreePages; totalPages += (seg->size >> PAGE_SHIFT); diff --git a/kernel/base/vm/los_vm_phys.c b/kernel/base/vm/los_vm_phys.c index 852a6ccd1f1a58bf3751696b7c9b4d4960f4c26e..5623d431003677bc3829a0ad73a01132eb3d0c6d 100644 --- a/kernel/base/vm/los_vm_phys.c +++ b/kernel/base/vm/los_vm_phys.c @@ -163,7 +163,7 @@ STATIC VOID OsVmPhysFreeListAdd(LosVmPage *page, UINT8 order) struct VmFreeList *list = NULL; if (page->segID >= VM_PHYS_SEG_MAX) { - LOS_Panic("The page segment id(%d) is invalid\n", page->segID); + LOS_Panic("The page segment id(%u) is invalid\n", page->segID); } page->order = order; @@ -180,7 +180,7 @@ STATIC VOID OsVmPhysFreeListAddUnsafe(LosVmPage *page, UINT8 order) struct VmFreeList *list = NULL; if (page->segID >= VM_PHYS_SEG_MAX) { - LOS_Panic("The page segment id(%d) is invalid\n", page->segID); + LOS_Panic("The page segment id(%u) is invalid\n", page->segID); } page->order = order; @@ -242,7 +242,7 @@ LosVmPage *OsVmPhysToPage(paddr_t pa, UINT8 segID) paddr_t offset; if (segID >= VM_PHYS_SEG_MAX) { - LOS_Panic("The page segment id(%d) is invalid\n", segID); + LOS_Panic("The page segment id(%u) is invalid\n", segID); } seg = &g_vmPhysSeg[segID]; if ((pa < seg->start) || (pa >= (seg->start + seg->size))) { diff --git a/kernel/base/vm/los_vm_syscall.c b/kernel/base/vm/los_vm_syscall.c index 2b2ac2953059a2f05d07b0ffca1f62bd39071976..45638c125270eca3fef172a81884e882675d52fb 100644 --- a/kernel/base/vm/los_vm_syscall.c +++ b/kernel/base/vm/los_vm_syscall.c @@ -220,7 +220,7 @@ VOID *LOS_DoBrk(VOID *addr) size = (UINTPTR)addr - (UINTPTR)space->heapBase; size = ROUNDUP(size, PAGE_SIZE); alignAddr = (CHAR *)(UINTPTR)(space->heapBase) + size; - PRINT_INFO("brk addr %p , size 0x%x, alignAddr %p, align %d\n", addr, size, alignAddr, PAGE_SIZE); + PRINT_INFO("brk addr %p , size 0x%x, alignAddr %p, align %u\n", addr, size, alignAddr, PAGE_SIZE); (VOID)LOS_MuxAcquire(&space->regionMux); if (addr < (VOID *)(UINTPTR)space->heapNow) { diff --git a/kernel/base/vm/oom.c b/kernel/base/vm/oom.c index 176429d52c5721a712fb335ff824ea322d463bd7..fa9047b0b822f3e9961c27e13c180d509b0df92f 100644 --- a/kernel/base/vm/oom.c +++ b/kernel/base/vm/oom.c @@ -210,10 +210,10 @@ LITE_OS_SEC_TEXT_MINOR VOID OomSetCheckInterval(UINT32 checkInterval) { if ((checkInterval >= OOM_CHECK_MIN) && (checkInterval <= OOM_CHECK_MAX)) { g_oomCB->checkInterval = checkInterval; - PRINTK("[oom] set oom check interval (%d)ms successful\n", + PRINTK("[oom] set oom check interval (%u)ms successful\n", g_oomCB->checkInterval); } else { - PRINTK("[oom] set oom check interval (%d)ms failed, should be in [%d, %d]\n", + PRINTK("[oom] set oom check interval (%u)ms failed, should be in [%d, %d]\n", g_oomCB->checkInterval, OOM_CHECK_MIN, OOM_CHECK_MAX); } } diff --git a/kernel/common/rootfs/los_bootargs.c b/kernel/common/rootfs/los_bootargs.c index 3f54115c07c6da6ceba6fc731b9469373ebc1ab2..736081e2e5c24866ebf02b8ff07cba752cd79236 100644 --- a/kernel/common/rootfs/los_bootargs.c +++ b/kernel/common/rootfs/los_bootargs.c @@ -214,7 +214,7 @@ UINT64 LOS_SizeStrToNum(CHAR *value) UINT64 num = 0; /* If the string is a hexadecimal value */ - if (sscanf_s(value, "0x%x", &num) > 0) { + if (sscanf_s(value, "0x%x", (UINTPTR)(&num)) > 0) { value += strlen("0x"); if (strspn(value, "0123456789abcdefABCDEF") < strlen(value)) { goto ERROUT; @@ -223,7 +223,7 @@ UINT64 LOS_SizeStrToNum(CHAR *value) } /* If the string is a decimal value in unit *Bytes */ - INT32 ret = sscanf_s(value, "%d", &num); + INT32 ret = sscanf_s(value, "%llu", &num); INT32 decOffset = strspn(value, "0123456789"); CHAR *endPos = value + decOffset; if ((ret <= 0) || (decOffset < (strlen(value) - 1))) { diff --git a/kernel/extended/dynload/src/los_load_elf.c b/kernel/extended/dynload/src/los_load_elf.c index dcd5d29186dc7bb517144a6f6a146830a450a71d..2ebbd1d5ddc00019873895b45a869138e39f3ce9 100644 --- a/kernel/extended/dynload/src/los_load_elf.c +++ b/kernel/extended/dynload/src/los_load_elf.c @@ -424,7 +424,7 @@ INT32 OsGetKernelVaddr(const LosVmSpace *space, VADDR_T vaddr, VADDR_T *kvaddr) PADDR_T paddr = 0; if ((space == NULL) || (vaddr == 0) || (kvaddr == NULL)) { - PRINT_ERR("%s[%d], space: %#x, vaddr: %#x\n", __FUNCTION__, __LINE__, space, vaddr); + PRINT_ERR("%s[%d], space: %#x, vaddr: %#x\n", __FUNCTION__, __LINE__, (UINTPTR)space, vaddr); return LOS_NOK; } @@ -573,7 +573,7 @@ STATIC CHAR *OsGetParamPtr(CHAR * const *ptr, INT32 index) } ret = LOS_GetUser(&userStrPtr, (UINTPTR *)(ptr + index)); if (ret != LOS_OK) { - PRINT_ERR("%s[%d], %#x\n", __FUNCTION__, __LINE__, ptr); + PRINT_ERR("%s[%d], %#x\n", __FUNCTION__, __LINE__, (UINTPTR)ptr); return NULL; } @@ -868,7 +868,7 @@ STATIC INT32 OsPutParamToStack(ELFLoadInfo *loadInfo, const UINTPTR *auxVecInfo, size = LOS_ArchCopyToUser(argsPtr, auxVecInfo, vecIndex * sizeof(UINTPTR)); if (size != 0) { - PRINT_ERR("%s[%d], Failed to copy strings! Bytes not copied: %d\n", __FUNCTION__, __LINE__, size); + PRINT_ERR("%s[%d], Failed to copy strings! Bytes not copied: %u\n", __FUNCTION__, __LINE__, size); return -EFAULT; } diff --git a/kernel/extended/liteipc/hm_liteipc.c b/kernel/extended/liteipc/hm_liteipc.c index 55aaac51fa6d1ab05c3211c784d8f53b4e46c795..6142fcbf1bdaa5beda2dd4ad0ed2161b42aa1b74 100644 --- a/kernel/extended/liteipc/hm_liteipc.c +++ b/kernel/extended/liteipc/hm_liteipc.c @@ -111,7 +111,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsLiteIpcInit(VOID) } ret = (UINT32)register_driver(LITEIPC_DRIVER, &g_liteIpcFops, LITEIPC_DRIVER_MODE, NULL); if (ret != LOS_OK) { - PRINT_ERR("register lite_ipc driver failed:%d\n", ret); + PRINT_ERR("register lite_ipc driver failed:%u\n", ret); } LOS_ListInit(&(g_ipcPendlist)); for (i = 0; i < LOSCFG_BASE_CORE_PROCESS_LIMIT; i++) { @@ -294,15 +294,15 @@ LITE_OS_SEC_TEXT STATIC VOID EnableIpcNodeFreeByUser(UINT32 processID, VOID *buf LITE_OS_SEC_TEXT STATIC VOID *LiteIpcNodeAlloc(UINT32 processID, UINT32 size) { VOID *ptr = LOS_MemAlloc(OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, size); - PRINT_INFO("LiteIpcNodeAlloc pid:%d, pool:%x buf:%x size:%d\n", - processID, OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, ptr, size); + PRINT_INFO("LiteIpcNodeAlloc pid:%u, pool:%x buf:%x size:%u\n", + processID, (UINTPTR)OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, (UINTPTR)ptr, size); return ptr; } LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcNodeFree(UINT32 processID, VOID *buf) { - PRINT_INFO("LiteIpcNodeFree pid:%d, pool:%x buf:%x\n", - processID, OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, buf); + PRINT_INFO("LiteIpcNodeFree pid:%u, pool:%x buf:%x\n", + processID, (UINTPTR)OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, (UINTPTR)buf); return LOS_MemFree(OS_PCB_FROM_PID(processID)->ipcInfo.pool.kvaddr, buf); } @@ -454,7 +454,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 SetIpcTask(VOID) OsCurrProcessGet()->ipcInfo.ipcTaskID = LOS_CurTaskIDGet(); return OsCurrProcessGet()->ipcInfo.ipcTaskID; } - PRINT_ERR("curprocess %d IpcTask already set!\n", OsCurrProcessGet()->processID); + PRINT_ERR("curprocess %u IpcTask already set!\n", OsCurrProcessGet()->processID); return -EINVAL; } @@ -811,7 +811,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CopyDataFromUser(IpcListNode *node, UINT32 bufSz, node->msg.offsets = (VOID *)((UINTPTR)node + sizeof(IpcListNode) + msg->dataSz); ret = copy_from_user((VOID *)(node->msg.offsets), msg->offsets, msg->spObjNum * sizeof(UINT32)); if (ret != LOS_OK) { - PRINT_DEBUG("%s, %d, %x, %x, %d\n", __FUNCTION__, __LINE__, node->msg.offsets, msg->offsets, msg->spObjNum); + PRINT_DEBUG("%s, %d, %x, %x, %u\n", __FUNCTION__, __LINE__, (UINTPTR)node->msg.offsets, (UINTPTR)msg->offsets, msg->spObjNum); return ret; } } else { @@ -898,7 +898,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 CheckPara(IpcContent *content, UINT32 *dstTid) #endif OsHookCall(LOS_HOOK_TYPE_IPC_WRITE_DROP, msg, *dstTid, (*dstTid == INVAILD_ID) ? INVAILD_ID : OS_TCB_FROM_TID(*dstTid)->processID, 0); - PRINT_ERR("A timeout reply, request timestamp:%lld, now:%lld\n", msg->timestamp, now); + PRINT_ERR("A timeout reply, request timestamp:%llu, now:%llu\n", msg->timestamp, now); return -ETIME; } #endif @@ -1090,7 +1090,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcMsgHandle(IpcContent *con) if ((content->flag & BUFF_FREE) == BUFF_FREE) { ret = CheckUsedBuffer(content->buffToFree, &nodeNeedFree); if (ret != LOS_OK) { - PRINT_ERR("CheckUsedBuffer failed:%d\n", ret); + PRINT_ERR("CheckUsedBuffer failed:%u\n", ret); return ret; } } @@ -1136,7 +1136,7 @@ BUFFER_FREE: UINT32 offset = LOS_OFF_SET_OF(IpcContent, inMsg); ret = copy_to_user((char*)con + offset, (char*)content + offset, sizeof(IpcMsg *)); if (ret != LOS_OK) { - PRINT_ERR("%s, %d, %d\n", __FUNCTION__, __LINE__, ret); + PRINT_ERR("%s, %d, %u\n", __FUNCTION__, __LINE__, ret); return -EINVAL; } } diff --git a/platform/los_hilog.c b/platform/los_hilog.c index 4185aaab2f52eadab843fb3248b1a717b337ad59..0e373fc5a45512be935f8d60fe661c779bdc5de4 100644 --- a/platform/los_hilog.c +++ b/platform/los_hilog.c @@ -179,7 +179,7 @@ static ssize_t HiLogRead(struct file *filep, char *buffer, size_t bufLen) } if (bufLen < header.len + sizeof(header)) { - dprintf("buffer too small,bufLen=%d, header.len=%d,%d\n", bufLen, header.len, header.hdrSize); + dprintf("buffer too small,bufLen=%u, header.len=%u,%u\n", bufLen, header.len, header.hdrSize); retval = -ENOMEM; goto out; } diff --git a/syscall/los_syscall.c b/syscall/los_syscall.c index 6761fff79413925ea5d3f3f544938e028e611e45..a0bc1c0e27add26b1e0f9ee7e82af6d860bb9181 100644 --- a/syscall/los_syscall.c +++ b/syscall/los_syscall.c @@ -104,7 +104,7 @@ VOID OsArmA32SyscallHandle(TaskContext *regs) UINT32 cmd = regs->reserved2; if (cmd >= SYS_CALL_NUM) { - PRINT_ERR("Syscall ID: error %d !!!\n", cmd); + PRINT_ERR("Syscall ID: error %u !!!\n", cmd); return; } @@ -112,7 +112,7 @@ VOID OsArmA32SyscallHandle(TaskContext *regs) nArgs = g_syscallNArgs[cmd / NARG_PER_BYTE]; /* 4bit per nargs */ nArgs = (cmd & 1) ? (nArgs >> NARG_BITS) : (nArgs & NARG_MASK); if ((handle == 0) || (nArgs > ARG_NUM_7)) { - PRINT_ERR("Unsupport syscall ID: %d nArgs: %d\n", cmd, nArgs); + PRINT_ERR("Unsupport syscall ID: %u nArgs: %u\n", cmd, nArgs); regs->R0 = -ENOSYS; return; }