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>,
	linux-input@vger.kernel.org
Subject: [PATCH V3 17/29] input: use parity16 in ams_delta_serio
Date: Thu, 14 Apr 2016 11:10:28 +0800	[thread overview]
Message-ID: <1460603429-5317-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>

Signed-off-by: Zhaoxiu Zeng <zhaoxiu.zeng@gmail.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

  parent reply	other threads:[~2016-04-14  3:10 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 ` zengzhaoxiu [this message]
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 ` [PATCH V3 28/29] input: use parity8 in elantech zengzhaoxiu
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=1460603429-5317-1-git-send-email-zengzhaoxiu@163.com \
    --to=zengzhaoxiu@163.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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.