Re: [PATCH v1 13/14] vfio: Remove extern from declarations across vfio

2021-03-08 Thread Jason Gunthorpe
On Mon, Mar 08, 2021 at 02:49:42PM -0700, Alex Williamson wrote:
> Cleanup disrecommended usage and docs.
> 
> Signed-off-by: Alex Williamson 
> ---
>  Documentation/driver-api/vfio-mediated-device.rst |   19 ++-
>  Documentation/driver-api/vfio.rst |4 -
>  drivers/s390/cio/vfio_ccw_cp.h|   13 +-
>  drivers/s390/cio/vfio_ccw_private.h   |   14 +-
>  drivers/s390/crypto/vfio_ap_private.h |2 
>  drivers/vfio/fsl-mc/vfio_fsl_mc_private.h |7 +
>  drivers/vfio/pci/vfio_pci_private.h   |   66 +--
>  drivers/vfio/platform/vfio_platform_private.h |   31 +++--
>  include/linux/vfio.h  |  122 
> ++---
>  9 files changed, 130 insertions(+), 148 deletions(-)

I'm glad to see this, could you apply it instead of waiting for the
other patches?

Reviewed-by: Jason Gunthorpe 

Jason


Re: [PATCH v1 13/14] vfio: Remove extern from declarations across vfio

2021-03-08 Thread Halil Pasic
On Mon, 08 Mar 2021 14:49:42 -0700
Alex Williamson  wrote:

> Cleanup disrecommended usage and docs.
> 
> Signed-off-by: Alex Williamson 

Acked-by: Halil Pasic 


[PATCH v1 13/14] vfio: Remove extern from declarations across vfio

2021-03-08 Thread Alex Williamson
Cleanup disrecommended usage and docs.

Signed-off-by: Alex Williamson 
---
 Documentation/driver-api/vfio-mediated-device.rst |   19 ++-
 Documentation/driver-api/vfio.rst |4 -
 drivers/s390/cio/vfio_ccw_cp.h|   13 +-
 drivers/s390/cio/vfio_ccw_private.h   |   14 +-
 drivers/s390/crypto/vfio_ap_private.h |2 
 drivers/vfio/fsl-mc/vfio_fsl_mc_private.h |7 +
 drivers/vfio/pci/vfio_pci_private.h   |   66 +--
 drivers/vfio/platform/vfio_platform_private.h |   31 +++--
 include/linux/vfio.h  |  122 ++---
 9 files changed, 130 insertions(+), 148 deletions(-)

diff --git a/Documentation/driver-api/vfio-mediated-device.rst 
b/Documentation/driver-api/vfio-mediated-device.rst
index 25eb7d5b834b..7685ef582f7a 100644
--- a/Documentation/driver-api/vfio-mediated-device.rst
+++ b/Documentation/driver-api/vfio-mediated-device.rst
@@ -115,12 +115,11 @@ to register and unregister itself with the core driver:
 
 * Register::
 
-extern int  mdev_register_driver(struct mdev_driver *drv,
-  struct module *owner);
+int mdev_register_driver(struct mdev_driver *drv, struct module *owner);
 
 * Unregister::
 
-extern void mdev_unregister_driver(struct mdev_driver *drv);
+void mdev_unregister_driver(struct mdev_driver *drv);
 
 The mediated bus driver is responsible for adding mediated devices to the VFIO
 group when devices are bound to the driver and removing mediated devices from
@@ -162,13 +161,13 @@ The callbacks in the mdev_parent_ops structure are as 
follows:
 A driver should use the mdev_parent_ops structure in the function call to
 register itself with the mdev core driver::
 
-   extern int  mdev_register_device(struct device *dev,
-const struct mdev_parent_ops *ops);
+   int  mdev_register_device(struct device *dev,
+ const struct mdev_parent_ops *ops);
 
 However, the mdev_parent_ops structure is not required in the function call
 that a driver should use to unregister itself with the mdev core driver::
 
-   extern void mdev_unregister_device(struct device *dev);
+   void mdev_unregister_device(struct device *dev);
 
 
 Mediated Device Management Interface Through sysfs
@@ -293,11 +292,11 @@ Translation APIs for Mediated Devices
 The following APIs are provided for translating user pfn to host pfn in a VFIO
 driver::
 
-   extern int vfio_pin_pages(struct device *dev, unsigned long *user_pfn,
- int npage, int prot, unsigned long *phys_pfn);
+   int vfio_pin_pages(struct device *dev, unsigned long *user_pfn,
+  int npage, int prot, unsigned long *phys_pfn);
 
-   extern int vfio_unpin_pages(struct device *dev, unsigned long *user_pfn,
-   int npage);
+   int vfio_unpin_pages(struct device *dev, unsigned long *user_pfn,
+int npage);
 
 These functions call back into the back-end IOMMU module by using the pin_pages
 and unpin_pages callbacks of the struct vfio_iommu_driver_ops[4]. Currently
diff --git a/Documentation/driver-api/vfio.rst 
b/Documentation/driver-api/vfio.rst
index 03e978eb8ec7..e6ba42ca6346 100644
--- a/Documentation/driver-api/vfio.rst
+++ b/Documentation/driver-api/vfio.rst
@@ -252,11 +252,11 @@ into VFIO core.  When devices are bound and unbound to 
the driver,
 the driver should call vfio_add_group_dev() and vfio_del_group_dev()
 respectively::
 
-   extern struct vfio_device *vfio_add_group_dev(struct device *dev,
+   struct vfio_device *vfio_add_group_dev(struct device *dev,
const struct vfio_device_ops *ops,
void *device_data);
 
-   extern void *vfio_del_group_dev(struct device *dev);
+   void *vfio_del_group_dev(struct device *dev);
 
 vfio_add_group_dev() indicates to the core to begin tracking the
 iommu_group of the specified dev and register the dev as owned by
diff --git a/drivers/s390/cio/vfio_ccw_cp.h b/drivers/s390/cio/vfio_ccw_cp.h
index ba31240ce965..1ea81c4fe630 100644
--- a/drivers/s390/cio/vfio_ccw_cp.h
+++ b/drivers/s390/cio/vfio_ccw_cp.h
@@ -42,12 +42,11 @@ struct channel_program {
struct ccw1 *guest_cp;
 };
 
-extern int cp_init(struct channel_program *cp, struct device *mdev,
-  union orb *orb);
-extern void cp_free(struct channel_program *cp);
-extern int cp_prefetch(struct channel_program *cp);
-extern union orb *cp_get_orb(struct channel_program *cp, u32 intparm, u8 lpm);
-extern void cp_update_scsw(struct channel_program *cp, union scsw *scsw);
-extern bool cp_iova_pinned(struct channel_program *cp, u64 iova);
+int cp_init(struct channel_program *cp, struct device *mdev, union orb *orb);
+void cp_free(struct channel_program *cp);
+int