fix input codex warning

Signed-off-by: YOUR_NAME <guowen24@huawei.com>
This commit is contained in:
YOUR_NAME
2021-09-18 07:46:00 +00:00
parent ed13ab80e1
commit a5a425c2bc
5 changed files with 3 additions and 17 deletions
+3 -2
View File
@@ -26,12 +26,13 @@ void PushOnePackage(InputDevice *inputDev, uint32_t type, uint32_t code, int32_t
{
OsalTimespec time;
EventPackage package = {0};
InputManager *g_inputManager = GetInputManager();
if (inputDev == NULL) {
HDF_LOGE("%s: parm is null", __func__);
return;
}
OsalMutexLock(&inputDev->mutex);
OsalMutexLock(&g_inputManager->mutex);
package.type = type;
package.code = code;
package.value = value;
@@ -65,5 +66,5 @@ void PushOnePackage(InputDevice *inputDev, uint32_t type, uint32_t code, int32_t
HdfSbufFlush(inputDev->pkgBuf);
inputDev->errFrameFlag = false;
}
OsalMutexUnlock(&inputDev->mutex);
OsalMutexUnlock(&g_inputManager->mutex);
}
-7
View File
@@ -188,13 +188,6 @@ static InputDevice* HidConstructInputDev(HidInfo *info)
}
(void)memset_s(inputDev, sizeof(InputDevice), 0, sizeof(InputDevice));
int32_t ret = OsalMutexInit(&inputDev->mutex);
if (ret != HDF_SUCCESS) {
HDF_LOGE("%s: Init mutex error", __func__);
OsalMemFree(inputDev);
return NULL;
}
inputDev->devType = info->devType;
inputDev->devName = info->devName;
SetInputDevAbility(inputDev);
@@ -344,7 +344,6 @@ void UnregisterInputDevice(InputDevice *inputDev)
}
HdfSBufRecycle(inputDev->eventBuf);
inputDev->eventBuf = NULL;
OsalMutexDestroy(&inputDev->mutex);
OsalMemFree(inputDev);
OsalMutexUnlock(&g_inputManager->mutex);
HDF_LOGI("%s: exit succ, devCount is %d", __func__, g_inputManager->devCount);
@@ -112,7 +112,6 @@ typedef struct InputDeviceInfo {
void *pvtData;
DevAttr attrSet;
DevAbility abilitySet;
struct OsalMutex mutex;
struct InputDeviceInfo *next;
} InputDevice;
-6
View File
@@ -294,12 +294,6 @@ static InputDevice *InputDeviceInstance(ChipDevice *chipDev)
inputDev->devType = chipDev->driver->boardCfg->attr.devType;
inputDev->devName = chipDev->driver->devName;
int32_t ret = OsalMutexInit(&inputDev->mutex);
if (ret != HDF_SUCCESS) {
HDF_LOGE("%s: Init mutex error", __func__);
OsalMemFree(inputDev);
return NULL;
}
return inputDev;
}