Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3992663ybi; Mon, 29 Jul 2019 17:03:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeeZ8eNqYIAwO+/g1Gj7ekH8PpM9Y5ohIbUM2PsFbf3bTYfIY+Ngkme8VDhBdru7NpPn6S X-Received: by 2002:aa7:8b55:: with SMTP id i21mr39230420pfd.155.1564445038462; Mon, 29 Jul 2019 17:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564445038; cv=none; d=google.com; s=arc-20160816; b=LMxC8UJLyz+uqiDeMGK9N0smNiR37vaa31qFRDxb003y/V4IFmZev69PQLwjXmzqby qO240Vh/TPcawvsD6KQaL325nD+jtsHm8C+FjsRarqxaponGFr3MKKP46nuOPhkqT+fL uqZaX0nUL9NlLRQETn1wEh019oMMx2mmZPXcai4dQf7X5zlMcFTg2sWLrrFlrbEOu6Mu tKACve9XZu1kMKUysDu7ZtIabUWSbR9WcC+oVFFWXVBXg7gziILV623kSfCdfIUNwJYw 5zJsKUxehtlOEii/77o2OhkWVhJclssPbdG/Yp64aYF++aHxamIMjEanyBbbrEieiO40 wwOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eJqSfDVjakDZMRqWwKrPuq+AL+qsX6ihhMyu67EgNMQ=; b=ohAFs9zqlChNwKm7F/rhvaVgx/MFF6Wq3ng8r7LCEV4ytO/SyRn5x6pXeDLeC8q+oZ OG+eZnSlBMqlMCKnC/2EDt0shwxkRSo/fGkkwCgONeEHeMzNH1i9eTP6GaCQWTmFMPkO G7CB+QpFoxyXhz6zxbhGXPWQZjRZ3ME87S4Gj8OuXrZdUL0jUAwJzkYj6yp/0A3fmLv7 wmy/kaB2nzIS4cv2AVVNItpDe4nrGxeFl8LW1xU9Zo2g7gUTVB89HZnexQGxNkmvXrrl xSFzCWJP6PnsYtH56QZ4Dc5WotLdFDQlX82Q4wzBIOiOFQhmXF28xAOBZp33AYvClV/i hoBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hHfHcCdz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1si28803976pfc.80.2019.07.29.17.03.43; Mon, 29 Jul 2019 17:03:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hHfHcCdz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388398AbfG2TaP (ORCPT + 99 others); Mon, 29 Jul 2019 15:30:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:42966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388173AbfG2TaN (ORCPT ); Mon, 29 Jul 2019 15:30:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 658DC2070B; Mon, 29 Jul 2019 19:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428612; bh=vCaANHqlQGM+SF6//lFviA11GynhjsEXs08O1x93BN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hHfHcCdzmw4ejoBjw+gjrCAADWvoSJB+maA1tA1OcbHzMDFtRIkeKeptYtxBjnfkD BgVjmSayOJlf+3SucZKzJH15Eep+BD8Vs0bNi9CYj+EMU9QPvjMMv0a/aYHbD8/4HN agBKfdx+wI8+QFZMGBqWLsjDgl0lnda0TvTPgtzQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hui Wang , Dmitry Torokhov Subject: [PATCH 4.14 130/293] Input: alps - fix a mismatch between a condition check and its comment Date: Mon, 29 Jul 2019 21:20:21 +0200 Message-Id: <20190729190834.542731525@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hui Wang commit 771a081e44a9baa1991ef011cc453ef425591740 upstream. In the function alps_is_cs19_trackpoint(), we check if the param[1] is in the 0x20~0x2f range, but the code we wrote for this checking is not correct: (param[1] & 0x20) does not mean param[1] is in the range of 0x20~0x2f, it also means the param[1] is in the range of 0x30~0x3f, 0x60~0x6f... Now fix it with a new condition checking ((param[1] & 0xf0) == 0x20). Fixes: 7e4935ccc323 ("Input: alps - don't handle ALPS cs19 trackpoint-only device") Cc: stable@vger.kernel.org Signed-off-by: Hui Wang Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/alps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -2875,7 +2875,7 @@ static bool alps_is_cs19_trackpoint(stru * trackpoint-only devices have their variant_ids equal * TP_VARIANT_ALPS and their firmware_ids are in 0x20~0x2f range. */ - return param[0] == TP_VARIANT_ALPS && (param[1] & 0x20); + return param[0] == TP_VARIANT_ALPS && ((param[1] & 0xf0) == 0x20); } static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)