VFIO updates for v6.12

- Remove several unused structure and function declarations, and unused
    variables. (Dr. David Alan Gilbert, Yue Haibing, Zhang Zekun)
 
  - Constify unmodified structure in mdev. (Hongbo Li)
 
  - Convert to unsigned type to catch overflow with less fanfare than
    passing a negative value to kcalloc(). (Dan Carpenter)
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEQvbATlQL0amee4qQI5ubbjuwiyIFAmbtRIobHGFsZXgud2ls
 bGlhbXNvbkByZWRoYXQuY29tAAoJECObm247sIsiN/UP/R9Xd1bg1dwGDuw8LDV8
 obA4SSr6uWpFk588llsiXxBtkh945tRnCOpE3A3DFb0cr5aYWkKrrEg2KtAxEbzP
 ZmYCgn6nJoO3a0x4lGYCGWagjr6OhG/QtDE7SberBPeieO7kCIGxCwGH/8+k5mDm
 PCTtXHP9/iD4XgNZylFrpabBYmHgAHqWTsTXzQkQKKfMUUM67Uvv3wPxDnpAe9mF
 J0SKn0/lfR6KrigZbpNzleGVR0UPvKmTKFa43XkVcRVKRHcWAl5p/JSc7XA1Ej3w
 jWCgA0jsQ+oP3zov3R9NbYZQOqejUSwEttsReMMMoHQjVb6Wh4FvTskQgcLvmqlw
 MERoORJFfGM9QGp4KfAXLwRa0E7gN2K9zXEupRVPt7wtA9tzJmFoaOf+6Lz5sc6E
 NM6+TlKdXEHs9lvXlenRzdVj0td132IkX4PbVRTJTwIUWfjUI8Z7B+jRCQ0lSqtv
 WmT/5HRaOgdgQrnXAWDi8PVWtrZVGkhGzwfL3kBAHvYcSkA9tMesCwvQs//WfRz/
 nMxEucTFPzAYFpEA1kWubMPkxUwt3gmEn6b2F2vNGNe3lyRSE31gpx+4URtrpxf5
 Or7pDNL1Gwvf7MiwnfqotenpfskKEFhj3AsrNoaZqeqFdk8BN2aOLmN8snatrqVY
 Dut2CyI9JFzsdiS0tbGDoXS8
 =yEQw
 -----END PGP SIGNATURE-----

Merge tag 'vfio-v6.12-rc1' of https://github.com/awilliam/linux-vfio

Pull VFIO updates from Alex Williamson:
 "Just a few cleanups this cycle:

   - Remove several unused structure and function declarations, and
     unused variables (Dr. David Alan Gilbert, Yue Haibing, Zhang Zekun)

   - Constify unmodified structure in mdev (Hongbo Li)

   - Convert to unsigned type to catch overflow with less fanfare than
     passing a negative value to kcalloc() (Dan Carpenter)"

* tag 'vfio-v6.12-rc1' of https://github.com/awilliam/linux-vfio:
  vfio/pci: clean up a type in vfio_pci_ioctl_pci_hot_reset_groups()
  vfio/mdev: Constify struct kobj_type
  vfio: mdev: Remove unused function declarations
  vfio/fsl-mc: Remove unused variable 'hwirq'
  vfio/pci: Remove unused struct 'vfio_pci_mmap_vma'
This commit is contained in:
Linus Torvalds 2024-09-24 12:07:47 -07:00
commit 7bc21c5e1f
4 changed files with 3 additions and 13 deletions

View file

@ -108,10 +108,10 @@ static int vfio_fsl_mc_set_irq_trigger(struct vfio_fsl_mc_device *vdev,
void *data)
{
struct fsl_mc_device *mc_dev = vdev->mc_dev;
int ret, hwirq;
struct vfio_fsl_mc_irq *irq;
struct device *cont_dev = fsl_mc_cont_dev(&mc_dev->dev);
struct fsl_mc_device *mc_cont = to_fsl_mc_device(cont_dev);
int ret;
if (!count && (flags & VFIO_IRQ_SET_DATA_NONE))
return vfio_set_trigger(vdev, index, -1);
@ -136,8 +136,6 @@ static int vfio_fsl_mc_set_irq_trigger(struct vfio_fsl_mc_device *vdev,
return vfio_set_trigger(vdev, index, fd);
}
hwirq = vdev->mc_dev->irqs[index]->virq;
irq = &vdev->mc_irqs[index];
if (flags & VFIO_IRQ_SET_DATA_NONE) {

View file

@ -10,9 +10,6 @@
#ifndef MDEV_PRIVATE_H
#define MDEV_PRIVATE_H
int mdev_bus_register(void);
void mdev_bus_unregister(void);
extern const struct bus_type mdev_bus_type;
extern const struct attribute_group *mdev_device_groups[];

View file

@ -160,7 +160,7 @@ static void mdev_type_release(struct kobject *kobj)
put_device(type->parent->dev);
}
static struct kobj_type mdev_type_ktype = {
static const struct kobj_type mdev_type_ktype = {
.sysfs_ops = &mdev_type_sysfs_ops,
.release = mdev_type_release,
.default_groups = mdev_type_groups,

View file

@ -58,11 +58,6 @@ struct vfio_pci_vf_token {
int users;
};
struct vfio_pci_mmap_vma {
struct vm_area_struct *vma;
struct list_head vma_next;
};
static inline bool vfio_vga_disabled(void)
{
#ifdef CONFIG_VFIO_PCI_VGA
@ -1329,7 +1324,7 @@ static int vfio_pci_ioctl_get_pci_hot_reset_info(
static int
vfio_pci_ioctl_pci_hot_reset_groups(struct vfio_pci_core_device *vdev,
int array_count, bool slot,
u32 array_count, bool slot,
struct vfio_pci_hot_reset __user *arg)
{
int32_t *group_fds;