!508 fix: modify the review problem of osal

Merge pull request !508 from Zhang/master
This commit is contained in:
openharmony_ci
2022-03-24 06:58:35 +00:00
committed by Gitee
9 changed files with 15 additions and 15 deletions
+1 -1
View File
@@ -127,7 +127,7 @@ int32_t OsalReadFirmware(struct OsalFirmware *fwPara, struct OsalFwBlock *block)
}
fw = (struct OsalFwDesc *)fwPara->para;
if (fw->openFlag == false) {
if (!fw->openFlag) {
HDF_LOGE("%s file do not open", __func__);
return HDF_ERR_INVALID_PARAM;
}
+3 -3
View File
@@ -174,7 +174,7 @@ int32_t OsalThreadSuspend(struct OsalThread *thread)
bool flag = false;
flag = OsalCheckPara(thread);
if (flag == false) {
if (!flag) {
HDF_LOGE("%s invalid parameter %d\n", __func__, __LINE__);
return HDF_ERR_INVALID_PARAM;
}
@@ -193,7 +193,7 @@ int32_t OsalThreadDestroy(struct OsalThread *thread)
bool flag = false;
flag = OsalCheckPara(thread);
if (flag == false) {
if (!flag) {
HDF_LOGE("%s invalid parameter %d\n", __func__, __LINE__);
return HDF_ERR_INVALID_PARAM;
}
@@ -210,7 +210,7 @@ int32_t OsalThreadResume(struct OsalThread *thread)
bool flag = false;
flag = OsalCheckPara(thread);
if (flag == false) {
if (!flag) {
HDF_LOGE("%s invalid parameter %d\n", __func__, __LINE__);
return HDF_ERR_INVALID_PARAM;
}
+1 -1
View File
@@ -170,7 +170,7 @@ bool HdfAddWork(HdfWorkQueue *queue, HdfWork *work)
return queue_work(queue->realWorkQueue, &((struct WorkWrapper *)work->realWork)->work.work);
}
bool HdfAddDelayedWork(HdfWorkQueue *queue, HdfWork *work, unsigned long ms)
bool HdfAddDelayedWork(HdfWorkQueue *queue, HdfWork *work, uint32_t ms)
{
if (queue == NULL || queue->realWorkQueue == NULL || work == NULL || work->realWork == NULL) {
HDF_LOGE("%s invalid para", __func__);
+3 -3
View File
@@ -167,7 +167,7 @@ int32_t OsalThreadSuspend(struct OsalThread *thread)
bool flag = false;
flag = OsalCheckPara(thread);
if (flag == false) {
if (!flag) {
HDF_LOGE("%s invalid parameter %d", __func__, __LINE__);
return HDF_ERR_INVALID_PARAM;
}
@@ -186,7 +186,7 @@ int32_t OsalThreadDestroy(struct OsalThread *thread)
bool flag = false;
flag = OsalCheckPara(thread);
if (flag == false) {
if (!flag) {
HDF_LOGE("%s invalid parameter %d", __func__, __LINE__);
return HDF_ERR_INVALID_PARAM;
}
@@ -203,7 +203,7 @@ int32_t OsalThreadResume(struct OsalThread *thread)
bool flag = false;
flag = OsalCheckPara(thread);
if (flag == false) {
if (!flag) {
HDF_LOGE("%s invalid parameter %d", __func__, __LINE__);
return HDF_ERR_INVALID_PARAM;
}
@@ -202,7 +202,7 @@ static void HdfRegPnpDriverTest_005()
struct HdfRemoteService *remote = HdfRemoteServiceGet("pnp_driver_service_1");
UT_TEST_CHECK_RET(remote == NULL);
if (ret == HDF_SUCCESS) {
HdfUnRegPnpDevice("libpnp_driver1.so", "pnp_driver_service1");
(void)HdfUnRegPnpDevice("libpnp_driver1.so", "pnp_driver_service1");
}
}
@@ -230,7 +230,7 @@ static void HdfRegPnpDriverTest_006()
uint64_t timeAfter = OsalGetSysTimeMs();
totalTime += timeAfter - timeBefor;
}
printf("total time is %ld \n", totalTime);
printf("total time is %lu \n", totalTime);
UT_TEST_CHECK_RET((totalTime / 1000) < 20);
}
@@ -77,7 +77,7 @@ void PrintTestResult()
static void CalcAverageTime(int index, bool type, const OsalTimespec *diff, const char *func, int line)
{
if (type == true) {
if (type) {
HDF_LOGD("[HDF_TEST] %{public}s line:%{public}d test 1 time use time:%{public}lu s %{public}lu us",
func, line, diff->sec, diff->usec);
printf("[HDF_TEST] %s line:%d test 1 time use time:%lu s %lu us\r\n", func, line, diff->sec, diff->usec);
+2 -2
View File
@@ -52,12 +52,12 @@ int DevFillQueryDeviceInfo(struct IDevmgrService *inst, struct HdfSBuf *data, st
if ((deviceInfo->policy == SERVICE_POLICY_CAPACITY || deviceInfo->policy == SERVICE_POLICY_PUBLIC) &&
deviceInfo->status == status) {
flag = HdfSbufWriteString(reply, deviceInfo->svcName);
if (flag == false) {
if (!flag) {
HDF_LOGE("%{public}s writing string failed %{public}s", __func__, deviceInfo->svcName);
return HDF_FAILURE;
}
flag = HdfSbufWriteInt32(reply, deviceInfo->deviceType);
if (flag == false) {
if (!flag) {
HDF_LOGE("%{public}s writing int32 failed %{public}d", __func__, deviceInfo->deviceType);
return HDF_FAILURE;
}
+1 -1
View File
@@ -264,7 +264,7 @@ int DevmgrServiceStubStartService(struct IDevmgrService *inst)
}
fullService->remote = remoteService;
DriverModuleLoadHelperInit();
(void)DriverModuleLoadHelperInit();
return DevmgrServiceStartService((struct IDevmgrService *)&fullService->super);
}
+1 -1
View File
@@ -115,7 +115,7 @@ static int OnKEventReceived(
}
if (receivedEvent->syncToken != 0) {
FinishEvent(service, receivedEvent);
(void)FinishEvent(service, receivedEvent);
}
OsalMutexUnlock(&notifier->mutex);