diff options
-rw-r--r-- | drivers/vfio/vfio.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 721f97f8dac1..64833879f75d 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c | |||
@@ -630,8 +630,6 @@ static const char * const vfio_driver_whitelist[] = { "pci-stub" }; | |||
630 | 630 | ||
631 | static bool vfio_dev_whitelisted(struct device *dev, struct device_driver *drv) | 631 | static bool vfio_dev_whitelisted(struct device *dev, struct device_driver *drv) |
632 | { | 632 | { |
633 | int i; | ||
634 | |||
635 | if (dev_is_pci(dev)) { | 633 | if (dev_is_pci(dev)) { |
636 | struct pci_dev *pdev = to_pci_dev(dev); | 634 | struct pci_dev *pdev = to_pci_dev(dev); |
637 | 635 | ||
@@ -639,12 +637,9 @@ static bool vfio_dev_whitelisted(struct device *dev, struct device_driver *drv) | |||
639 | return true; | 637 | return true; |
640 | } | 638 | } |
641 | 639 | ||
642 | for (i = 0; i < ARRAY_SIZE(vfio_driver_whitelist); i++) { | 640 | return match_string(vfio_driver_whitelist, |
643 | if (!strcmp(drv->name, vfio_driver_whitelist[i])) | 641 | ARRAY_SIZE(vfio_driver_whitelist), |
644 | return true; | 642 | drv->name) >= 0; |
645 | } | ||
646 | |||
647 | return false; | ||
648 | } | 643 | } |
649 | 644 | ||
650 | /* | 645 | /* |