Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1117077pxb; Tue, 3 Nov 2020 23:56:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxC6QYReXWI/ZIqLgtbdBvPQASquoc8hEv3Lro2pRXDDiN1F7lmHE4+4NnICgvOn5VFsY0/ X-Received: by 2002:aa7:df82:: with SMTP id b2mr12880982edy.251.1604476589569; Tue, 03 Nov 2020 23:56:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604476589; cv=none; d=google.com; s=arc-20160816; b=HxEOXFXyEUssir2eAO0BrYEvT1njcuRooVPBp2yBBhjsauCnl6D3zjwOby6XhmZKMX c1QTGyxZbPAsNj9jcPvdYWe+8inGKR56eIm6OD0uaazzsSSKchy6lNsY+VOsoza1IQTl Nm9vx/AH7Z9sNOvs39DsAgD6Pr9JEkddZ3mml8GER8jiYFuggpxp+9JBKKn2X4ft9rdu fRktmEC56ZFh1Qnhgok7lRYkqyfsUev26l1610Y4jea5ytgbCgmnGZJVI80ZtcWUeDj4 lyLvothgyvrJNg3fjCi7D2JjsYM1wtBgZItsMA9SUMfFpvIKe49h7US2baQ7VfVNrS95 kTKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=0qsisK3EUJzpQxwKGb3ASw6EVs5XDMo5uDTilYZ/kpc=; b=maoaM0SU8eIMJabvE6zcdVPdMnurGORaxR5A1NORoE3tTyJJz7BopjTAqPY3T3XIon ZSRB71wYSOmkUwsw9DK55OTZp89vt46SsSYivhOGW8xAkS7KhkhRXoSkEeW4TtmnwzCd zRq7fHtwPdKurUdqOBjsqWUHGm0XfO72wufT/lBLKddYfngKXfTZYvyvsnfVoqgVRYjL 3VWdVZGMIjKvXDb7q8KMivsCLDHIzY03ORD3cdvu6/tARQ/Oi5mgAKIUNrMy1th91hQh b5OsbO2crs7jJrCwBTKARA9g0yiOdK5ZoM8Kg2SKvSxdJILwmX3aWylNz4fmjZn31Dcp hSVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx24si707105edb.419.2020.11.03.23.56.06; Tue, 03 Nov 2020 23:56:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729077AbgKDHw0 (ORCPT + 99 others); Wed, 4 Nov 2020 02:52:26 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:37250 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726152AbgKDHw0 (ORCPT ); Wed, 4 Nov 2020 02:52:26 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id DBC2B1C0B77; Wed, 4 Nov 2020 08:52:22 +0100 (CET) Date: Wed, 4 Nov 2020 08:52:21 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jason Gerecke , Ping Cheng , Jiri Kosina Subject: Re: [PATCH 4.19 146/191] HID: wacom: Avoid entering wacom_wac_pen_report for pad / battery Message-ID: <20201104075221.GA4338@amd> References: <20201103203232.656475008@linuxfoundation.org> <20201103203246.442871831@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qMm9M+Fa2AknHoGS" Content-Disposition: inline In-Reply-To: <20201103203246.442871831@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > To correct this, we restore a version of the `WACOM_PAD_FIELD` check > in `wacom_wac_collection()` and return early. This effectively prevents > pad / battery collections from being reported until the very end of the > report as originally intended. Okay... but code is either wrong or very confusing: > +++ b/drivers/hid/wacom_wac.c > @@ -2729,7 +2729,9 @@ static int wacom_wac_collection(struct h > if (report->type !=3D HID_INPUT_REPORT) > return -1; > =20 > - if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input) > + if (WACOM_PAD_FIELD(field)) > + return 0; > + else if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input) > wacom_wac_pen_report(hdev, report); wacom_wac_pen_report() can never be called, because WACOM_PEN_FIELD() can not be true here; if it was we'd return in the line above. Best regards, Pavel --=20 http://www.livejournal.com/~pavelmachek --qMm9M+Fa2AknHoGS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl+iXbUACgkQMOfwapXb+vIcLACgp27+/zNvZ6w44XtqM+Zce0js qagAoJGAXinJ0u4gIlnnWCEL9qUGfYFb =Ma4D -----END PGP SIGNATURE----- --qMm9M+Fa2AknHoGS--