From patchwork Tue Oct 14 02:26:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Bosch X-Patchwork-Id: 5077721 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7BD5FC11AC for ; Tue, 14 Oct 2014 02:26:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7F22620120 for ; Tue, 14 Oct 2014 02:26:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 483C72010B for ; Tue, 14 Oct 2014 02:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754407AbaJNC0q (ORCPT ); Mon, 13 Oct 2014 22:26:46 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:62291 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754259AbaJNC0q (ORCPT ); Mon, 13 Oct 2014 22:26:46 -0400 Received: by mail-la0-f48.google.com with SMTP id gi9so7539033lab.7 for ; Mon, 13 Oct 2014 19:26:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:date:message-id:subject:from :to:cc:content-type; bh=JUs0D5nWoIdUkodDr32W14DHZPzb2E22/h7VHj5cXLg=; b=GgZv1SkjwGkggEszxBkTpzrT6kDtmiX7hTXVy82UpWui4k7Hdlmz7Mnb3kLKjAu4OG DM4G+/1KfpO6ju5cDfA5WD6j515ThU3BqjOUkCmsV2n/0w0gyl0K+de1oK2yJZREqtVC GaW7ZbTYFvcFeTWx5P/rvVBxKtxtfB5qLwPRrY5Qns3Bgu8arSD/cWmaUW3noMZUbxH/ DjjuOkJesaqs8BemHgpb/uCA7DTjr52TzRSrWzRQYbKCBxsXBIMTU7U+3oRMoI6E++nz eCDpbsWfFuzz6MU5EGjkmnErDaJMwrKwOz9SekNAYvtIKxFt+FnUvEH2jsNtnspitZPu /+sQ== X-Gm-Message-State: ALoCoQn1EYN659s3M+eirzHgeHvhprIUvp81W5rpDpQIxq5vbzfOL9593CcJgMkuJcoqhvr3chn6 MIME-Version: 1.0 X-Received: by 10.112.219.3 with SMTP id pk3mr2259242lbc.18.1413253604522; Mon, 13 Oct 2014 19:26:44 -0700 (PDT) Received: by 10.152.197.66 with HTTP; Mon, 13 Oct 2014 19:26:44 -0700 (PDT) X-Originating-IP: [2a02:8071:2787:8800:5642:49ff:fe5b:d3e5] Date: Tue, 14 Oct 2014 04:26:44 +0200 X-Google-Sender-Auth: Eja6YKM1GyazGbBr81Ltuuvu2_Q Message-ID: Subject: [PATCH] Input: alps - fix v4 button press recognition From: Andreas Bosch To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Since the change to struct input_mt_pos some variables are now bitfields instead of integers. Automatic conversion from integer to bitfield entry destroys information, therefore enforce boolean interpretation instead. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1114768 Fixes: 02d04254a5df ("Input: alps - use struct input_mt_pos to track coordinates") Signed-off-by: Andreas Bosch --- drivers/input/mouse/alps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 35a49bf..2b0ae8c 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -835,8 +835,8 @@ static void alps_process_packet_v4(struct psmouse *psmouse) f->fingers = alps_process_bitmap(priv, f); } - f->left = packet[4] & 0x01; - f->right = packet[4] & 0x02; + f->left = !!(packet[4] & 0x01); + f->right = !!(packet[4] & 0x02); f->st.x = ((packet[1] & 0x7f) << 4) | ((packet[3] & 0x30) >> 2) | ((packet[0] & 0x30) >> 4);