All of lore.kernel.org
 help / color / mirror / Atom feed
From: zengzhaoxiu@163.com
To: linux-kernel@vger.kernel.org
Cc: Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Peter Hutterer <peter.hutterer@who-t.net>,
	Ulrik De Bie <ulrik.debie-os@e2big.org>,
	Takashi Iwai <tiwai@suse.de>, Duson Lin <dusonlin@emc.com.tw>,
	linux-input@vger.kernel.org
Subject: [PATCH V3 28/29] input: use parity8 in elantech
Date: Thu, 14 Apr 2016 11:12:30 +0800	[thread overview]
Message-ID: <1460603554-5854-1-git-send-email-zengzhaoxiu@163.com> (raw)
In-Reply-To: <1460601525-3822-1-git-send-email-zengzhaoxiu@163.com>

From: Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com>

Remove the even parity table, use parity8 instead.

Signed-off-by: Zhaoxiu Zeng <zhaoxiu.zeng@gmail.com>
---
 drivers/input/mouse/elantech.c | 10 +++-------
 drivers/input/mouse/elantech.h |  1 -
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 78f93cf..bbb4aa6 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -693,9 +693,9 @@ static int elantech_packet_check_v1(struct psmouse *psmouse)
 
 	p3 = (packet[0] & 0x04) >> 2;
 
-	return etd->parity[packet[1]] == p1 &&
-	       etd->parity[packet[2]] == p2 &&
-	       etd->parity[packet[3]] == p3;
+	return parity8(packet[1]) != p1 &&
+	       parity8(packet[2]) != p2 &&
+	       parity8(packet[3]) != p3;
 }
 
 static int elantech_debounce_check_v2(struct psmouse *psmouse)
@@ -1635,10 +1635,6 @@ int elantech_init(struct psmouse *psmouse)
 
 	psmouse_reset(psmouse);
 
-	etd->parity[0] = 1;
-	for (i = 1; i < 256; i++)
-		etd->parity[i] = etd->parity[i & (i - 1)] ^ 1;
-
 	/*
 	 * Do the version query again so we can store the result
 	 */
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
index e1cbf40..542c5d9 100644
--- a/drivers/input/mouse/elantech.h
+++ b/drivers/input/mouse/elantech.h
@@ -141,7 +141,6 @@ struct elantech_data {
 	unsigned int y_max;
 	unsigned int width;
 	struct finger_pos mt[ETP_MAX_FINGERS];
-	unsigned char parity[256];
 	int (*send_cmd)(struct psmouse *psmouse, unsigned char c, unsigned char *param);
 	void (*original_set_rate)(struct psmouse *psmouse, unsigned int rate);
 };
