From: duna.oh Date: Fri, 2 Sep 2022 07:46:52 +0000 (+0900) Subject: input: clean up devicemgr related code X-Git-Tag: accepted/tizen/7.0/unified/20221110.062328~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F89%2F280689%2F1;p=platform%2Fcore%2Fuifw%2Fheadless-server.git input: clean up devicemgr related code Change-Id: Ia8f04b19f3d41a7dc476201b1525a2377767f032 --- diff --git a/src/input/input.c b/src/input/input.c index 638c5f7..bdc8a3f 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -349,16 +349,14 @@ devicemgr_add_keymap_data(struct wl_list *list, const char *name, int keycode) } static void -devicemgr_remove_keymap_data(struct wl_list *list, int keycode) +devicemgr_cleanup_keymap_list(struct wl_list *list) { struct ds_tizen_input_devicemgr_keymap_data *data, *tmp; wl_list_for_each_safe(data, tmp, list, link) { - if (data->keycode == keycode) { - wl_list_remove(&data->link); - free(data->name); - free(data); - } + wl_list_remove(&data->link); + free(data->name); + free(data); } } @@ -383,8 +381,5 @@ devicemgr_set_keymap(struct ds_tizen_input_devicemgr *devicemgr) if (!res) ds_inf("Failed to set keymap"); - devicemgr_remove_keymap_data(&keymap_list, KEYCODE_XF86_VOLUME_RAISE); - devicemgr_remove_keymap_data(&keymap_list, KEYCODE_XF86_VOLUME_LOWER); - devicemgr_remove_keymap_data(&keymap_list, KEYCODE_XF86_LIGHT_ON); - devicemgr_remove_keymap_data(&keymap_list, KEYCODE_XF86_LIGHT_OFF); + devicemgr_cleanup_keymap_list(&keymap_list); }