Re: [PATCH v3 4/6] hisi-acc-vfio-pci: add new vfio_pci driver for HiSilicon ACC devices

From: Jason Gunthorpe
Date: Wed Sep 15 2021 - 08:51:56 EST


On Wed, Sep 15, 2021 at 10:50:35AM +0100, Shameer Kolothum wrote:
> +static const struct vfio_device_ops hisi_acc_vfio_pci_ops = {
> + .name = "hisi-acc-vfio-pci",
> + .open_device = hisi_acc_vfio_pci_open_device,
> + .close_device = vfio_pci_core_close_device,
> + .ioctl = vfio_pci_core_ioctl,
> + .read = vfio_pci_core_read,
> + .write = vfio_pci_core_write,
> + .mmap = vfio_pci_core_mmap,
> + .request = vfio_pci_core_request,
> + .match = vfio_pci_core_match,
> +};

Avoid horizontal alignments please

> +static void hisi_acc_vfio_pci_remove(struct pci_dev *pdev)
> +{
> + struct vfio_pci_core_device *vdev = dev_get_drvdata(&pdev->dev);
> +
> + vfio_pci_core_unregister_device(vdev);
> + vfio_pci_core_uninit_device(vdev);
> + kfree(vdev);
> +}
> +
> +static const struct pci_device_id hisi_acc_vfio_pci_table[] = {
> + { PCI_DRIVER_OVERRIDE_DEVICE_VFIO(PCI_VENDOR_ID_HUAWEI, SEC_VF_PCI_DEVICE_ID) },
> + { PCI_DRIVER_OVERRIDE_DEVICE_VFIO(PCI_VENDOR_ID_HUAWEI, HPRE_VF_PCI_DEVICE_ID) },
> + { PCI_DRIVER_OVERRIDE_DEVICE_VFIO(PCI_VENDOR_ID_HUAWEI, ZIP_VF_PCI_DEVICE_ID) },
> + { 0, }

Just {}

> +};
> +
> +MODULE_DEVICE_TABLE(pci, hisi_acc_vfio_pci_table);
> +
> +static struct pci_driver hisi_acc_vfio_pci_driver = {
> + .name = "hisi-acc-vfio-pci",

This shoud be KBUILD_MODNAME, the string must always match the module
name

Jason