From d2afdde8b3566dec0209a1d31667b730ee37e548 Mon Sep 17 00:00:00 2001 From: chen Date: Tue, 19 Apr 2022 18:54:47 +0800 Subject: [PATCH 1/2] codex fix Signed-off-by: chen Change-Id: I76f9ee3f4d9f1e70a16b7f90eebcd742b6a23350 --- samgr/source/samgr_lite.c | 4 ++-- samgr/source/task_manager.c | 4 ++-- samgr_endpoint/source/endpoint.c | 4 ++-- samgr_server/source/samgr_server.c | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/samgr/source/samgr_lite.c b/samgr/source/samgr_lite.c index 39d6074..7eb537a 100755 --- a/samgr/source/samgr_lite.c +++ b/samgr/source/samgr_lite.c @@ -473,7 +473,7 @@ static void AddTaskPool(ServiceImpl *service, TaskConfig *cfg, const char *name) } if (service->taskPool == NULL) { - HILOG_ERROR(HILOG_MODULE_SAMGR, "Service create taskPool failed!", name, cfg->taskFlags); + HILOG_ERROR(HILOG_MODULE_SAMGR, "Service create taskPool failed!", name, cfg->taskFlags); } } @@ -507,7 +507,7 @@ static void HandleInitRequest(const Request *request, const Response *response) { ServiceImpl *serviceImpl = (ServiceImpl *)request->data; if (serviceImpl == NULL) { - HILOG_ERROR(HILOG_MODULE_SAMGR, "Init service Request:<%d,%d>, Response:<%d>!", + HILOG_ERROR(HILOG_MODULE_SAMGR, "Init service Request:<%d,%u>, Response:<%d>!", request->msgId, request->msgValue, response->len); return; } diff --git a/samgr/source/task_manager.c b/samgr/source/task_manager.c index e72f35e..9d1940e 100755 --- a/samgr/source/task_manager.c +++ b/samgr/source/task_manager.c @@ -51,7 +51,7 @@ TaskPool *SAMGR_CreateFixedTaskPool(const TaskConfig *config, const char *name, TaskPool *taskPool = (TaskPool *)SAMGR_Malloc(sizeof(TaskPool) + sizeof(ThreadId) * size); if (taskPool == NULL) { - HILOG_ERROR(HILOG_MODULE_SAMGR, "Create TaskPool<%s> size:%d failed!", name, config->queueSize); + HILOG_ERROR(HILOG_MODULE_SAMGR, "Create TaskPool<%s> size:%hhu failed!", name, config->queueSize); QUEUE_Destroy(queueId); return NULL; } @@ -81,7 +81,7 @@ int32 SAMGR_StartTaskPool(TaskPool *pool, const char *name) while (pool->top < pool->size) { register ThreadId threadId = (ThreadId)THREAD_Create(TaskEntry, pool->queueId, &attr); if (threadId == NULL) { - HILOG_ERROR(HILOG_MODULE_SAMGR, "Start Task<%s, %d, %d> failed!", name, pool->stackSize, pool->priority); + HILOG_ERROR(HILOG_MODULE_SAMGR, "Start Task<%s, %hu, %hhu> failed!", name, pool->stackSize, pool->priority); break; } pool->tasks[pool->top] = threadId; diff --git a/samgr_endpoint/source/endpoint.c b/samgr_endpoint/source/endpoint.c index 1a3472c..b9af601 100755 --- a/samgr_endpoint/source/endpoint.c +++ b/samgr_endpoint/source/endpoint.c @@ -214,7 +214,7 @@ static int SendGetAllSysCapsRequest(const Endpoint *endpoint, uint32 startIdx, I SvcIdentity samgr = {SAMGR_HANDLE, SAMGR_TOKEN, SAMGR_COOKIE}; int ret = Transact(endpoint->context, samgr, INVALID_INDEX, &req, reply, LITEIPC_FLAG_DEFAULT, (uintptr_t *)replyBuf); - HILOG_DEBUG(HILOG_MODULE_SAMGR, "SendGetAllSysCapsRequest startIdx:%d, ret:%d!", startIdx, ret); + HILOG_DEBUG(HILOG_MODULE_SAMGR, "SendGetAllSysCapsRequest startIdx:%u, ret:%d!", startIdx, ret); return -ret; } @@ -452,7 +452,7 @@ static void HandleIpc(const Request *request, const Response *response) if ((strcmp(router->saName.service, SAMGR_SERVICE) != 0) && !JudgePolicy(uid, (const PolicyTrans *)(router->policy), router->policyNum)) { FreeBuffer(endpoint->context, ipcMsg); - HILOG_ERROR(HILOG_MODULE_SAMGR, "Consumer uid<%d> has no permission to access<%s, %d, %d>!", + HILOG_ERROR(HILOG_MODULE_SAMGR, "Consumer uid<%u> has no permission to access<%s, %d, %d>!", uid, router->saName.service, router->identity.serviceId, router->identity.featureId); return; } diff --git a/samgr_server/source/samgr_server.c b/samgr_server/source/samgr_server.c index 51d65d3..650bcfe 100755 --- a/samgr_server/source/samgr_server.c +++ b/samgr_server/source/samgr_server.c @@ -191,7 +191,7 @@ static int ProcEndpoint(SamgrServer *server, int32 option, void *origin, IpcIo * } MUTEX_Unlock(server->mtx); IpcIoPushUint32(reply, handle.handle); - HILOG_INFO(HILOG_MODULE_SAMGR, "Register Endpoint<%d, %d, %d>", handle.pid, handle.handle, handle.deadId); + HILOG_INFO(HILOG_MODULE_SAMGR, "Register Endpoint<%d, %u, %u>", handle.pid, handle.handle, handle.deadId); return EC_SUCCESS; } @@ -239,7 +239,7 @@ static int32 ProcPutFeature(SamgrServer *server, const void *origin, IpcIo *req, ret = SASTORA_Save(&server->store, service, feature, identity); MUTEX_Unlock(server->mtx); - HILOG_DEBUG(HILOG_MODULE_SAMGR, "Register Feature<%s, %s> pid<%d>, id<%d, %d> ret:%d", + HILOG_DEBUG(HILOG_MODULE_SAMGR, "Register Feature<%s, %s> pid<%d>, id<%u, %u> ret:%d", service, feature, pid, identity->handle, identity->token, ret); TransmitPolicy(ret, identity, reply, policy, policyNum); SAMGR_Free(policy); @@ -304,7 +304,7 @@ static int32 ProcGetFeature(SamgrServer *server, const void *origin, IpcIo *req, *identity = SASTORA_Find(&server->store, service, feature); if (identity->handle == INVALID_INDEX) { MUTEX_Unlock(server->mtx); - HILOG_DEBUG(HILOG_MODULE_SAMGR, "Cannot Find Feature<%s, %s> id<%d, %d> ret:%d", + HILOG_DEBUG(HILOG_MODULE_SAMGR, "Cannot Find Feature<%s, %s> id<%u, %u> ret:%d", service, feature, identity->handle, identity->token, EC_NOSERVICE); return EC_NOSERVICE; } @@ -450,7 +450,7 @@ void ProcGetAllSysCap(SamgrServer *server, IpcIo *req, IpcIo *reply) } int32 nextRequestIdx = startIdx; int32 replyNum = GetReplyNumAndNextReqIdx(sysCapablitys, startIdx, &nextRequestIdx); - HILOG_DEBUG(HILOG_MODULE_SAMGR, "ProcGetAllSysCap replyNum: %d, size: %d, startIdx: %d, nextRequestIdx: %d", + HILOG_DEBUG(HILOG_MODULE_SAMGR, "ProcGetAllSysCap replyNum: %d, size: %d, startIdx: %u, nextRequestIdx: %d", replyNum, size, startIdx, nextRequestIdx); IpcIoPushInt32(reply, EC_SUCCESS); // indicate is the last reply -- Gitee From 7b71aee3f8359ace42fc14dcc9c492e052b9adcb Mon Sep 17 00:00:00 2001 From: chen Date: Tue, 19 Apr 2022 11:55:32 +0000 Subject: [PATCH 2/2] update samgr/source/task_manager.c. Signed-off-by: chen --- samgr/source/task_manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samgr/source/task_manager.c b/samgr/source/task_manager.c index 9d1940e..4128bfc 100755 --- a/samgr/source/task_manager.c +++ b/samgr/source/task_manager.c @@ -45,13 +45,13 @@ TaskPool *SAMGR_CreateFixedTaskPool(const TaskConfig *config, const char *name, MQueueId queueId = (MQueueId)QUEUE_Create(name, sizeof(Exchange), config->queueSize); if (queueId == NULL) { - HILOG_ERROR(HILOG_MODULE_SAMGR, "Create Queue<%s> size:%d failed!", name, config->queueSize); + HILOG_ERROR(HILOG_MODULE_SAMGR, "Create Queue<%s> size:%hu failed!", name, config->queueSize); return NULL; } TaskPool *taskPool = (TaskPool *)SAMGR_Malloc(sizeof(TaskPool) + sizeof(ThreadId) * size); if (taskPool == NULL) { - HILOG_ERROR(HILOG_MODULE_SAMGR, "Create TaskPool<%s> size:%hhu failed!", name, config->queueSize); + HILOG_ERROR(HILOG_MODULE_SAMGR, "Create TaskPool<%s> size:%hu failed!", name, config->queueSize); QUEUE_Destroy(queueId); return NULL; } -- Gitee