From a5a425c2bcf88a632fd9f346036581a444dfd4c8 Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Sat, 18 Sep 2021 07:46:00 +0000 Subject: [PATCH] fix input codex warning Signed-off-by: YOUR_NAME --- model/input/driver/event_hub.c | 5 +++-- model/input/driver/hdf_hid_adapter.c | 7 ------- model/input/driver/hdf_input_device_manager.c | 1 - model/input/driver/hdf_input_device_manager.h | 1 - model/input/driver/hdf_touch.c | 6 ------ 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/model/input/driver/event_hub.c b/model/input/driver/event_hub.c index 3055b95e1..8fd323369 100644 --- a/model/input/driver/event_hub.c +++ b/model/input/driver/event_hub.c @@ -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); } \ No newline at end of file diff --git a/model/input/driver/hdf_hid_adapter.c b/model/input/driver/hdf_hid_adapter.c index 3ebda661b..3b2842822 100644 --- a/model/input/driver/hdf_hid_adapter.c +++ b/model/input/driver/hdf_hid_adapter.c @@ -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); diff --git a/model/input/driver/hdf_input_device_manager.c b/model/input/driver/hdf_input_device_manager.c index 9be0cce56..c9fcaa95a 100644 --- a/model/input/driver/hdf_input_device_manager.c +++ b/model/input/driver/hdf_input_device_manager.c @@ -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); diff --git a/model/input/driver/hdf_input_device_manager.h b/model/input/driver/hdf_input_device_manager.h index 98d247d88..35f454548 100644 --- a/model/input/driver/hdf_input_device_manager.h +++ b/model/input/driver/hdf_input_device_manager.h @@ -112,7 +112,6 @@ typedef struct InputDeviceInfo { void *pvtData; DevAttr attrSet; DevAbility abilitySet; - struct OsalMutex mutex; struct InputDeviceInfo *next; } InputDevice; diff --git a/model/input/driver/hdf_touch.c b/model/input/driver/hdf_touch.c index 9a1264e39..9f67dea50 100644 --- a/model/input/driver/hdf_touch.c +++ b/model/input/driver/hdf_touch.c @@ -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; } -- Gitee