-- 
2.5.0

  parent reply	other threads:[~2016-04-14  3:12 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14  2:36 [PATCH V3 00/29] bitops: add parity functions zengzhaoxiu
2016-04-14  2:36 ` zengzhaoxiu
2016-04-14  2:36 ` zengzhaoxiu
2016-04-14  2:36 ` zengzhaoxiu
2016-04-14  3:04 ` [PATCH V3 02/29] Include generic parity.h in some architectures' bitops.h zengzhaoxiu
2016-04-14  3:04   ` zengzhaoxiu
2016-04-14  3:04   ` zengzhaoxiu at 163.com
2016-04-14  3:04   ` zengzhaoxiu
2016-04-14  3:04   ` zengzhaoxiu
2016-04-14  3:04   ` zengzhaoxiu
2016-04-14  3:04 ` zengzhaoxiu
2016-04-14  3:05 ` [PATCH V3 03/29] Add alpha-specific parity functions zengzhaoxiu
2016-04-14  3:05 ` [PATCH V3 04/29] Add blackfin-specific " zengzhaoxiu
2016-04-14  3:05 ` [PATCH V3 05/29] Add ia64-specific " zengzhaoxiu
2016-04-14  3:05   ` zengzhaoxiu
2016-04-14  3:05 ` [PATCH V3 06/29] Tile and MIPS (if has usable __builtin_popcount) use popcount " zengzhaoxiu
2016-04-15 19:26   ` Chris Metcalf
2016-04-15 19:26     ` Chris Metcalf
2016-04-14  3:06 ` [PATCH V3 07/29] Add powerpc-specific " zengzhaoxiu
2016-04-14  3:08 ` [PATCH V3 08/29] Add sparc-specific " zengzhaoxiu
2016-04-14  3:08   ` zengzhaoxiu
2016-04-14  3:08 ` [PATCH V3 09/29] Add x86-specific " zengzhaoxiu
2016-04-14  3:08 ` [PATCH V3 10/29] sunrpc: use parity8 zengzhaoxiu
2016-04-14  3:09 ` [PATCH V3 11/29] mips: use parity functions in cerr-sb1.c zengzhaoxiu
2016-04-14  3:09 ` [PATCH V3 12/29] bch: use parity32 zengzhaoxiu
2016-04-14  3:09 ` [PATCH V3 13/29] media: use parity8 in vivid-vbi-gen.c zengzhaoxiu
2016-04-14  3:09 ` [PATCH V3 14/29] media: use parity functions in saa7115 zengzhaoxiu
2016-04-14  3:10 ` [PATCH V3 15/29] input: use parity32 in grip_mp zengzhaoxiu
2016-04-14  3:10 ` [PATCH V3 16/29] input: use parity64 in sidewinder zengzhaoxiu
2016-04-14  3:10 ` [PATCH V3 17/29] input: use parity16 in ams_delta_serio zengzhaoxiu
2016-04-14  3:10 ` [PATCH V3 18/29] scsi: use parity32 in isci's phy zengzhaoxiu
2016-04-14  3:10 ` [PATCH V3 19/29] mtd: use parity16 in ssfdc zengzhaoxiu
2016-04-14  3:11 ` [PATCH V3 20/29] mtd: use parity functions in inftlcore zengzhaoxiu
2016-04-14  3:11 ` [PATCH V3 21/29] crypto: use parity functions in qat_hal zengzhaoxiu
2016-04-14  3:11 ` [PATCH V3 22/29] mtd: use parity16 in sm_ftl zengzhaoxiu
2016-04-14  3:11 ` [PATCH V3 23/29] ethernet: use parity8 in sun/niu.c zengzhaoxiu
2016-04-14  3:11 ` [PATCH V3 24/29] input: use parity8 in pcips2 zengzhaoxiu
2016-04-14  3:11 ` [PATCH V3 25/29] input: use parity8 in sa1111ps2 zengzhaoxiu
2016-04-14  3:12 ` [PATCH V3 26/29] iio: use parity32 in adxrs450 zengzhaoxiu
2016-04-17 11:32   ` Jonathan Cameron
2016-04-14  3:12 ` [PATCH V3 27/29] serial: use parity32 in max3100 zengzhaoxiu
2016-04-28 21:01   ` Greg Kroah-Hartman
2016-04-14  3:12 ` zengzhaoxiu [this message]
2016-04-14  3:12 ` [PATCH V3 29/29] ethernet: use parity8 in broadcom/tg3.c zengzhaoxiu
2016-04-14  4:18 ` [PATCH V3 00/29] bitops: add parity functions zengzhaoxiu
2016-04-14  4:18   ` zengzhaoxiu at 163.com
2016-04-14  4:18   ` zengzhaoxiu
2016-04-14  4:18   ` zengzhaoxiu
2016-04-14  4:18   ` zengzhaoxiu
2016-04-14  4:18   ` zengzhaoxiu
2016-04-14  4:18 ` zengzhaoxiu
2016-04-17 12:38 ` Dmitry Torokhov
2016-04-17 12:38   ` Dmitry Torokhov
2016-04-17 12:38   ` Dmitry Torokhov
2016-04-17 12:38   ` 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=1460603554-5854-1-git-send-email-zengzhaoxiu@163.com \
    --to=zengzhaoxiu@163.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dusonlin@emc.com.tw \
    --cc=hdegoede@redhat.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.hutterer@who-t.net \
    --cc=tiwai@suse.de \
    --cc=ulrik.debie-os@e2big.org \
    --cc=zhaoxiu.zeng@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.