[PATCH] xhci : fix boolreturn.cocci warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



drivers/usb/host/pci-quirks.c:541:9-10: WARNING: return of 0/1 in function 'usb_amd_pt_check_port' with return type bool

 Return statements in functions returning bool should use
 true/false instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.cocci

Fixes: 5462b4b541a4 ("xhci : AMD Promontory USB disable port support")
CC: Joe Lee <asmt.swfae@xxxxxxxxx>
Signed-off-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
---

 pci-quirks.c |   32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -538,25 +538,25 @@ bool usb_amd_pt_check_port(struct device
 
 	pci_read_config_byte(pdev, PT_READ_INDX, &value);
 	if (value != PT_SIG_1_DATA)
-		return 0;
+		return false;
 
 	pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_2_ADDR);
 
 	pci_read_config_byte(pdev, PT_READ_INDX, &value);
 	if (value != PT_SIG_2_DATA)
-		return 0;
+		return false;
 
 	pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_3_ADDR);
 
 	pci_read_config_byte(pdev, PT_READ_INDX, &value);
 	if (value != PT_SIG_3_DATA)
-		return 0;
+		return false;
 
 	pci_write_config_word(pdev, PT_ADDR_INDX, PT_SIG_4_ADDR);
 
 	pci_read_config_byte(pdev, PT_READ_INDX, &value);
 	if (value != PT_SIG_4_DATA)
-		return 0;
+		return false;
 
 	if ((pdev->device == 0x43b9) || (pdev->device == 0x43ba)) {
 		/* device is AMD_PROMONTORYA_4(0x43b9) or
@@ -572,18 +572,18 @@ bool usb_amd_pt_check_port(struct device
 
 			pci_read_config_byte(pdev, PT_READ_INDX, &value);
 			if (value & (1<<(port - 7)))
-				return 0;
+				return false;
 			else
-				return 1;
+				return true;
 		} else {
 			pci_write_config_word(pdev, PT_ADDR_INDX,
 						PT4_P1_REG);
 
 			pci_read_config_byte(pdev, PT_READ_INDX, &value);
 			if (value & (1<<(port + 1)))
-				return 0;
+				return false;
 			else
-				return 1;
+				return true;
 		}
 	} else if (pdev->device == 0x43bb) {
 		/* device is AMD_PROMONTORYA_2(0x43bb)
@@ -597,17 +597,17 @@ bool usb_amd_pt_check_port(struct device
 
 			pci_read_config_byte(pdev, PT_READ_INDX, &value);
 			if (value & (1<<(port - 3)))
-				return 0;
+				return false;
 			else
-				return 1;
+				return true;
 		} else {
 			pci_write_config_word(pdev, PT_ADDR_INDX, PT2_P1_REG);
 
 			pci_read_config_byte(pdev, PT_READ_INDX, &value);
 			if (value & (1<<(port + 5)))
-				return 0;
+				return false;
 			else
-				return 1;
+				return true;
 		}
 	} else {
 		/* device is AMD_PROMONTORYA_1(0x43bc)
@@ -621,18 +621,18 @@ bool usb_amd_pt_check_port(struct device
 
 			pci_read_config_byte(pdev, PT_READ_INDX, &value);
 			if (value & (1<<(port - 4)))
-				return 0;
+				return false;
 			else
-				return 1;
+				return true;
 
 		} else {
 			pci_write_config_word(pdev, PT_ADDR_INDX, PT1_P1_REG);
 
 			pci_read_config_byte(pdev, PT_READ_INDX, &value);
 			if (value & (1<<(port + 4)))
-				return 0;
+				return false;
 			else
-				return 1;
+				return true;
 
 		}
 	}
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux