From patchwork Tue Mar 6 00:06:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 10260345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9A6E160211 for ; Tue, 6 Mar 2018 00:29:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AC3828D19 for ; Tue, 6 Mar 2018 00:29:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E96128D1B; Tue, 6 Mar 2018 00:29:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB75428D19 for ; Tue, 6 Mar 2018 00:29:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932930AbeCFA3l (ORCPT ); Mon, 5 Mar 2018 19:29:41 -0500 Received: from gateway21.websitewelcome.com ([192.185.45.191]:40039 "EHLO gateway21.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932444AbeCFA3k (ORCPT ); Mon, 5 Mar 2018 19:29:40 -0500 X-Greylist: delayed 1394 seconds by postgrey-1.27 at vger.kernel.org; Mon, 05 Mar 2018 19:29:40 EST Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway21.websitewelcome.com (Postfix) with ESMTP id C765F400CF2E7 for ; Mon, 5 Mar 2018 18:06:25 -0600 (CST) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id t07deSZZA84eYt07deVT5p; Mon, 05 Mar 2018 18:06:25 -0600 Received: from [189.175.117.58] (port=46252 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from ) id 1et07d-003xNW-D1; Mon, 05 Mar 2018 18:06:25 -0600 Date: Mon, 5 Mar 2018 18:06:24 -0600 From: "Gustavo A. R. Silva" To: Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] HID: hid-ntrig: use true and false for boolean values Message-ID: <20180306000624.GA2680@embeddedgus> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.175.117.58 X-Source-L: No X-Exim-ID: 1et07d-003xNW-D1 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.175.117.58]:46252 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 6 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Assign true or false to boolean variables instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- drivers/hid/hid-ntrig.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index 3d121d8..43b1c72 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c @@ -591,8 +591,8 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, switch (usage->hid) { case 0xff000001: /* Tag indicating the start of a multitouch group */ - nd->reading_mt = 1; - nd->first_contact_touch = 0; + nd->reading_mt = true; + nd->first_contact_touch = false; break; case HID_DG_TIPSWITCH: nd->tipswitch = value; @@ -663,7 +663,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, * even if deactivation slack is turned off. */ nd->act_state = deactivate_slack - 1; - nd->confidence = 0; + nd->confidence = false; break; } @@ -679,7 +679,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, */ if (nd->w < nd->min_width || nd->h < nd->min_height) - nd->confidence = 0; + nd->confidence = false; } else break; @@ -758,7 +758,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, if (!nd->reading_mt) /* Just to be sure */ break; - nd->reading_mt = 0; + nd->reading_mt = false; /* @@ -910,7 +910,7 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) return -ENOMEM; } - nd->reading_mt = 0; + nd->reading_mt = false; nd->min_width = 0; nd->min_height = 0; nd->activate_slack = activate_slack;