Inter-revision diff: patch 6

Comparing v3 (message) to v6 (message)

--- v3
+++ v6
@@ -7,27 +7,24 @@
 
 Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
 ---
- drivers/pci/pcie/portdrv_pci.c | 75 ++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 75 insertions(+)
+ drivers/pci/pcie/portdrv_pci.c | 69 ++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 69 insertions(+)
 
 diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c
-index c7ff1ee..baf413f 100644
+index c7ff1ee..2382cd2 100644
 --- a/drivers/pci/pcie/portdrv_pci.c
 +++ b/drivers/pci/pcie/portdrv_pci.c
-@@ -90,6 +90,78 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = {
+@@ -90,6 +90,72 @@ static const struct dev_pm_ops pcie_portdrv_pm_ops = {
  #define PCIE_PORTDRV_PM_OPS	NULL
  #endif /* !PM */
  
 +static int pci_10bit_tag_comp_support(struct pci_dev *dev, void *data)
 +{
-+	u8 *support = data;
-+
-+	if (*support == 0)
-+		return 0;
++	bool *support = (bool *)data;
 +
 +	if (!pci_is_pcie(dev)) {
-+		*support = 0;
-+		return 0;
++		*support = false;
++		return 1;
 +	}
 +
 +	/*
@@ -39,13 +36,13 @@
 +	 * So we do not consider hotplug scenario.
 +	 */
 +	if (dev->is_hotplug_bridge) {
-+		*support = 0;
-+		return 0;
++		*support = false;
++		return 1;
 +	}
 +
 +	if (!(dev->pcie_devcap2 & PCI_EXP_DEVCAP2_10BIT_TAG_COMP)) {
-+		*support = 0;
-+		return 0;
++		*support = false;
++		return 1;
 +	}
 +
 +	return 0;
@@ -53,16 +50,13 @@
 +
 +static void pci_configure_rp_10bit_tag(struct pci_dev *dev)
 +{
-+	u8 support = 1;
-+	struct pci_dev *pchild;
++	bool support = true;
 +
 +	if (dev->subordinate == NULL)
 +		return;
 +
 +	/* If no devices under the root port, no need to enable 10-Bit Tag. */
-+	pchild = list_first_entry_or_null(&dev->subordinate->devices,
-+					  struct pci_dev, bus_list);
-+	if (pchild == NULL)
++	if (list_empty(&dev->subordinate->devices))
 +		return;
 +
 +	pci_10bit_tag_comp_support(dev, &support);
@@ -93,7 +87,7 @@
  /*
   * pcie_portdrv_probe - Probe PCI-Express port devices
   * @dev: PCI-Express port device being probed
-@@ -111,6 +183,9 @@ static int pcie_portdrv_probe(struct pci_dev *dev,
+@@ -111,6 +177,9 @@ static int pcie_portdrv_probe(struct pci_dev *dev,
  	     (type != PCI_EXP_TYPE_RC_EC)))
  		return -ENODEV;
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help