summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-uclogic-core.c
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2022-02-10 22:04:36 +0300
committerJiri Kosina <jkosina@suse.cz>2022-02-16 18:41:54 +0300
commitfea53b9f159cd039e86aebde5cbbfd37765257fb (patch)
treef2227b87cff8279b807560bdb0846d4fef00950b /drivers/hid/hid-uclogic-core.c
parent7f12dd246906de2504b157700a15f49935dc9598 (diff)
downloadlinux-fea53b9f159cd039e86aebde5cbbfd37765257fb.tar.xz
HID: uclogic: Skip non-input raw events earlier
Early return when a non-input raw event is received to simplify the logic present in uclogic_raw_event. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-uclogic-core.c')
-rw-r--r--drivers/hid/hid-uclogic-core.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c
index 56b76d9b46af..8aac3f7a9cda 100644
--- a/drivers/hid/hid-uclogic-core.c
+++ b/drivers/hid/hid-uclogic-core.c
@@ -368,9 +368,12 @@ static int uclogic_raw_event(struct hid_device *hdev,
struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev);
struct uclogic_params *params = &drvdata->params;
+ /* Do not handle anything but input reports */
+ if (report->type != HID_INPUT_REPORT)
+ return 0;
+
/* Tweak pen reports, if necessary */
if (!params->pen_unused &&
- (report->type == HID_INPUT_REPORT) &&
(report->id == params->pen.id) &&
(size >= 2)) {
/* If it's the "virtual" frame controls report */
@@ -384,8 +387,7 @@ static int uclogic_raw_event(struct hid_device *hdev,
}
/* Tweak frame control reports, if necessary */
- if ((report->type == HID_INPUT_REPORT) &&
- (report->id == params->frame.id))
+ if (report->id == params->frame.id)
return uclogic_raw_event_frame(drvdata, data, size);
return 0;