mirror of
https://github.com/openharmony/drivers_adapter.git
synced 2026-07-20 21:59:19 -04:00
!508 fix: modify the review problem of osal
Merge pull request !508 from Zhang/master
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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__);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ int DevmgrServiceStubStartService(struct IDevmgrService *inst)
|
||||
}
|
||||
fullService->remote = remoteService;
|
||||
|
||||
DriverModuleLoadHelperInit();
|
||||
(void)DriverModuleLoadHelperInit();
|
||||
|
||||
return DevmgrServiceStartService((struct IDevmgrService *)&fullService->super);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ static int OnKEventReceived(
|
||||
}
|
||||
|
||||
if (receivedEvent->syncToken != 0) {
|
||||
FinishEvent(service, receivedEvent);
|
||||
(void)FinishEvent(service, receivedEvent);
|
||||
}
|
||||
|
||||
OsalMutexUnlock(¬ifier->mutex);
|
||||
|
||||
Reference in New Issue
Block a user