From patchwork Wed Apr 6 09:45:26 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: 8760101 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 596DDC0553 for ; Wed, 6 Apr 2016 09:45:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93DF4201E4 for ; Wed, 6 Apr 2016 09:45:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD23B201DD for ; Wed, 6 Apr 2016 09:45:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933610AbcDFJpp (ORCPT ); Wed, 6 Apr 2016 05:45:45 -0400 Received: from m50-132.163.com ([123.125.50.132]:41399 "EHLO m50-132.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932367AbcDFJpp (ORCPT ); Wed, 6 Apr 2016 05:45:45 -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=RJocuUzbA9msXcSqirVkYgLQEDb4K2Hmfd ZrX9IlbWsYNaiMxPn86YpBZkj7CI60hiwsOHR8QcbWV/p7werS8jfwgwLzYvnHFb G6Oh1vwptUpvM7jQVSkP3c5uvsR+5emdF3GQCHaibETtFHeypdYSuo36/2IbRg0E 27DUeGJR8= Received: from zhaoxiuzeng-VirtualBox.spreadtrum.com (unknown [112.95.225.98]) by smtp2 (Coremail) with SMTP id DNGowADXtPy42gRXQcWKAQ--.17557S2; Wed, 06 Apr 2016 17:45:31 +0800 (CST) From: zengzhaoxiu@163.com To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiu Zeng Subject: [PATCH v2 18/30] input: use parity16 in ams_delta_serio Date: Wed, 6 Apr 2016 17:45:26 +0800 Message-Id: <1459935926-7802-1-git-send-email-zengzhaoxiu@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <57031D9D.801@gmail.com> References: <57031D9D.801@gmail.com> X-CM-TRANSID: DNGowADXtPy42gRXQcWKAQ--.17557S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtr4kGF4kZFWrArWfur1Dtrb_yoW3Krb_Za s5Grn7XFs0kF43twn0yrs8X3sYvwnYqryFgF1rta15GryUWrZ3JFy8uFW5AFn3XrWkuF9r AryUWas5Kw4xWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnA-BJUUUUU== X-Originating-IP: [112.95.225.98] X-CM-SenderInfo: p2hqw6xkdr5xrx6rljoofrz/1tbiJR5DgFUL+7KhIgAAss 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);