From 2da5bbf7fca7e6a17d3861d9ea75c23e71d487eb Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 6 Aug 2014 17:00:27 +0300 Subject: input/hog: Remove unnecessary variables --- profiles/input/hog.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/profiles/input/hog.c b/profiles/input/hog.c index 30f9ed12c..b9aba657a 100644 --- a/profiles/input/hog.c +++ b/profiles/input/hog.c @@ -333,33 +333,30 @@ static void forward_report(struct uhid_event *ev, void *user_data) struct report *report, cmp; GSList *l; uint8_t *data; - int size, type, id; + int size; switch (ev->u.output.rtype) { case UHID_FEATURE_REPORT: - type = HOG_REPORT_TYPE_FEATURE; + cmp.type = HOG_REPORT_TYPE_FEATURE; break; case UHID_OUTPUT_REPORT: - type = HOG_REPORT_TYPE_OUTPUT; + cmp.type = HOG_REPORT_TYPE_OUTPUT; break; case UHID_INPUT_REPORT: - type = HOG_REPORT_TYPE_INPUT; + cmp.type = HOG_REPORT_TYPE_INPUT; break; default: return; } - id = 0; + cmp.id = 0; data = ev->u.output.data; size = ev->u.output.size; if (hogdev->has_report_id && size > 0) { - id = *data++; + cmp.id = *data++; --size; } - cmp.type = type; - cmp.id = id; - l = g_slist_find_custom(hogdev->reports, &cmp, report_cmp); if (!l) return; @@ -367,7 +364,7 @@ static void forward_report(struct uhid_event *ev, void *user_data) report = l->data; DBG("Sending report type %d ID %d to device 0x%04X handle 0x%X", - type, id, hogdev->id, report->decl->value_handle); + cmp.type, cmp.id, hogdev->id, report->decl->value_handle); if (hogdev->attrib == NULL) return; -- cgit v1.2.1