linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: hid-ntrig: use true and false for boolean values
@ 2018-03-06  0:06 Gustavo A. R. Silva
  2018-03-06 14:20 ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2018-03-06  0:06 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires
  Cc: linux-input, linux-kernel, Gustavo A. R. Silva

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 <gustavo@embeddedor.com>
---
 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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: hid-ntrig: use true and false for boolean values
  2018-03-06  0:06 [PATCH] HID: hid-ntrig: use true and false for boolean values Gustavo A. R. Silva
@ 2018-03-06 14:20 ` Jiri Kosina
  2018-03-06 16:50   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Kosina @ 2018-03-06 14:20 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Benjamin Tissoires, linux-input, linux-kernel,
	Gustavo A. R. Silva

On Mon, 5 Mar 2018, Gustavo A. R. Silva wrote:

> 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 <gustavo@embeddedor.com>

I've commited this (and the hid-multitouch variant of it as well) to 
for-4.17/upstream.

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: hid-ntrig: use true and false for boolean values
  2018-03-06 14:20 ` Jiri Kosina
@ 2018-03-06 16:50   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2018-03-06 16:50 UTC (permalink / raw)
  To: Jiri Kosina, Gustavo A. R. Silva
  Cc: Benjamin Tissoires, linux-input, linux-kernel

Hi Jiri,

On 03/06/2018 08:20 AM, Jiri Kosina wrote:
> On Mon, 5 Mar 2018, Gustavo A. R. Silva wrote:
> 
>> 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 <gustavo@embeddedor.com>
> 
> I've commited this (and the hid-multitouch variant of it as well) to
> for-4.17/upstream.
> 

Good to know.

Thanks
--
Gustavo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-06 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-06  0:06 [PATCH] HID: hid-ntrig: use true and false for boolean values Gustavo A. R. Silva
2018-03-06 14:20 ` Jiri Kosina
2018-03-06 16:50   ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).