Browse Source

USB: misc: chaoskey: 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 <gustavo@embeddedor.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gustavo A. R. Silva 7 years ago
parent
commit
32366fc9fe
1 changed files with 3 additions and 3 deletions
  1. 3 3
      drivers/usb/misc/chaoskey.c

+ 3 - 3
drivers/usb/misc/chaoskey.c

@@ -183,10 +183,10 @@ static int chaoskey_probe(struct usb_interface *interface,
 	dev->in_ep = in_ep;
 	dev->in_ep = in_ep;
 
 
 	if (le16_to_cpu(udev->descriptor.idVendor) != ALEA_VENDOR_ID)
 	if (le16_to_cpu(udev->descriptor.idVendor) != ALEA_VENDOR_ID)
-		dev->reads_started = 1;
+		dev->reads_started = true;
 
 
 	dev->size = size;
 	dev->size = size;
-	dev->present = 1;
+	dev->present = true;
 
 
 	init_waitqueue_head(&dev->wait_q);
 	init_waitqueue_head(&dev->wait_q);
 
 
@@ -239,7 +239,7 @@ static void chaoskey_disconnect(struct usb_interface *interface)
 	usb_set_intfdata(interface, NULL);
 	usb_set_intfdata(interface, NULL);
 	mutex_lock(&dev->lock);
 	mutex_lock(&dev->lock);
 
 
-	dev->present = 0;
+	dev->present = false;
 	usb_poison_urb(dev->urb);
 	usb_poison_urb(dev->urb);
 
 
 	if (!dev->open) {
 	if (!dev->open) {