提交 fea53b9f 编写于 作者: N Nikolai Kondrashov 提交者: Jiri Kosina

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: NNikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: NJosé Expósito <jose.exposito89@gmail.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 7f12dd24
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册