linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kristen Carlson Accardi <kristen@linux.intel.com>
To: linux-input@vger.kernel.org
Cc: Kristen Carlson Accardi <kristen@linux.intel.com>
Subject: [PATCH] input: move check for same handler in input_pass_event
Date: Thu,  6 Jan 2011 14:24:48 -0800	[thread overview]
Message-ID: <1294352688-29564-1-git-send-email-kristen@linux.intel.com> (raw)

If the handler that injected an event is the same,
just skip the filter, but allow the handler->event()
routine to be called.  This allows evdev to be able to
be used to loopback events.
---
 drivers/input/input.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index db409d6..cdeb929 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -98,16 +98,15 @@ static void input_pass_event(struct input_dev *dev,
 			 * particular event we want to skip it to avoid
 			 * filters firing again and again.
 			 */
-			if (handler == src_handler)
-				continue;
-
 			if (!handler->filter) {
 				if (filtered)
 					break;
 
 				handler->event(handle, type, code, value);
 
-			} else if (handler->filter(handle, type, code, value))
+			} else if (handler != src_handler &&
+					handler->filter(handle, type, code,
+								value))
 				filtered = true;
 		}
 	}
-- 
1.7.2.3


             reply	other threads:[~2011-01-06 22:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-06 22:24 Kristen Carlson Accardi [this message]
2011-01-06 22:29 ` [PATCH] input: move check for same handler in input_pass_event Kristen Carlson Accardi
2011-01-07  6:04 ` Dmitry Torokhov
2011-01-07 18:24   ` Kristen Carlson Accardi
2011-01-07 19:29     ` Dmitry Torokhov
2011-01-07 19:32       ` Arjan van de Ven
2011-01-07 19:43         ` Dmitry Torokhov
2011-01-20  8:56           ` Dmitry Torokhov
2011-01-26  4:59             ` Dmitry Torokhov

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=1294352688-29564-1-git-send-email-kristen@linux.intel.com \
    --to=kristen@linux.intel.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;
as well as URLs for NNTP newsgroup(s).