From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Anshul Garg <aksgarg1989@gmail.com>
Cc: linux-input@vger.kernel.org, anshul.g@samsung.com
Subject: Re: [PATCH] Input: Optimize Auto Repeat Loop
Date: Thu, 8 Jan 2015 13:50:47 -0800 [thread overview]
Message-ID: <20150108215047.GE23256@dtor-ws> (raw)
In-Reply-To: <1420724333-54148-1-git-send-email-aksgarg1989@gmail.com>
On Thu, Jan 08, 2015 at 05:38:53AM -0800, Anshul Garg wrote:
> From: Anshul Garg <aksgarg1989@gmail.com>
>
> As input_pass_values function is called everytime when EV_SYN is sent
> from input driver or input event buffer becomes full. So avoid running
> auto repeat code if input device doesn't support EV_KEY and EV_REP
> event type.
>
> Signed-off-by: Anshul Garg <anshul.g@samsung.com>
Applied, thank you.
> ---
> drivers/input/input.c | 14 ++++++++------
> 1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index 213e3a1..601171b 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -152,12 +152,14 @@ static void input_pass_values(struct input_dev *dev,
> add_input_randomness(vals->type, vals->code, vals->value);
>
> /* trigger auto repeat for key events */
> - for (v = vals; v != vals + count; v++) {
> - if (v->type == EV_KEY && v->value != 2) {
> - if (v->value)
> - input_start_autorepeat(dev, v->code);
> - else
> - input_stop_autorepeat(dev);
> + if (test_bit(EV_KEY, dev->evbit) && test_bit(EV_REP, dev->evbit)) {
> + for (v = vals; v != vals + count; v++) {
> + if (v->type == EV_KEY && v->value != 2) {
> + if (v->value)
> + input_start_autorepeat(dev, v->code);
> + else
> + input_stop_autorepeat(dev);
> + }
> }
> }
> }
> --
> 1.7.9.5
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> http://www.avast.com
>
--
Dmitry
next prev parent reply other threads:[~2015-01-08 21:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 13:38 [PATCH] Input: Optimize Auto Repeat Loop Anshul Garg
2015-01-08 21:50 ` Dmitry Torokhov [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-01-05 16:12 Anshul Garg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150108215047.GE23256@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=aksgarg1989@gmail.com \
--cc=anshul.g@samsung.com \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox