Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp281360pxx; Wed, 28 Oct 2020 04:56:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIqsqjm/s/eFHm5zt6RorD9fgBRYqKvyrmYNXf+MUC1tykMpdOkdSUlgJfiMzj9f5MLpen X-Received: by 2002:aa7:ca45:: with SMTP id j5mr7645150edt.245.1603886203103; Wed, 28 Oct 2020 04:56:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603886203; cv=none; d=google.com; s=arc-20160816; b=0gLN5JIQmPmvQSzVQrwGigeKbdKuisNqQzNKfSXhFTIpi6sKdhDcWMwcQqJelB5gx/ NRNwCu9hgYT1J1xgxtU+lwkvo84onJXkAHMcDnnufAVBNCdbGkanqxMAxfnhunJrIJgs 1yBQ10U48oIH7EZsKcCXBN+3DZtPGtznaeEuLJDPLgZUsgW2dxACzt081jj8NLUu+Owr JEp+cAXAZjtCJb6+U46QS9LEtz/rY6M43PKSstEQS4pf7YqAsTPFRCEtxodxuac3juVO DJZW72NGGq8F/mGpbht1BJf6Cq4ATnOb0n9F9YZbNz8M5SVlXn4c68j8PtxuYzm/ltlc TeAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cLo3N2fnjpPWCyB5yVFJlRrH8DoetQ3jtUHUxC2/T0g=; b=iSAWgegTGWiNzoDSzdPqoiYXh+mzVFXlAn78CduxIlF25mqqeBzEgWQ7sD4x9hKvfg 9MRBqBcjRwOBUfYA3auJ+m234n84S704PWTvHlrTDB72cDQ1I+6smRpHWzktc2sBDe5T HaykRGFURKOmMLxwL5zY9+BYqQWSKptEGG2H2BP6zkk+O5932VrD1gptb6mgYZukN4IK ygWDaqeit99XPltZ0wZar9RKAzH+a9QpVG29MKLkbxDFBKoyoiCPEKWs5yuhzIvBwI36 G2PEoQnOHgA4JCw+3qNRIybm4YqoukieVC3CeuATt21UzDGhxlOeTZBbjBE0/4w1g6f2 JgBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=poHgf076; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt10si1135660edb.503.2020.10.28.04.56.19; Wed, 28 Oct 2020 04:56:43 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=poHgf076; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1794799AbgJ0PNj (ORCPT + 99 others); Tue, 27 Oct 2020 11:13:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:33610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1788158AbgJ0PAY (ORCPT ); Tue, 27 Oct 2020 11:00:24 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C947C22264; Tue, 27 Oct 2020 15:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810823; bh=2CuEHpD9ixvCpTVSYRAENPYy0q6XjSB2a6ayoGBj2c8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=poHgf076KN4GYBs+5pQetOg0FASOSzVIft47+rRlICLuIdO3qhV+yt475kuvsKJxC lDpDH8Hq5y3QjDqrKeOmOzjFTqHau/wtmZB1A+NHV28M1uLEl1ue9CHkZTXbYkY/89 zeeaqQzPhOw8DVA+6rYQ2yJeVoK5Aa0hznV7S4zE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kenneth Albanowski , Dmitry Torokhov , Jiri Kosina , Sasha Levin Subject: [PATCH 5.8 274/633] HID: hid-input: fix stylus battery reporting Date: Tue, 27 Oct 2020 14:50:17 +0100 Message-Id: <20201027135535.520962610@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Torokhov [ Upstream commit 505f394fa239cecb76d916aa858f87ed7ea7fde4 ] With commit 4f3882177240 hid-input started clearing of "ignored" usages to avoid using garbage that might have been left in them. However "battery strength" usages should not be ignored, as we do want to use them. Fixes: 4f3882177240 ("HID: hid-input: clear unmapped usages") Reported-by: Kenneth Albanowski Tested-by: Kenneth Albanowski Signed-off-by: Dmitry Torokhov Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/hid-input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index e3d475f4baf66..b2bff932c524f 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -797,7 +797,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x3b: /* Battery Strength */ hidinput_setup_battery(device, HID_INPUT_REPORT, field); usage->type = EV_PWR; - goto ignore; + return; case 0x3c: /* Invert */ map_key_clear(BTN_TOOL_RUBBER); @@ -1059,7 +1059,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case HID_DC_BATTERYSTRENGTH: hidinput_setup_battery(device, HID_INPUT_REPORT, field); usage->type = EV_PWR; - goto ignore; + return; } goto unknown; -- 2.25.1