From patchwork Sun Mar 27 07:18:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaoxiu Zeng X-Patchwork-Id: 8675451 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6D89D9F3D1 for ; Sun, 27 Mar 2016 07:18:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7F4982022D for ; Sun, 27 Mar 2016 07:18:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A263E20219 for ; Sun, 27 Mar 2016 07:18:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752845AbcC0HSr (ORCPT ); Sun, 27 Mar 2016 03:18:47 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36441 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752280AbcC0HSq (ORCPT ); Sun, 27 Mar 2016 03:18:46 -0400 Received: by mail-pf0-f196.google.com with SMTP id q129so16809320pfb.3; Sun, 27 Mar 2016 00:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:cc:to:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=4v+TmgyN9M969oU5z+COq+eV1y0yoJj9wf2te2dVHrM=; b=ziUaRUaC6lqXZz/+Fwl8i4+xhJV5cJrRGFIBfCM6LwYVNW+tEkwbq8Wuhg7d2jHaeB zTnPuBZTBnIM26eXlMD5jx2MkBRmoR4Lj+2DoSe+EzmddPZz9zRB7vsHf3vnKwAy/Ql9 7iCj3GihNvO2VoATKz8LRSvV4/Us9CFBjhqzhFnlpriYdBYSaAPimOnrqVhoCP0em/Z7 7sb4/LyxJdQR8Pt+yJiPglac3hOeulvWY3Qgh6lMw8bE/Ge1gSFsRMtHgq6Q90ag0s/R LQZa27i4kT+azLoUgHTFwfnEDVvB5vvfIxx3R7RX+ggNbHsl4hqBzI1kxBnQ4bc05uwO xfSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:references:cc:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=4v+TmgyN9M969oU5z+COq+eV1y0yoJj9wf2te2dVHrM=; b=RpdDlMnUDpJBBvdEKksIZGsaY9wl2MyhNM21PHjb2BMvphDKffs8R9nSTqPnhMJYwE JaFi1+Ui7nWAqxZ+z4tIoobKLRmfuBghDywex3/5B4BgPnsP+Pv2JWSQ6wVSVjnSKn+v wrE3GukiNGllpMIDdvrlFrmu1vQuVJOAZwVIK5hM+vj8D16jZTQAId8tsMfql2OTE5y7 g2kcJ0rXfP32uPsYvaZRFGfcqbYiWPj1HToHAXut+N9r1muH7YH3ID4rEJgIOw4gpc9p M4p4R2BVUjKL5bDdEzI9xFvzGU6a/NI1gt/39XoV7DMzPYvG8iUK47dph1g4bQt7Gjsf AwjA== X-Gm-Message-State: AD7BkJJQpQ00LrLT+rdS6mZWh9/TgVh9pAfeXRQT4fr/2esRVwF4SWBD/YJMTni5uQRxrQ== X-Received: by 10.98.87.216 with SMTP id i85mr33739406pfj.61.1459063125907; Sun, 27 Mar 2016 00:18:45 -0700 (PDT) Received: from [0.0.0.0] (tor-exit4-readme.dfri.se. [171.25.193.78]) by smtp.googlemail.com with ESMTPSA id v74sm27030643pfa.7.2016.03.27.00.18.35 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Mar 2016 00:18:45 -0700 (PDT) Subject: [PATCH 19/31] input: serio: use parity16 in ams_delta_serio.c References: <1458788612-4367-1-git-send-email-zhaoxiu.zeng@gmail.com> Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org To: Dmitry Torokhov From: "zhaoxiu.zeng" Message-ID: <56F7893A.2040902@gmail.com> Date: Sun, 27 Mar 2016 15:18:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <1458788612-4367-1-git-send-email-zhaoxiu.zeng@gmail.com> 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_ADSP_CUSTOM_MED, 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: Zeng Zhaoxiu Signed-off-by: Zeng Zhaoxiu --- 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);