linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nick Dyer <nick.dyer@itdev.co.uk>,
	Yufeng Shen <miletus@chromium.org>,
	Benson Leung <bleung@chromium.org>,
	Daniel Kurtz <djkurtz@chromium.org>,
	Sjoerd Simons <sjoerd.simons@collabora.co.uk>,
	Olof Johansson <olof@lixom.net>
Subject: Re: [PATCH 1/2] Input: atmel_mxt_ts - add support for Google Pixel 2
Date: Wed, 15 Apr 2015 10:35:33 -0700	[thread overview]
Message-ID: <20150415173533.GA27779@dtor-ws> (raw)
In-Reply-To: <552E8A8C.6000900@collabora.co.uk>

On Wed, Apr 15, 2015 at 05:58:04PM +0200, Javier Martinez Canillas wrote:
> On 04/08/2015 02:26 AM, Dmitry Torokhov wrote:
> > @@ -724,15 +726,15 @@ static void mxt_input_button(struct mxt_data *data, u8 *message)
> >  {
> >  	struct input_dev *input = data->input_dev;
> >  	const struct mxt_platform_data *pdata = data->pdata;
> > -	bool button;
> >  	int i;
> >  
> > -	/* Active-low switch */
> >  	for (i = 0; i < pdata->t19_num_keys; i++) {
> >  		if (pdata->t19_keymap[i] == KEY_RESERVED)
> >  			continue;
> > -		button = !(message[1] & (1 << i));
> > -		input_report_key(input, pdata->t19_keymap[i], button);
> > +
> > +		/* Active-low switch */
> > +		input_report_key(input, pdata->t19_keymap[i],
> > +				 !(message[1] & BIT(i)));
> 
> This is an unrelated cleanup so probably should had been a separate patch?

Fair enough.

-- 
Dmitry


Input: atmel_mxt_ts - use BIT() macro when reporting button state

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

This makes the intent a tad more clear.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/touchscreen/atmel_mxt_ts.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 0d87ffc..0dcd455 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -726,15 +726,15 @@ static void mxt_input_button(struct mxt_data *data, u8 *message)
 {
 	struct input_dev *input = data->input_dev;
 	const struct mxt_platform_data *pdata = data->pdata;
-	bool button;
 	int i;
 
-	/* Active-low switch */
 	for (i = 0; i < pdata->t19_num_keys; i++) {
 		if (pdata->t19_keymap[i] == KEY_RESERVED)
 			continue;
-		button = !(message[1] & (1 << i));
-		input_report_key(input, pdata->t19_keymap[i], button);
+
+		/* Active-low switch */
+		input_report_key(input, pdata->t19_keymap[i],
+				 !(message[1] & BIT(i)));
 	}
 }
 

  reply	other threads:[~2015-04-15 17:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08  0:26 [PATCH 1/2] Input: atmel_mxt_ts - add support for Google Pixel 2 Dmitry Torokhov
2015-04-08  0:26 ` [PATCH 2/2] Input: atmel_mxt_ts - allow specifying device-specific configs Dmitry Torokhov
2015-04-09 11:03   ` Nick Dyer
2015-04-09 16:42     ` Dmitry Torokhov
2015-04-15 15:58   ` Javier Martinez Canillas
2015-04-09 11:08 ` [PATCH 1/2] Input: atmel_mxt_ts - add support for Google Pixel 2 Nick Dyer
2015-04-09 16:29   ` Dmitry Torokhov
2015-04-15 15:58 ` Javier Martinez Canillas
2015-04-15 17:35   ` Dmitry Torokhov [this message]
2015-04-15 22:36     ` Javier Martinez Canillas
2015-04-15 21:20   ` Benjamin Tissoires
2015-04-15 22:23     ` Javier Martinez Canillas
2015-04-15 22:43       ` Dmitry Torokhov
2015-04-15 23:34         ` Benjamin Tissoires

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=20150415173533.GA27779@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=bleung@chromium.org \
    --cc=djkurtz@chromium.org \
    --cc=javier.martinez@collabora.co.uk \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miletus@chromium.org \
    --cc=nick.dyer@itdev.co.uk \
    --cc=olof@lixom.net \
    --cc=sjoerd.simons@collabora.co.uk \
    /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).