Thread (11 messages) 11 messages, 4 authors, 2019-07-01

Re: [PATCH 2/2] Input: edt-ft5x06 - simplify event reporting code

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2019-06-30 07:06:13
Also in: lkml

On Sun, Jun 23, 2019 at 10:59:18AM +0300, Andy Shevchenko wrote:
On Sun, Jun 23, 2019 at 9:31 AM Dmitry Torokhov
[off-list ref] wrote:
quoted
Now that input_mt_report_slot_state() returns true if slot is active we no
longer need a temporary for the slot state.
quoted
-               down = type != TOUCH_EVENT_UP;

                input_mt_slot(tsdata->input, id);
-               input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER, down);
quoted
+               if (input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER,
+                                              type != TOUCH_EVENT_UP))
Can't we simple do somethink like
-               down = type != TOUCH_EVENT_UP;
+               down = input_mt_report_slot_state(tsdata->input,
MT_TOOL_FINGER, type != TOUCH_EVENT_UP);
Why though? The temporary was needed so we did not have to repeat the
expression for "contact down" condition, and now we do not need it. The
whole change was done so that we cab remove the temporary...

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help