From patchwork Wed Apr 6 10:20:14 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: 8760641 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 17D4DC0553 for ; Wed, 6 Apr 2016 10:21:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3898A201D3 for ; Wed, 6 Apr 2016 10:21:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CAC9201DD for ; Wed, 6 Apr 2016 10:21:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751932AbcDFKVb (ORCPT ); Wed, 6 Apr 2016 06:21:31 -0400 Received: from m50-133.163.com ([123.125.50.133]:38736 "EHLO m50-133.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752694AbcDFKVa (ORCPT ); Wed, 6 Apr 2016 06:21:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=v2ihNQOt4dNEdfGmfj sA7fcaHOBpPp82XnKdAzFrKxc=; b=M6oMco9emH5q+9u3kIXtTUTK4DGq4PUuvZ U9BinLJhttNDZznsndg1S4lMfzYGy+vQNYnMd3e6n4QUAZjCvHVmDef+CmN0AQI2 50Yu6xA+knfXatLMc1U13Dn5lV3+dAHnyzhDt1cHyEzrDMbYq3nfv5bGLrx7r1m0 R+DHas5QM= Received: from zhaoxiuzeng-VirtualBox.spreadtrum.com (unknown [112.95.225.98]) by smtp3 (Coremail) with SMTP id DdGowADH_pLg4gRXeSKVAQ--.51696S2; Wed, 06 Apr 2016 18:20:20 +0800 (CST) From: zengzhaoxiu@163.com To: dmitry.torokhov@gmail.com, benjamin.tissoires@redhat.com, ulrik.debie-os@e2big.org, hdegoede@redhat.com, peter.hutterer@who-t.net, tiwai@suse.de, dusonlin@emc.com.tw Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Zhaoxiu Zeng Subject: [PATCH v2 29/30] input: use parity8 in elantech Date: Wed, 6 Apr 2016 18:20:14 +0800 Message-Id: <1459938014-8603-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: DdGowADH_pLg4gRXeSKVAQ--.51696S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7ArWrGF15uFy5Gr18Aw4ruFg_yoW8Ww4fpF W5XryUKrWkta13t34DtF4DAFyrtwn2gas8KFWkW3sYqr4UJFWSvr15JrW29FyqyFy5CF4j van0yr45GFs2ka7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jakskUUUUU= X-Originating-IP: [112.95.225.98] X-CM-SenderInfo: p2hqw6xkdr5xrx6rljoofrz/1tbiowdDgFUL5eQoZAABs1 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 Remove even parity table, use parity8 instead. Signed-off-by: Zhaoxiu Zeng --- 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); };