diff mbox series

PCI: Make pci_cap_saved_state private to core

Message ID 20210728231447.869117-1-helgaas@kernel.org (mailing list archive)
State Superseded
Delegated to: Bjorn Helgaas
Headers show
Series PCI: Make pci_cap_saved_state private to core | expand

Commit Message

Bjorn Helgaas July 28, 2021, 11:14 p.m. UTC
From: Bjorn Helgaas <bhelgaas@google.com>

struct pci_cap_saved_data and struct pci_cap_saved_state were declared in
include/linux/pci.h, but aren't needed outside drivers/pci/.  Move them to
drivers/pci/pci.h.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/pci.h   | 17 +++++++++++++++--
 include/linux/pci.h | 12 ------------
 2 files changed, 15 insertions(+), 14 deletions(-)

Comments

Alex Williamson Aug. 2, 2021, 7:17 p.m. UTC | #1
On Wed, 28 Jul 2021 18:14:47 -0500
Bjorn Helgaas <helgaas@kernel.org> wrote:

> From: Bjorn Helgaas <bhelgaas@google.com>
> 
> struct pci_cap_saved_data and struct pci_cap_saved_state were declared in
> include/linux/pci.h, but aren't needed outside drivers/pci/.  Move them to
> drivers/pci/pci.h.
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
>  drivers/pci/pci.h   | 17 +++++++++++++++--
>  include/linux/pci.h | 12 ------------
>  2 files changed, 15 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> index 93dcdd431072..ab5a989e6580 100644
> --- a/drivers/pci/pci.h
> +++ b/drivers/pci/pci.h
> @@ -37,6 +37,21 @@ int pci_probe_reset_function(struct pci_dev *dev);
>  int pci_bridge_secondary_bus_reset(struct pci_dev *dev);
>  int pci_bus_error_reset(struct pci_dev *dev);
>  
> +struct pci_cap_saved_data {
> +	u16		cap_nr;
> +	bool		cap_extended;
> +	unsigned int	size;
> +	u32		data[];
> +};
> +
> +struct pci_cap_saved_state {
> +	struct hlist_node		next;
> +	struct pci_cap_saved_data	cap;
> +};
> +
> +void pci_allocate_cap_save_buffers(struct pci_dev *dev);
> +void pci_free_cap_save_buffers(struct pci_dev *dev);
> +
>  #define PCI_PM_D2_DELAY         200	/* usec; see PCIe r4.0, sec 5.9.1 */
>  #define PCI_PM_D3HOT_WAIT       10	/* msec */
>  #define PCI_PM_D3COLD_WAIT      100	/* msec */
> @@ -100,8 +115,6 @@ void pci_pm_init(struct pci_dev *dev);
>  void pci_ea_init(struct pci_dev *dev);
>  void pci_msi_init(struct pci_dev *dev);
>  void pci_msix_init(struct pci_dev *dev);
> -void pci_allocate_cap_save_buffers(struct pci_dev *dev);
> -void pci_free_cap_save_buffers(struct pci_dev *dev);
>  bool pci_bridge_d3_possible(struct pci_dev *dev);
>  void pci_bridge_d3_update(struct pci_dev *dev);
>  void pci_bridge_wait_for_secondary_bus(struct pci_dev *dev);
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 540b377ca8f6..2ceeb5e9f28a 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -288,18 +288,6 @@ enum pci_bus_speed {
>  enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev);
>  enum pcie_link_width pcie_get_width_cap(struct pci_dev *dev);
>  
> -struct pci_cap_saved_data {
> -	u16		cap_nr;
> -	bool		cap_extended;
> -	unsigned int	size;
> -	u32		data[];
> -};
> -
> -struct pci_cap_saved_state {
> -	struct hlist_node		next;
> -	struct pci_cap_saved_data	cap;
> -};
> -
>  struct irq_affinity;
>  struct pcie_link_state;
>  struct pci_vpd;


Do you want to move these from include/linux/pci.h as well?

struct pci_cap_saved_state *pci_find_saved_cap(struct pci_dev *dev, char cap);
struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev, u16 cap);

