fix hilog, vm_syscall etc. typos

This commit is contained in:
laokz 2020-12-06 13:21:22 +08:00
parent f5f823ba99
commit a706de2fad
7 changed files with 18 additions and 17 deletions

View File

@ -71,7 +71,7 @@ STATIC VOID OsSemPendedTaskNamePrint(LosSemCB *semNode)
PRINTK("Pended task list : ");
for (i = 0; i < num; i++) {
if (i == 0) {
PRINTK("%s\n", nameArr[i]);
PRINTK("\n%s", nameArr[i]);
} else {
PRINTK(", %s", nameArr[i]);
}

View File

@ -83,7 +83,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsTaskMemClear(UINT32 taskID)
}
if (g_tskMemUsedInfo[taskID].memUsed != 0) {
PRINT_WARN("mem used of task '%s' is:0x%x, not zero when task being deleted\n",
OsCurrTaskGet()->taskName, g_tskMemUsedInfo[taskID].memUsed);
OS_TCB_FROM_TID(taskID)->taskName, g_tskMemUsedInfo[taskID].memUsed);
}
g_tskMemUsedInfo[taskID].memUsed = 0;
}
@ -123,4 +123,4 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsTaskSlabUsage(UINT32 taskID)
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */
#endif /* __cplusplus */

View File

@ -337,7 +337,7 @@ int OsTryShrinkMemory(size_t nPage)
return nReclaimed;
}
#else
int TryShrinkMemory(size_t nPage)
int OsTryShrinkMemory(size_t nPage)
{
return 0;
}

View File

@ -179,11 +179,15 @@ VOID *LOS_DoBrk(VOID *addr)
if (LOS_UnMMap(newBrk, (oldBrk - newBrk)) < 0) {
return (void *)(UINTPTR)space->heapNow;
}
space->heapNow = (VADDR_T)(UINTPTR)addr;
return addr;
space->heapNow = (VADDR_T)(UINTPTR)alignAddr;
return alignAddr;
}
(VOID)LOS_MuxAcquire(&space->regionMux);
if ((UINTPTR)alignAddr >= space->mapBase) {
VM_ERR("Process heap memory space is insufficient");
return (VOID *)-ENOMEM;
}
if (space->heapBase == space->heapNow) {
region = LOS_RegionAlloc(space, space->heapBase, size,
VM_MAP_REGION_FLAG_PERM_READ | VM_MAP_REGION_FLAG_PERM_WRITE |
@ -197,11 +201,6 @@ VOID *LOS_DoBrk(VOID *addr)
space->heap = region;
}
if ((UINTPTR)alignAddr >= space->mapBase) {
VM_ERR("Process heap memory space is insufficient");
goto REGION_ALLOC_FAILED;
}
space->heapNow = (VADDR_T)(UINTPTR)alignAddr;
space->heap->range.size = size;
ret = (VOID *)(UINTPTR)space->heapNow;

View File

@ -178,7 +178,7 @@ static ssize_t HiLogRead(FAR 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, header.nsec);
dprintf("buffer too small,bufLen=%d, header.len=%d,%d\n", bufLen, header.len, header.hdrSize);
retval = -ENOMEM;
goto out;
}
@ -248,13 +248,14 @@ static void HiLogCoverOldLog(size_t bufLen)
struct HiLogEntry header;
size_t totalSize = bufLen + sizeof(struct HiLogEntry);
while (totalSize + g_hiLogDev.size >= HILOG_BUFFER) {
while (totalSize + g_hiLogDev.size > HILOG_BUFFER) {
retval = HiLogReadRingBuffer((unsigned char *)&header, sizeof(header));
if (retval < 0) {
break;
}
HiLogBufferDec(sizeof(header) + header.len);
HiLogBufferDec(sizeof(header));
HiLogBufferDec(header.len);
}
}

View File

@ -138,6 +138,7 @@ static UINT16 GetFreeVid(VOID)
}
(void)memcpy_s(tmp, mapMaxNum * sizeof(UINT32), idMap->bitMap, (mapMaxNum - 1) * sizeof(UINT32));
LOS_MemFree(m_aucSysMem0, idMap->bitMap);
idMap->bitMap = tmp;
idMap->mapCount = mapMaxNum;
idMap->bitMap[i] = 1;

View File

@ -330,7 +330,7 @@ int SysClockNanoSleep(clockid_t clk, int flags, const struct timespec *req, stru
{
int ret;
struct timespec sreq;
struct timespec srem;
struct timespec srem = {0};
if (!req || LOS_ArchCopyFromUser(&sreq, req, sizeof(struct timespec))) {
errno = EFAULT;
@ -354,7 +354,7 @@ int SysNanoSleep(const struct timespec *rqtp, struct timespec *rmtp)
{
int ret;
struct timespec srqtp;
struct timespec srmtp;
struct timespec srmtp = {0};
if (!rqtp || LOS_ArchCopyFromUser(&srqtp, rqtp, sizeof(struct timespec))) {
errno = EFAULT;
@ -477,7 +477,7 @@ int SysClockNanoSleep64(clockid_t clk, int flags, const struct timespec64 *req,
{
int ret;
struct timespec rq;
struct timespec rm;
struct timespec rm = {0};
struct timespec64 sreq;
struct timespec64 srem;