* [PATCH 2/2] PCI: Refactor pci_is_bridge()
@ 2014-03-14 9:38 Yijing Wang
2014-04-04 23:32 ` Bjorn Helgaas
0 siblings, 1 reply; 3+ messages in thread
From: Yijing Wang @ 2014-03-14 9:38 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci, Rafael J. Wysocki, Yijing Wang
Refactor pci_is_bridge(), check pci device
hdr_type instead, and move it in include/linux/pci.h
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
include/linux/pci.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 33aa2ca..22370c4 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1649,6 +1649,12 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
return pci_pcie_cap(dev);
}
+static inline bool pci_is_bridge(struct pci_dev *dev)
+{
+ return dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
+ dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
+}
+
/**
* pcie_caps_reg - get the PCIe Capabilities Register
* @dev: PCI device
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] PCI: Refactor pci_is_bridge()
2014-03-14 9:38 [PATCH 2/2] PCI: Refactor pci_is_bridge() Yijing Wang
@ 2014-04-04 23:32 ` Bjorn Helgaas
2014-04-08 9:26 ` Yijing Wang
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2014-04-04 23:32 UTC (permalink / raw)
To: Yijing Wang; +Cc: linux-pci, Rafael J. Wysocki
On Fri, Mar 14, 2014 at 05:38:46PM +0800, Yijing Wang wrote:
> Refactor pci_is_bridge(), check pci device
> hdr_type instead, and move it in include/linux/pci.h
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> ---
> include/linux/pci.h | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 33aa2ca..22370c4 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1649,6 +1649,12 @@ static inline bool pci_is_pcie(struct pci_dev *dev)
> return pci_pcie_cap(dev);
> }
>
> +static inline bool pci_is_bridge(struct pci_dev *dev)
> +{
> + return dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
> + dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
> +}
There's no point in adding this unless somebody uses it (but I assume
you probably meant to use it in acpi_pci_find_companion() as I mentioned).
> /**
> * pcie_caps_reg - get the PCIe Capabilities Register
> * @dev: PCI device
> --
> 1.7.1
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] PCI: Refactor pci_is_bridge()
2014-04-04 23:32 ` Bjorn Helgaas
@ 2014-04-08 9:26 ` Yijing Wang
0 siblings, 0 replies; 3+ messages in thread
From: Yijing Wang @ 2014-04-08 9:26 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci, Rafael J. Wysocki
>> +static inline bool pci_is_bridge(struct pci_dev *dev)
>> +{
>> + return dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
>> + dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
>> +}
>
> There's no point in adding this unless somebody uses it (but I assume
> you probably meant to use it in acpi_pci_find_companion() as I mentioned).
I will resend a complete patchset soon if you think it make sense.
Thanks!
Yijing.
>
>> /**
>> * pcie_caps_reg - get the PCIe Capabilities Register
>> * @dev: PCI device
>> --
>> 1.7.1
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
--
Thanks!
Yijing
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-08 9:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14 9:38 [PATCH 2/2] PCI: Refactor pci_is_bridge() Yijing Wang
2014-04-04 23:32 ` Bjorn Helgaas
2014-04-08 9:26 ` Yijing Wang
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).