From patchwork Tue Oct 14 19:08:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Bosch X-Patchwork-Id: 5082031 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1C4A49F295 for ; Tue, 14 Oct 2014 19:09:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 305A3201FE for ; Tue, 14 Oct 2014 19:09:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 44A40201F7 for ; Tue, 14 Oct 2014 19:08:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755348AbaJNTI6 (ORCPT ); Tue, 14 Oct 2014 15:08:58 -0400 Received: from mail-la0-f51.google.com ([209.85.215.51]:48541 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754243AbaJNTI6 (ORCPT ); Tue, 14 Oct 2014 15:08:58 -0400 Received: by mail-la0-f51.google.com with SMTP id ge10so9128162lab.10 for ; Tue, 14 Oct 2014 12:08:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=FXUoVfo0O19Qo5MxNeSqQrDfczCUfj1liLZy0BrytuE=; b=Kuy+r8UUxM8sK1/sICQWY6nwp7u7NNdsfoRFjJp/kq3K8V3NbRnmqFrPFWS/NcV++2 uHopv2hJXDcQKhn8SdB3gTbBqHJWoqK/AZLowFswAmbyOL2yiQGLbwcXNE7YTUu1pvcv Pp4WTg7lU1UXY3J8dL0EEZxZsGPFkHHmjZ/QjAXhW8lvc6F3n61ydIHfhVYwJu0IYGAN sq67jLjiv4YfSjCPuT845T0n3Oz7QyAC2zgSybTOvLZcjG46IH7jiPgqLtQjm9U5aWKS B/BFLG6g7GPenqp+TxEk+AZ2qpRlUi+WcU3BnwWYishAxaq15WHIavlXtK+Z3uTi0puU kXjA== X-Gm-Message-State: ALoCoQnIk8SyOI1oQLxmY+Vy4VNgW5JdIgsD7hiiXb4b27FsydN2qqBX2siZlWq+KrnHecsW3JSs X-Received: by 10.152.20.132 with SMTP id n4mr7569537lae.50.1413313736114; Tue, 14 Oct 2014 12:08:56 -0700 (PDT) Received: from pamobile.localdomain (HSI-KBW-046-005-002-243.hsi8.kabel-badenwuerttemberg.de. [46.5.2.243]) by mx.google.com with ESMTPSA id l13sm5901624lbh.32.2014.10.14.12.08.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Oct 2014 12:08:55 -0700 (PDT) From: Andreas Bosch To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com Subject: [PATCH v2] Input: alps - fix v4 button press recognition Date: Tue, 14 Oct 2014 21:08:05 +0200 Message-Id: <1413313685-24405-1-git-send-email-linux@progandy.de> X-Mailer: git-send-email 2.1.2 In-Reply-To: References: 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 --- This is the second version of the patch. The first try got mangled during the transmission. 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);