From patchwork Thu Apr 14 03:10:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zengzhaoxiu@163.com X-Patchwork-Id: 8830861 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 53F99C0553 for ; Thu, 14 Apr 2016 03:10:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7ED6120295 for ; Thu, 14 Apr 2016 03:10:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A91A0201F2 for ; Thu, 14 Apr 2016 03:10:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753211AbcDNDKk (ORCPT ); Wed, 13 Apr 2016 23:10:40 -0400 Received: from m50-132.163.com ([123.125.50.132]:36055 "EHLO m50-132.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751872AbcDNDKh (ORCPT ); Wed, 13 Apr 2016 23:10:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=UMqKSjkoqhX1f54FEZ vguPzLTxUkZwDkgk2YIQp7ZiQ=; b=Cw7N22s2MC1tI6XbMROSnV+K423HF+1ro/ 8uCRRSeI1uA/urFBGC2ilYi4uflWSsB5gMvMMDM7cndVhQby4cjVb5xxDk1wQDD4 och1gf+TJHxiq63HnIVy+KCoMwlkMoh+ddIOBRnUQIhoJ6lAb1rpABahQ3ZLBC9L d2EWfdr/U= Received: from zhaoxiuzeng-VirtualBox.spreadtrum.com (unknown [112.95.225.98]) by smtp2 (Coremail) with SMTP id DNGowAAXkhwnCg9XVV+LAw--.16215S2; Thu, 14 Apr 2016 11:10:34 +0800 (CST) From: zengzhaoxiu@163.com To: linux-kernel@vger.kernel.org Cc: Zhaoxiu Zeng , Dmitry Torokhov , 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 Message-Id: <1460603429-5317-1-git-send-email-zengzhaoxiu@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460601525-3822-1-git-send-email-zengzhaoxiu@163.com> References: <1460601525-3822-1-git-send-email-zengzhaoxiu@163.com> X-CM-TRANSID: DNGowAAXkhwnCg9XVV+LAw--.16215S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtr4kGF4kZFWrArWfur1Dtrb_yoW3Krb_Za s5Grn7XFs0kF43twn0yrs8X3sYvwnYqryFgF1rta15GryUWrZ3JFy8uFW5AFn3XrWkuF9r AryUWas5Kw4xWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU50385UUUUU== X-Originating-IP: [112.95.225.98] X-CM-SenderInfo: p2hqw6xkdr5xrx6rljoofrz/1tbivwtLgFWBRQ-LhwAAst Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Zhaoxiu Zeng Signed-off-by: Zhaoxiu Zeng --- 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);