[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1459935926-7802-1-git-send-email-zengzhaoxiu@163.com>
Date: Wed, 6 Apr 2016 17:45:26 +0800
From: zengzhaoxiu@....com
To: dmitry.torokhov@...il.com
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
Zhaoxiu Zeng <zhaoxiu.zeng@...il.com>
Subject: [PATCH v2 18/30] input: use parity16 in ams_delta_serio
From: Zhaoxiu Zeng <zhaoxiu.zeng@...il.com>
Signed-off-by: Zhaoxiu Zeng <zhaoxiu.zeng@...il.com>
---
drivers/input/serio/ams_delta_serio.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c
index 45887e3..85459b3 100644
--- a/drivers/input/serio/ams_delta_serio.c
+++ b/drivers/input/serio/ams_delta_serio.c
@@ -48,13 +48,9 @@ static int check_data(int data)
data);
return SERIO_FRAME;
}
- /* calculate the parity */
- for (i = 1; i < 10; i++) {
- if (data & (1 << i))
- parity++;
- }
/* it should be odd */
- if (!(parity & 0x01)) {
+ parity = parity16(data & 0x3fe);
+ if (!parity) {
dev_warn(&ams_delta_serio->dev,
"paritiy check failed, data=0x%X parity=0x%X\n",
data, parity);
--
2.5.0
Powered by blists - more mailing lists