From 7445d62faf24e5c87bda0ccad4af6264be7d726b Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Thu, 3 Jan 2013 10:15:01 -0400 Subject: [PATCH] input: Remove unnecessary encrypt_completed() function Its code is used only once, and can be made much simpler if moved to encrypt_notify(). --- profiles/input/device.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/profiles/input/device.c b/profiles/input/device.c index fc7f8f731..e69d6472c 100644 --- a/profiles/input/device.c +++ b/profiles/input/device.c @@ -271,33 +271,25 @@ static int ioctl_connadd(struct hidp_connadd_req *req) return err; } -static void encrypt_completed(uint8_t status, gpointer user_data) -{ - struct hidp_connadd_req *req = user_data; - int err; - - err = ioctl_connadd(req); - if (err < 0) { - error("ioctl_connadd(): %s(%d)", strerror(-err), -err); - close(req->intr_sock); - close(req->ctrl_sock); - } - - g_free(req->rd_data); - g_free(req); -} - static gboolean encrypt_notify(GIOChannel *io, GIOCondition condition, gpointer data) { struct input_device *idev = data; - struct hidp_connadd_req *req = idev->req; + int err; DBG(" "); - encrypt_completed(0, req); + err = ioctl_connadd(idev->req); + if (err < 0) { + error("ioctl_connadd(): %s(%d)", strerror(-err), -err); + close(idev->req->intr_sock); + close(idev->req->ctrl_sock); + } idev->sec_watch = 0; + + g_free(idev->req->rd_data); + g_free(idev->req); idev->req = NULL; return FALSE; -- 2.47.3