Thanks,
Alex
Bjorn Helgaas Aug. 2, 2021, 10:10 p.m. UTC | #2
On Mon, Aug 02, 2021 at 01:17:04PM -0600, Alex Williamson wrote:
> On Wed, 28 Jul 2021 18:14:47 -0500
> Bjorn Helgaas <helgaas@kernel.org> wrote:
> 
> > From: Bjorn Helgaas <bhelgaas@google.com>
> > 
> > struct pci_cap_saved_data and struct pci_cap_saved_state were declared in
> > include/linux/pci.h, but aren't needed outside drivers/pci/.  Move them to
> > drivers/pci/pci.h.
> > 
> > Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> > ---
> >  drivers/pci/pci.h   | 17 +++++++++++++++--
> >  include/linux/pci.h | 12 ------------
> >  2 files changed, 15 insertions(+), 14 deletions(-)
> > 
> > diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
> > index 93dcdd431072..ab5a989e6580 100644
> > --- a/drivers/pci/pci.h
> > +++ b/drivers/pci/pci.h
> > @@ -37,6 +37,21 @@ int pci_probe_reset_function(struct pci_dev *dev);
> >  int pci_bridge_secondary_bus_reset(struct pci_dev *dev);
> >  int pci_bus_error_reset(struct pci_dev *dev);
> >  
> > +struct pci_cap_saved_data {
> > +	u16		cap_nr;
> > +	bool		cap_extended;
> > +	unsigned int	size;
> > +	u32		data[];
> > +};
> > +
> > +struct pci_cap_saved_state {
> > +	struct hlist_node		next;
> > +	struct pci_cap_saved_data	cap;
> > +};
> > +
> > +void pci_allocate_cap_save_buffers(struct pci_dev *dev);
> > +void pci_free_cap_save_buffers(struct pci_dev *dev);
> > +
> >  #define PCI_PM_D2_DELAY         200	/* usec; see PCIe r4.0, sec 5.9.1 */
> >  #define PCI_PM_D3HOT_WAIT       10	/* msec */
> >  #define PCI_PM_D3COLD_WAIT      100	/* msec */
> > @@ -100,8 +115,6 @@ void pci_pm_init(struct pci_dev *dev);
> >  void pci_ea_init(struct pci_dev *dev);
> >  void pci_msi_init(struct pci_dev *dev);
> >  void pci_msix_init(struct pci_dev *dev);
> > -void pci_allocate_cap_save_buffers(struct pci_dev *dev);
> > -void pci_free_cap_save_buffers(struct pci_dev *dev);
> >  bool pci_bridge_d3_possible(struct pci_dev *dev);
> >  void pci_bridge_d3_update(struct pci_dev *dev);
> >  void pci_bridge_wait_for_secondary_bus(struct pci_dev *dev);
> > diff --git a/include/linux/pci.h b/include/linux/pci.h
> > index 540b377ca8f6..2ceeb5e9f28a 100644
> > --- a/include/linux/pci.h
> > +++ b/include/linux/pci.h
> > @@ -288,18 +288,6 @@ enum pci_bus_speed {
> >  enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev);
> >  enum pcie_link_width pcie_get_width_cap(struct pci_dev *dev);
> >  
> > -struct pci_cap_saved_data {
> > -	u16		cap_nr;
> > -	bool		cap_extended;
> > -	unsigned int	size;
> > -	u32		data[];
> > -};
> > -
> > -struct pci_cap_saved_state {
> > -	struct hlist_node		next;
> > -	struct pci_cap_saved_data	cap;
> > -};
> > -
> >  struct irq_affinity;
> >  struct pcie_link_state;
> >  struct pci_vpd;
> 
> 
> Do you want to move these from include/linux/pci.h as well?
> 
> struct pci_cap_saved_state *pci_find_saved_cap(struct pci_dev *dev, char cap);
> struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev, u16 cap);

Yes, and maybe these as well:

  void pci_allocate_cap_save_buffers(struct pci_dev *dev);
  void pci_free_cap_save_buffers(struct pci_dev *dev);
  int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size);
  int pci_add_ext_cap_save_buffer(struct pci_dev *dev,
				 u16 cap, unsigned int size);

Thought I went through these before, but maybe I'm misremembering.

Bjorn
diff mbox series

Patch

diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 93dcdd431072..ab5a989e6580 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -37,6 +37,21 @@  int pci_probe_reset_function(struct pci_dev *dev);
 int pci_bridge_secondary_bus_reset(struct pci_dev *dev);
 int pci_bus_error_reset(struct pci_dev *dev);
 
+struct pci_cap_saved_data {
+	u16		cap_nr;
+	bool		cap_extended;
+	unsigned int	size;
+	u32		data[];
+};
+
+struct pci_cap_saved_state {
+	struct hlist_node		next;
+	struct pci_cap_saved_data	cap;
+};
+
+void pci_allocate_cap_save_buffers(struct pci_dev *dev);
+void pci_free_cap_save_buffers(struct pci_dev *dev);
+
 #define PCI_PM_D2_DELAY         200	/* usec; see PCIe r4.0, sec 5.9.1 */
 #define PCI_PM_D3HOT_WAIT       10	/* msec */
 #define PCI_PM_D3COLD_WAIT      100	/* msec */
@@ -100,8 +115,6 @@  void pci_pm_init(struct pci_dev *dev);
 void pci_ea_init(struct pci_dev *dev);
 void pci_msi_init(struct pci_dev *dev);
 void pci_msix_init(struct pci_dev *dev);
-void pci_allocate_cap_save_buffers(struct pci_dev *dev);
-void pci_free_cap_save_buffers(struct pci_dev *dev);
 bool pci_bridge_d3_possible(struct pci_dev *dev);
 void pci_bridge_d3_update(struct pci_dev *dev);
 void pci_bridge_wait_for_secondary_bus(struct pci_dev *dev);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 540b377ca8f6..2ceeb5e9f28a 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -288,18 +288,6 @@  enum pci_bus_speed {
 enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev);
 enum pcie_link_width pcie_get_width_cap(struct pci_dev *dev);
 
-struct pci_cap_saved_data {
-	u16		cap_nr;
-	bool		cap_extended;
-	unsigned int	size;
-	u32		data[];
-};
-
-struct pci_cap_saved_state {
-	struct hlist_node		next;
-	struct pci_cap_saved_data	cap;
-};
-
 struct irq_affinity;
 struct pcie_link_state;
 struct pci_vpd;