Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752322AbbH0Iic (ORCPT ); Thu, 27 Aug 2015 04:38:32 -0400 Received: from mga02.intel.com ([134.134.136.20]:4039 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752164AbbH0IiK (ORCPT ); Thu, 27 Aug 2015 04:38:10 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,421,1437462000"; d="scan'208";a="549430045" From: "Holmberg, Hans" To: Dmitry Torokhov CC: "Li, Ting" , "linux-input@vger.kernel.org" , lkml Subject: RE: [PATCH] Input: only send a syn event when needed in input_dev_release_keys Thread-Topic: [PATCH] Input: only send a syn event when needed in input_dev_release_keys Thread-Index: AQHQ39F9wQLpEuQ+9EKncNUHRrRziJ4epN6AgADbQhA= Date: Thu, 27 Aug 2015 08:38:06 +0000 Message-ID: <4B6D6D87A8FB62428BE0A3E38461A1AB2E468A20@irsmsx105.ger.corp.intel.com> References: <1440574712-25629-1-git-send-email-hans.holmberg@intel.com> In-Reply-To: Accept-Language: sv-SE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t7R8cikv030005 Content-Length: 1654 Lines: 48 Hi Dmitry, > We already have a similar commit > 00159f19a5057cb779146afce1cceede692af346 in next. That'll fix the problem. I'll make sure to keep an eye on your tree & -next in the future. My patch doesn’t add much (it does avoid the memset when there are no bits to clear however) Cheers! > > --- > > drivers/input/input.c | 12 +++++++++--- > > 1 file changed, 9 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/input/input.c b/drivers/input/input.c index > > 78d2499..c748805 100644 > > --- a/drivers/input/input.c > > +++ b/drivers/input/input.c > > @@ -675,12 +675,18 @@ EXPORT_SYMBOL(input_close_device); > > static void input_dev_release_keys(struct input_dev *dev) { > > int code; > > + bool key_released = false; > > > > if (is_event_supported(EV_KEY, dev->evbit, EV_MAX)) { > > - for_each_set_bit(code, dev->key, KEY_CNT) > > + for_each_set_bit(code, dev->key, KEY_CNT) { > > input_pass_event(dev, EV_KEY, code, 0); > > - memset(dev->key, 0, sizeof(dev->key)); > > - input_pass_event(dev, EV_SYN, SYN_REPORT, 1); > > + key_released = true; > > + } > > + > > + if (key_released) { > > + memset(dev->key, 0, sizeof(dev->key)); > > + input_pass_event(dev, EV_SYN, SYN_REPORT, 1); > > + } > > } > > } > > > > -- > > 1.9.1 > > > > > > -- > Dmitry ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?