From 8be861b876f9b2036534537fd378645812b4069e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 16 Jan 2020 19:08:10 +0100 Subject: [PATCH] synaptics: Remove unneeded complete error/data parameters Remove the never-used cmd_complete_data value and the repetition of cmd_complete_error. In fact now as per the fpi_device_verify_report() usage, we already pass the match information to the device, such as the error and it will be they will be used on completion if needed. This allows to simplify cmd_ssm_done() as well. --- libfprint/drivers/synaptics/synaptics.c | 17 +++-------------- libfprint/drivers/synaptics/synaptics.h | 2 -- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/libfprint/drivers/synaptics/synaptics.c b/libfprint/drivers/synaptics/synaptics.c index e216985..46641a3 100644 --- a/libfprint/drivers/synaptics/synaptics.c +++ b/libfprint/drivers/synaptics/synaptics.c @@ -279,17 +279,10 @@ cmd_ssm_done (FpiSsm *ssm, FpDevice *dev, GError *error) self->cmd_ssm = NULL; /* Notify about the SSM failure from here instead. */ - if (error) - { - callback (self, NULL, error); - } - else if (self->cmd_complete_on_removal) - { - callback (self, NULL, self->cmd_complete_error); - self->cmd_complete_error = NULL; - } + if (error || self->cmd_complete_on_removal) + callback (self, NULL, error); + self->cmd_complete_on_removal = FALSE; - g_clear_pointer (&self->cmd_complete_error, g_error_free); } static void @@ -621,8 +614,6 @@ verify_msg_cb (FpiDeviceSynaptics *self, { fp_dbg ("delaying retry error until after finger removal!"); self->cmd_complete_on_removal = TRUE; - self->cmd_complete_data = GINT_TO_POINTER (FPI_MATCH_ERROR); - self->cmd_complete_error = fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL); fpi_device_verify_report (device, FPI_MATCH_ERROR, NULL, fpi_device_retry_new (FP_DEVICE_RETRY_GENERAL)); } @@ -630,8 +621,6 @@ verify_msg_cb (FpiDeviceSynaptics *self, { fp_dbg ("delaying match failure until after finger removal!"); self->cmd_complete_on_removal = TRUE; - self->cmd_complete_data = GINT_TO_POINTER (FPI_MATCH_FAIL); - self->cmd_complete_error = NULL; fpi_device_verify_report (device, FPI_MATCH_FAIL, NULL, NULL); } else if (resp->result == BMKT_FP_DATABASE_NO_RECORD_EXISTS) diff --git a/libfprint/drivers/synaptics/synaptics.h b/libfprint/drivers/synaptics/synaptics.h index 37eb362..ac50171 100644 --- a/libfprint/drivers/synaptics/synaptics.h +++ b/libfprint/drivers/synaptics/synaptics.h @@ -110,8 +110,6 @@ struct _FpiDeviceSynaptics FpiSsm *cmd_ssm; FpiUsbTransfer *cmd_pending_transfer; gboolean cmd_complete_on_removal; - GError *cmd_complete_error; - void *cmd_complete_data; bmkt_sensor_version_t mis_version;