Commit d1877e63 authored by Alex Williamson's avatar Alex Williamson

vfio: de-extern-ify function prototypes

The use of 'extern' in function prototypes has been disrecommended in
the kernel coding style for several years now, remove them from all vfio
related files so contributors no longer need to decide between style and
consistency.
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Reviewed-by: default avatarEric Farman <farman@linux.ibm.com>
Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/165471414407.203056.474032786990662279.stgit@omenSigned-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 03c765b0
...@@ -114,11 +114,11 @@ to register and unregister itself with the core driver: ...@@ -114,11 +114,11 @@ to register and unregister itself with the core driver:
* Register:: * Register::
extern int mdev_register_driver(struct mdev_driver *drv); int mdev_register_driver(struct mdev_driver *drv);
* Unregister:: * Unregister::
extern void mdev_unregister_driver(struct mdev_driver *drv); void mdev_unregister_driver(struct mdev_driver *drv);
The mediated bus driver's probe function should create a vfio_device on top of The mediated bus driver's probe function should create a vfio_device on top of
the mdev_device and connect it to an appropriate implementation of the mdev_device and connect it to an appropriate implementation of
...@@ -127,8 +127,8 @@ vfio_device_ops. ...@@ -127,8 +127,8 @@ vfio_device_ops.
When a driver wants to add the GUID creation sysfs to an existing device it has When a driver wants to add the GUID creation sysfs to an existing device it has
probe'd to then it should call:: probe'd to then it should call::
extern int mdev_register_device(struct device *dev, int mdev_register_device(struct device *dev,
struct mdev_driver *mdev_driver); struct mdev_driver *mdev_driver);
This will provide the 'mdev_supported_types/XX/create' files which can then be This will provide the 'mdev_supported_types/XX/create' files which can then be
used to trigger the creation of a mdev_device. The created mdev_device will be used to trigger the creation of a mdev_device. The created mdev_device will be
...@@ -136,7 +136,7 @@ attached to the specified driver. ...@@ -136,7 +136,7 @@ attached to the specified driver.
When the driver needs to remove itself it calls:: When the driver needs to remove itself it calls::
extern void mdev_unregister_device(struct device *dev); void mdev_unregister_device(struct device *dev);
Which will unbind and destroy all the created mdevs and remove the sysfs files. Which will unbind and destroy all the created mdevs and remove the sysfs files.
......
...@@ -41,11 +41,11 @@ struct channel_program { ...@@ -41,11 +41,11 @@ struct channel_program {
struct ccw1 *guest_cp; struct ccw1 *guest_cp;
}; };
extern int cp_init(struct channel_program *cp, union orb *orb); int cp_init(struct channel_program *cp, union orb *orb);
extern void cp_free(struct channel_program *cp); void cp_free(struct channel_program *cp);
extern int cp_prefetch(struct channel_program *cp); int cp_prefetch(struct channel_program *cp);
extern union orb *cp_get_orb(struct channel_program *cp, u32 intparm, u8 lpm); 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); void cp_update_scsw(struct channel_program *cp, union scsw *scsw);
extern bool cp_iova_pinned(struct channel_program *cp, u64 iova); bool cp_iova_pinned(struct channel_program *cp, u64 iova);
#endif #endif
...@@ -119,10 +119,10 @@ struct vfio_ccw_private { ...@@ -119,10 +119,10 @@ struct vfio_ccw_private {
struct work_struct crw_work; struct work_struct crw_work;
} __aligned(8); } __aligned(8);
extern int vfio_ccw_mdev_reg(struct subchannel *sch); int vfio_ccw_mdev_reg(struct subchannel *sch);
extern void vfio_ccw_mdev_unreg(struct subchannel *sch); void vfio_ccw_mdev_unreg(struct subchannel *sch);
extern int vfio_ccw_sch_quiesce(struct subchannel *sch); int vfio_ccw_sch_quiesce(struct subchannel *sch);
extern struct mdev_driver vfio_ccw_mdev_driver; extern struct mdev_driver vfio_ccw_mdev_driver;
......
...@@ -39,7 +39,7 @@ struct vfio_fsl_mc_device { ...@@ -39,7 +39,7 @@ struct vfio_fsl_mc_device {
struct vfio_fsl_mc_irq *mc_irqs; struct vfio_fsl_mc_irq *mc_irqs;
}; };
extern int vfio_fsl_mc_set_irqs_ioctl(struct vfio_fsl_mc_device *vdev, int vfio_fsl_mc_set_irqs_ioctl(struct vfio_fsl_mc_device *vdev,
u32 flags, unsigned int index, u32 flags, unsigned int index,
unsigned int start, unsigned int count, unsigned int start, unsigned int count,
void *data); void *data);
......
...@@ -78,21 +78,20 @@ struct vfio_platform_reset_node { ...@@ -78,21 +78,20 @@ struct vfio_platform_reset_node {
vfio_platform_reset_fn_t of_reset; vfio_platform_reset_fn_t of_reset;
}; };
extern int vfio_platform_probe_common(struct vfio_platform_device *vdev, int vfio_platform_probe_common(struct vfio_platform_device *vdev,
struct device *dev); struct device *dev);
void vfio_platform_remove_common(struct vfio_platform_device *vdev); void vfio_platform_remove_common(struct vfio_platform_device *vdev);
extern int vfio_platform_irq_init(struct vfio_platform_device *vdev); int vfio_platform_irq_init(struct vfio_platform_device *vdev);
extern void vfio_platform_irq_cleanup(struct vfio_platform_device *vdev); void vfio_platform_irq_cleanup(struct vfio_platform_device *vdev);
extern int vfio_platform_set_irqs_ioctl(struct vfio_platform_device *vdev, int vfio_platform_set_irqs_ioctl(struct vfio_platform_device *vdev,
uint32_t flags, unsigned index, uint32_t flags, unsigned index,
unsigned start, unsigned count, unsigned start, unsigned count, void *data);
void *data);
extern void __vfio_platform_register_reset(struct vfio_platform_reset_node *n); void __vfio_platform_register_reset(struct vfio_platform_reset_node *n);
extern void vfio_platform_unregister_reset(const char *compat, void vfio_platform_unregister_reset(const char *compat,
vfio_platform_reset_fn_t fn); vfio_platform_reset_fn_t fn);
#define vfio_platform_register_reset(__compat, __reset) \ #define vfio_platform_register_reset(__compat, __reset) \
static struct vfio_platform_reset_node __reset ## _node = { \ static struct vfio_platform_reset_node __reset ## _node = { \
.owner = THIS_MODULE, \ .owner = THIS_MODULE, \
......
...@@ -140,19 +140,19 @@ int vfio_mig_get_next_state(struct vfio_device *device, ...@@ -140,19 +140,19 @@ int vfio_mig_get_next_state(struct vfio_device *device,
/* /*
* External user API * External user API
*/ */
extern struct iommu_group *vfio_file_iommu_group(struct file *file); struct iommu_group *vfio_file_iommu_group(struct file *file);
extern bool vfio_file_enforced_coherent(struct file *file); bool vfio_file_enforced_coherent(struct file *file);
extern void vfio_file_set_kvm(struct file *file, struct kvm *kvm); void vfio_file_set_kvm(struct file *file, struct kvm *kvm);
extern bool vfio_file_has_dev(struct file *file, struct vfio_device *device); bool vfio_file_has_dev(struct file *file, struct vfio_device *device);
#define VFIO_PIN_PAGES_MAX_ENTRIES (PAGE_SIZE/sizeof(unsigned long)) #define VFIO_PIN_PAGES_MAX_ENTRIES (PAGE_SIZE/sizeof(unsigned long))
extern int vfio_pin_pages(struct vfio_device *device, unsigned long *user_pfn, int vfio_pin_pages(struct vfio_device *device, unsigned long *user_pfn,
int npage, int prot, unsigned long *phys_pfn); int npage, int prot, unsigned long *phys_pfn);
extern int vfio_unpin_pages(struct vfio_device *device, unsigned long *user_pfn, int vfio_unpin_pages(struct vfio_device *device, unsigned long *user_pfn,
int npage); int npage);
extern int vfio_dma_rw(struct vfio_device *device, dma_addr_t user_iova, int vfio_dma_rw(struct vfio_device *device, dma_addr_t user_iova,
void *data, size_t len, bool write); void *data, size_t len, bool write);
/* each type has independent events */ /* each type has independent events */
enum vfio_notify_type { enum vfio_notify_type {
...@@ -162,13 +162,13 @@ enum vfio_notify_type { ...@@ -162,13 +162,13 @@ enum vfio_notify_type {
/* events for VFIO_IOMMU_NOTIFY */ /* events for VFIO_IOMMU_NOTIFY */
#define VFIO_IOMMU_NOTIFY_DMA_UNMAP BIT(0) #define VFIO_IOMMU_NOTIFY_DMA_UNMAP BIT(0)
extern int vfio_register_notifier(struct vfio_device *device, int vfio_register_notifier(struct vfio_device *device,
enum vfio_notify_type type, enum vfio_notify_type type,
unsigned long *required_events, unsigned long *required_events,
struct notifier_block *nb); struct notifier_block *nb);
extern int vfio_unregister_notifier(struct vfio_device *device, int vfio_unregister_notifier(struct vfio_device *device,
enum vfio_notify_type type, enum vfio_notify_type type,
struct notifier_block *nb); struct notifier_block *nb);
/* /*
...@@ -178,25 +178,24 @@ struct vfio_info_cap { ...@@ -178,25 +178,24 @@ struct vfio_info_cap {
struct vfio_info_cap_header *buf; struct vfio_info_cap_header *buf;
size_t size; size_t size;
}; };
extern struct vfio_info_cap_header *vfio_info_cap_add( struct vfio_info_cap_header *vfio_info_cap_add(struct vfio_info_cap *caps,
struct vfio_info_cap *caps, size_t size, u16 id, u16 version); size_t size, u16 id,
extern void vfio_info_cap_shift(struct vfio_info_cap *caps, size_t offset); u16 version);
void vfio_info_cap_shift(struct vfio_info_cap *caps, size_t offset);
extern int vfio_info_add_capability(struct vfio_info_cap *caps, int vfio_info_add_capability(struct vfio_info_cap *caps,
struct vfio_info_cap_header *cap, struct vfio_info_cap_header *cap, size_t size);
size_t size);
extern int vfio_set_irqs_validate_and_prepare(struct vfio_irq_set *hdr, int vfio_set_irqs_validate_and_prepare(struct vfio_irq_set *hdr,
int num_irqs, int max_irq_type, int num_irqs, int max_irq_type,
size_t *data_size); size_t *data_size);
struct pci_dev; struct pci_dev;
#if IS_ENABLED(CONFIG_VFIO_SPAPR_EEH) #if IS_ENABLED(CONFIG_VFIO_SPAPR_EEH)
extern void vfio_spapr_pci_eeh_open(struct pci_dev *pdev); void vfio_spapr_pci_eeh_open(struct pci_dev *pdev);
extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev); void vfio_spapr_pci_eeh_release(struct pci_dev *pdev);
extern long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, unsigned int cmd,
unsigned int cmd, unsigned long arg);
unsigned long arg);
#else #else
static inline void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) static inline void vfio_spapr_pci_eeh_open(struct pci_dev *pdev)
{ {
...@@ -230,10 +229,9 @@ struct virqfd { ...@@ -230,10 +229,9 @@ struct virqfd {
struct virqfd **pvirqfd; struct virqfd **pvirqfd;
}; };
extern int vfio_virqfd_enable(void *opaque, int vfio_virqfd_enable(void *opaque, int (*handler)(void *, void *),
int (*handler)(void *, void *), void (*thread)(void *, void *), void *data,
void (*thread)(void *, void *), struct virqfd **pvirqfd, int fd);
void *data, struct virqfd **pvirqfd, int fd); void vfio_virqfd_disable(struct virqfd **pvirqfd);
extern void vfio_virqfd_disable(struct virqfd **pvirqfd);
#endif /* VFIO_H */ #endif /* VFIO_H */
...@@ -147,23 +147,23 @@ struct vfio_pci_core_device { ...@@ -147,23 +147,23 @@ struct vfio_pci_core_device {
#define is_irq_none(vdev) (!(is_intx(vdev) || is_msi(vdev) || is_msix(vdev))) #define is_irq_none(vdev) (!(is_intx(vdev) || is_msi(vdev) || is_msix(vdev)))
#define irq_is(vdev, type) (vdev->irq_type == type) #define irq_is(vdev, type) (vdev->irq_type == type)
extern void vfio_pci_intx_mask(struct vfio_pci_core_device *vdev); void vfio_pci_intx_mask(struct vfio_pci_core_device *vdev);
extern void vfio_pci_intx_unmask(struct vfio_pci_core_device *vdev); void vfio_pci_intx_unmask(struct vfio_pci_core_device *vdev);
extern int vfio_pci_set_irqs_ioctl(struct vfio_pci_core_device *vdev, int vfio_pci_set_irqs_ioctl(struct vfio_pci_core_device *vdev,
uint32_t flags, unsigned index, uint32_t flags, unsigned index,
unsigned start, unsigned count, void *data); unsigned start, unsigned count, void *data);
extern ssize_t vfio_pci_config_rw(struct vfio_pci_core_device *vdev, ssize_t vfio_pci_config_rw(struct vfio_pci_core_device *vdev,
char __user *buf, size_t count, char __user *buf, size_t count,
loff_t *ppos, bool iswrite); loff_t *ppos, bool iswrite);
extern ssize_t vfio_pci_bar_rw(struct vfio_pci_core_device *vdev, char __user *buf, ssize_t vfio_pci_bar_rw(struct vfio_pci_core_device *vdev, char __user *buf,
size_t count, loff_t *ppos, bool iswrite); size_t count, loff_t *ppos, bool iswrite);
#ifdef CONFIG_VFIO_PCI_VGA #ifdef CONFIG_VFIO_PCI_VGA
extern ssize_t vfio_pci_vga_rw(struct vfio_pci_core_device *vdev, char __user *buf, ssize_t vfio_pci_vga_rw(struct vfio_pci_core_device *vdev, char __user *buf,
size_t count, loff_t *ppos, bool iswrite); size_t count, loff_t *ppos, bool iswrite);
#else #else
static inline ssize_t vfio_pci_vga_rw(struct vfio_pci_core_device *vdev, static inline ssize_t vfio_pci_vga_rw(struct vfio_pci_core_device *vdev,
char __user *buf, size_t count, char __user *buf, size_t count,
...@@ -173,32 +173,31 @@ static inline ssize_t vfio_pci_vga_rw(struct vfio_pci_core_device *vdev, ...@@ -173,32 +173,31 @@ static inline ssize_t vfio_pci_vga_rw(struct vfio_pci_core_device *vdev,
} }
#endif #endif
extern long vfio_pci_ioeventfd(struct vfio_pci_core_device *vdev, loff_t offset, long vfio_pci_ioeventfd(struct vfio_pci_core_device *vdev, loff_t offset,
uint64_t data, int count, int fd); uint64_t data, int count, int fd);
extern int vfio_pci_init_perm_bits(void); int vfio_pci_init_perm_bits(void);
extern void vfio_pci_uninit_perm_bits(void); void vfio_pci_uninit_perm_bits(void);
extern int vfio_config_init(struct vfio_pci_core_device *vdev); int vfio_config_init(struct vfio_pci_core_device *vdev);
extern void vfio_config_free(struct vfio_pci_core_device *vdev); void vfio_config_free(struct vfio_pci_core_device *vdev);
extern int vfio_pci_register_dev_region(struct vfio_pci_core_device *vdev, int vfio_pci_register_dev_region(struct vfio_pci_core_device *vdev,
unsigned int type, unsigned int subtype, unsigned int type, unsigned int subtype,
const struct vfio_pci_regops *ops, const struct vfio_pci_regops *ops,
size_t size, u32 flags, void *data); size_t size, u32 flags, void *data);
extern int vfio_pci_set_power_state(struct vfio_pci_core_device *vdev, int vfio_pci_set_power_state(struct vfio_pci_core_device *vdev,
pci_power_t state); pci_power_t state);
extern bool __vfio_pci_memory_enabled(struct vfio_pci_core_device *vdev); bool __vfio_pci_memory_enabled(struct vfio_pci_core_device *vdev);
extern void vfio_pci_zap_and_down_write_memory_lock(struct vfio_pci_core_device void vfio_pci_zap_and_down_write_memory_lock(struct vfio_pci_core_device *vdev);
*vdev); u16 vfio_pci_memory_lock_and_enable(struct vfio_pci_core_device *vdev);
extern u16 vfio_pci_memory_lock_and_enable(struct vfio_pci_core_device *vdev); void vfio_pci_memory_unlock_and_restore(struct vfio_pci_core_device *vdev,
extern void vfio_pci_memory_unlock_and_restore(struct vfio_pci_core_device *vdev, u16 cmd);
u16 cmd);
#ifdef CONFIG_VFIO_PCI_IGD #ifdef CONFIG_VFIO_PCI_IGD
extern int vfio_pci_igd_init(struct vfio_pci_core_device *vdev); int vfio_pci_igd_init(struct vfio_pci_core_device *vdev);
#else #else
static inline int vfio_pci_igd_init(struct vfio_pci_core_device *vdev) static inline int vfio_pci_igd_init(struct vfio_pci_core_device *vdev)
{ {
...@@ -207,8 +206,8 @@ static inline int vfio_pci_igd_init(struct vfio_pci_core_device *vdev) ...@@ -207,8 +206,8 @@ static inline int vfio_pci_igd_init(struct vfio_pci_core_device *vdev)
#endif #endif
#ifdef CONFIG_S390 #ifdef CONFIG_S390
extern int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev, int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,
struct vfio_info_cap *caps); struct vfio_info_cap *caps);
#else #else
static inline int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev, static inline int vfio_pci_info_zdev_add_caps(struct vfio_pci_core_device *vdev,
struct vfio_info_cap *caps) struct vfio_info_cap *caps)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment