From 96927801287f50ed883eceda7c3db2819ad1e3ab Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 10 Jun 2014 14:50:56 +0200 Subject: [PATCH] android/hal-hidhost: Use compact syntax for event handlers --- android/hal-hidhost.c | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c index 5787b5eae..ce93af8ce 100644 --- a/android/hal-hidhost.c +++ b/android/hal-hidhost.c @@ -107,36 +107,19 @@ static void handle_virtual_unplug(void *buf, uint16_t len) * index in table equals to 'opcode - HAL_MINIMUM_EVENT' */ static const struct hal_ipc_handler ev_handlers[] = { - { /* HAL_EV_HIDHOST_CONN_STATE */ - .handler = handle_conn_state, - .var_len = false, - .data_len = sizeof(struct hal_ev_hidhost_conn_state) - }, - { /* HAL_EV_HIDHOST_INFO */ - .handler = handle_info, - .var_len = false, - .data_len = sizeof(struct hal_ev_hidhost_info), - }, - { /* HAL_EV_HIDHOST_PROTO_MODE */ - .handler = handle_proto_mode, - .var_len = false, - .data_len = sizeof(struct hal_ev_hidhost_proto_mode), - }, - { /* HAL_EV_HIDHOST_IDLE_TIME */ - .handler = handle_idle_time, - .var_len = false, - .data_len = sizeof(struct hal_ev_hidhost_idle_time), - }, - { /* HAL_EV_HIDHOST_GET_REPORT */ - .handler = handle_get_report, - .var_len = true, - .data_len = sizeof(struct hal_ev_hidhost_get_report), - }, - { /* HAL_EV_HIDHOST_VIRTUAL_UNPLUG */ - .handler = handle_virtual_unplug, - .var_len = false, - .data_len = sizeof(struct hal_ev_hidhost_virtual_unplug), - }, + /* HAL_EV_HIDHOST_CONN_STATE */ + { handle_conn_state, false, sizeof(struct hal_ev_hidhost_conn_state) }, + /* HAL_EV_HIDHOST_INFO */ + { handle_info, false, sizeof(struct hal_ev_hidhost_info) }, + /* HAL_EV_HIDHOST_PROTO_MODE */ + { handle_proto_mode, false, sizeof(struct hal_ev_hidhost_proto_mode) }, + /* HAL_EV_HIDHOST_IDLE_TIME */ + { handle_idle_time, false, sizeof(struct hal_ev_hidhost_idle_time) }, + /* HAL_EV_HIDHOST_GET_REPORT */ + { handle_get_report, true, sizeof(struct hal_ev_hidhost_get_report) }, + /* HAL_EV_HIDHOST_VIRTUAL_UNPLUG */ + { handle_virtual_unplug, false, + sizeof(struct hal_ev_hidhost_virtual_unplug) }, }; static bt_status_t hidhost_connect(bt_bdaddr_t *bd_addr) -- 2.47.3