diff mbox series

[PATCHv2,6/7] PCI/AER: API for obtaining AER information

Message ID 20180402162203.3370-7-keith.busch@intel.com
State Changes Requested
Delegated to: Bjorn Helgaas
Headers show
Series DPC updates | expand

Commit Message

Keith Busch April 2, 2018, 4:22 p.m. UTC
Since this is making the function externally visible, appending "aer_"
prefix to the function name.

Signed-off-by: Keith Busch <keith.busch@intel.com>
---
 drivers/pci/pcie/aer/aerdrv.h      | 1 +
 drivers/pci/pcie/aer/aerdrv_core.c | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

Comments

David Laight April 9, 2018, 10:03 a.m. UTC | #1
From: Keith Busch
> Sent: 02 April 2018 17:22
> To: Linux PCI; Bjorn Helgaas
> 
> Since this is making the function externally visible, appending "aer_"
> prefix to the function name.
> 
...
> diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
> index a4bfea52e7d4..4fb24003cac3 100644
> --- a/drivers/pci/pcie/aer/aerdrv_core.c
> +++ b/drivers/pci/pcie/aer/aerdrv_core.c
> @@ -638,7 +638,7 @@ static void aer_recover_work_func(struct work_struct *work)
>  #endif
> 
>  /**
> - * get_device_error_info - read error status from dev and store it to info
> + * aer_get_device_error_info - read error status from dev and store it to info
>   * @dev: pointer to the device expected to have a error record
>   * @info: pointer to structure to store the error record
>   *
> @@ -646,7 +646,7 @@ static void aer_recover_work_func(struct work_struct *work)
>   *
>   * Note that @info is reused among all error devices. Clear fields properly.
>   */
> -static int get_device_error_info(struct pci_dev *dev, struct aer_err_info *info)
> +int aer_get_device_error_info(struct pci_dev *dev, struct aer_err_info *info)
>  {
>  	int pos, temp;
> 
> @@ -705,11 +705,11 @@ static inline void aer_process_err_devices(struct pcie_device *p_device,
> 
>  	/* Report all before handle them, not to lost records by reset etc. */
>  	for (i = 0; i < e_info->error_dev_num && e_info->dev[i]; i++) {
> -		if (get_device_error_info(e_info->dev[i], e_info))
> +		if (aer_get_device_error_info(e_info->dev[i], e_info))
>  			aer_print_error(e_info->dev[i], e_info);
>  	}
>  	for (i = 0; i < e_info->error_dev_num && e_info->dev[i]; i++) {
> -		if (get_device_error_info(e_info->dev[i], e_info))
> +		if (aer_get_device_error_info(e_info->dev[i], e_info))
>  			handle_error_source(p_device, e_info->dev[i], e_info);
>  	}
>  }

Should there be an EXPORT_SYMBOL(aer_get_device_error_info) here?
(preferable without _GPL).

	David
Keith Busch April 9, 2018, 2:37 p.m. UTC | #2
On Mon, Apr 09, 2018 at 10:03:14AM +0000, David Laight wrote:
> 
> Should there be an EXPORT_SYMBOL(aer_get_device_error_info) here?
> (preferable without _GPL).
> 
> 	David

That's necessary only if a module is using the symbol. All existing and
proposed users are built-in, so no need to export it at this time.
diff mbox series

Patch

diff --git a/drivers/pci/pcie/aer/aerdrv.h b/drivers/pci/pcie/aer/aerdrv.h
index 5449e5ce139d..7c833a1d897e 100644
--- a/drivers/pci/pcie/aer/aerdrv.h
+++ b/drivers/pci/pcie/aer/aerdrv.h
@@ -107,6 +107,7 @@  static inline pci_ers_result_t merge_result(enum pci_ers_result orig,
 }
 
 extern struct bus_type pcie_port_bus_type;
+int aer_get_device_error_info(struct pci_dev *dev, struct aer_err_info *info);
 void aer_isr(struct work_struct *work);
 void aer_print_error(struct pci_dev *dev, struct aer_err_info *info);
 void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info);
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
index a4bfea52e7d4..4fb24003cac3 100644
--- a/drivers/pci/pcie/aer/aerdrv_core.c
+++ b/drivers/pci/pcie/aer/aerdrv_core.c
@@ -638,7 +638,7 @@  static void aer_recover_work_func(struct work_struct *work)
 #endif
 
 /**
- * get_device_error_info - read error status from dev and store it to info
+ * aer_get_device_error_info - read error status from dev and store it to info
  * @dev: pointer to the device expected to have a error record
  * @info: pointer to structure to store the error record
  *
@@ -646,7 +646,7 @@  static void aer_recover_work_func(struct work_struct *work)
  *
  * Note that @info is reused among all error devices. Clear fields properly.
  */
-static int get_device_error_info(struct pci_dev *dev, struct aer_err_info *info)
+int aer_get_device_error_info(struct pci_dev *dev, struct aer_err_info *info)
 {
 	int pos, temp;
 
@@ -705,11 +705,11 @@  static inline void aer_process_err_devices(struct pcie_device *p_device,
 
 	/* Report all before handle them, not to lost records by reset etc. */
 	for (i = 0; i < e_info->error_dev_num && e_info->dev[i]; i++) {
-		if (get_device_error_info(e_info->dev[i], e_info))
+		if (aer_get_device_error_info(e_info->dev[i], e_info))
 			aer_print_error(e_info->dev[i], e_info);
 	}
 	for (i = 0; i < e_info->error_dev_num && e_info->dev[i]; i++) {
-		if (get_device_error_info(e_info->dev[i], e_info))
+		if (aer_get_device_error_info(e_info->dev[i], e_info))
 			handle_error_source(p_device, e_info->dev[i], e_info);
 	}
 }