!40 订正hilog、vm_syscall等文件中的typos

Merge pull request !40 from laokz/hilog
This commit is contained in:
openharmony_ci 2020-12-09 13:20:47 +08:00 committed by Gitee
commit cefcb35aee
7 changed files with 18 additions and 17 deletions

View File

@ -71,7 +71,7 @@ STATIC VOID OsSemPendedTaskNamePrint(LosSemCB *semNode)
PRINTK("Pended task list : "); PRINTK("Pended task list : ");
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
if (i == 0) { if (i == 0) {
PRINTK("%s\n", nameArr[i]); PRINTK("\n%s", nameArr[i]);
} else { } else {
PRINTK(", %s", nameArr[i]); 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) { if (g_tskMemUsedInfo[taskID].memUsed != 0) {
PRINT_WARN("mem used of task '%s' is:0x%x, not zero when task being deleted\n", 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; g_tskMemUsedInfo[taskID].memUsed = 0;
} }

View File

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

View File

@ -179,11 +179,15 @@ VOID *LOS_DoBrk(VOID *addr)
if (LOS_UnMMap(newBrk, (oldBrk - newBrk)) < 0) { if (LOS_UnMMap(newBrk, (oldBrk - newBrk)) < 0) {
return (void *)(UINTPTR)space->heapNow; return (void *)(UINTPTR)space->heapNow;
} }
space->heapNow = (VADDR_T)(UINTPTR)addr; space->heapNow = (VADDR_T)(UINTPTR)alignAddr;
return addr; return alignAddr;
} }
(VOID)LOS_MuxAcquire(&space->regionMux); (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) { if (space->heapBase == space->heapNow) {
region = LOS_RegionAlloc(space, space->heapBase, size, region = LOS_RegionAlloc(space, space->heapBase, size,
VM_MAP_REGION_FLAG_PERM_READ | VM_MAP_REGION_FLAG_PERM_WRITE | VM_MAP_REGION_FLAG_PERM_READ | VM_MAP_REGION_FLAG_PERM_WRITE |
@ -197,11 +201,6 @@ VOID *LOS_DoBrk(VOID *addr)
space->heap = region; 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->heapNow = (VADDR_T)(UINTPTR)alignAddr;
space->heap->range.size = size; space->heap->range.size = size;
ret = (VOID *)(UINTPTR)space->heapNow; 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)) { 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; retval = -ENOMEM;
goto out; goto out;
} }
@ -248,13 +248,14 @@ static void HiLogCoverOldLog(size_t bufLen)
struct HiLogEntry header; struct HiLogEntry header;
size_t totalSize = bufLen + sizeof(struct HiLogEntry); 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)); retval = HiLogReadRingBuffer((unsigned char *)&header, sizeof(header));
if (retval < 0) { if (retval < 0) {
break; 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)); (void)memcpy_s(tmp, mapMaxNum * sizeof(UINT32), idMap->bitMap, (mapMaxNum - 1) * sizeof(UINT32));
LOS_MemFree(m_aucSysMem0, idMap->bitMap);
idMap->bitMap = tmp; idMap->bitMap = tmp;
idMap->mapCount = mapMaxNum; idMap->mapCount = mapMaxNum;
idMap->bitMap[i] = 1; idMap->bitMap[i] = 1;

View File

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