Skip to content

Commit 04230f4

Browse files
GustavoARSilvaJiri Kosina
authored andcommitted
HID: hid-ntrig: use true and false for boolean values
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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 336fd4f commit 04230f4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/hid/hid-ntrig.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,8 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,
591591
switch (usage->hid) {
592592
case 0xff000001:
593593
/* Tag indicating the start of a multitouch group */
594-
nd->reading_mt = 1;
595-
nd->first_contact_touch = 0;
594+
nd->reading_mt = true;
595+
nd->first_contact_touch = false;
596596
break;
597597
case HID_DG_TIPSWITCH:
598598
nd->tipswitch = value;
@@ -663,7 +663,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,
663663
* even if deactivation slack is turned off.
664664
*/
665665
nd->act_state = deactivate_slack - 1;
666-
nd->confidence = 0;
666+
nd->confidence = false;
667667
break;
668668
}
669669

@@ -679,7 +679,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,
679679
*/
680680
if (nd->w < nd->min_width ||
681681
nd->h < nd->min_height)
682-
nd->confidence = 0;
682+
nd->confidence = false;
683683
} else
684684
break;
685685

@@ -758,7 +758,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,
758758
if (!nd->reading_mt) /* Just to be sure */
759759
break;
760760

761-
nd->reading_mt = 0;
761+
nd->reading_mt = false;
762762

763763

764764
/*
@@ -910,7 +910,7 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
910910
return -ENOMEM;
911911
}
912912

913-
nd->reading_mt = 0;
913+
nd->reading_mt = false;
914914
nd->min_width = 0;
915915
nd->min_height = 0;
916916
nd->activate_slack = activate_slack;

0 commit comments

Comments
 (0)