From patchwork Mon Mar 7 17:44:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aniroop Mathur X-Patchwork-Id: 8521331 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 92FB2C0553 for ; Mon, 7 Mar 2016 17:41:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B374A20274 for ; Mon, 7 Mar 2016 17:41:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7CDED20254 for ; Mon, 7 Mar 2016 17:41:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752940AbcCGRlL (ORCPT ); Mon, 7 Mar 2016 12:41:11 -0500 Received: from mail-pf0-f169.google.com ([209.85.192.169]:33282 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752427AbcCGRlK (ORCPT ); Mon, 7 Mar 2016 12:41:10 -0500 Received: by mail-pf0-f169.google.com with SMTP id 124so84216852pfg.0; Mon, 07 Mar 2016 09:41:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=jLExD+OEk7GpFuvdJ3lCewkRPvRZwqFr83QuwK/xBic=; b=ZF3Hq+oYFwIoPbxc1hofyw9lwl3gmqX1R4WLzgYM+GImuBQqzXXUG7mfAVAC4aF4Sv AXHfcwRoZvICTmlM0fB0JNBj7VM0TA7wyI9IqWhyMj2u+87ScrsBGblOy9KfRQhRsdhi LWjFHFyQotT7B9FgAtpkIBHdtPmr1HxnppXPTsCFygHAtx3o5fUehYoR8dCNofTv9s3F FN5MQdH8WoknzctuerewK93N01xO9MClYwFbpp7qj6/3BDtBsAZ9a4YiDmitijcLHVS8 vZj1O5Gm7OhmHlEBkGRD7uuzyqen7IbardmZGj2EVrfYkWVxNc2U4tqmku5qVj8I/5RQ ZaEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=jLExD+OEk7GpFuvdJ3lCewkRPvRZwqFr83QuwK/xBic=; b=YuwrcTfqoKm/UtqvhpPU6Z4h2SrRro0LkBMGHqlqkJc+lgh/scb131AaGo6LFKSvn5 whZImDsUmNH56MxzQSkl7RKcyiJaJKNQaoPvKJ1ByJCjv2+EY5nE8UNAKcG/WQ+29Nx0 ZrUj2O1isMLzRHOVzJf285qczOT5JRJWzJdxdD747qRjsL7sal0DsiPxFqTQ/jp02ljz D1KqK44EPXZ/UhM6OlnPR6Dg2arEL/32CGcBUK1Jw59dReoL5176KhhDuD3o6I7diHcN RGvI7iyCicjzzIlnyzoaDeTh7NKfDR2cS/IdLqRYtYgDHzGmzxQh2nBvUVS1cLbWwkH5 Brpg== X-Gm-Message-State: AD7BkJKMLB9HGkCTj89MunJaINK4Z1U3svTaMVPLCKKyTBtLwTOZsT6/8JSf6/lVhv5Eqg== X-Received: by 10.98.70.156 with SMTP id o28mr17926232pfi.124.1457372469665; Mon, 07 Mar 2016 09:41:09 -0800 (PST) Received: from Aniroops-MacBook-Pro.local.name ([203.122.2.204]) by smtp.gmail.com with ESMTPSA id 144sm25427469pfa.83.2016.03.07.09.41.07 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 07 Mar 2016 09:41:09 -0800 (PST) From: Aniroop Mathur To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, aniroop.mathur@gmail.com, Aniroop Mathur Subject: [PATCH] Input: Do not add SYN_REPORT in between a single packet data Date: Mon, 7 Mar 2016 23:14:32 +0530 Message-Id: <1457372672-884-1-git-send-email-a.mathur@samsung.com> X-Mailer: git-send-email 2.6.2 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 As mentioned in documentation, SYN_REPORT should be used to separate two packets and should not be inserted in between a single packet as otherwise with multiple SYN_REPORT in a single packet, input reader would not be able to know when the packet ended really. Documentation snippet: * SYN_REPORT: - Used to synchronize and separate events into packets of input data changes occurring at the same moment in time. For example, motion of a mouse may set the REL_X and REL_Y values for one motion, then emit a SYN_REPORT. The next motion will emit more REL_X and REL_Y values and send another SYN_REPORT. Signed-off-by: Aniroop Mathur --- drivers/input/input.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index 8806059..262ef77 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -401,8 +401,7 @@ static void input_handle_event(struct input_dev *dev, if (dev->num_vals >= 2) input_pass_values(dev, dev->vals, dev->num_vals); dev->num_vals = 0; - } else if (dev->num_vals >= dev->max_vals - 2) { - dev->vals[dev->num_vals++] = input_value_sync; + } else if (dev->num_vals >= dev->max_vals - 1) { input_pass_values(dev, dev->vals, dev->num_vals); dev->num_vals = 0; }