libxl: use COMPARE_PCI() macro is_pci_in_array()...
authorPaul Durrant <pdurrant@amazon.com>
Tue, 8 Dec 2020 19:30:22 +0000 (19:30 +0000)
committerWei Liu <wl@xen.org>
Tue, 15 Dec 2020 16:24:23 +0000 (16:24 +0000)
commit413fd4e4e958081dea06dcad37c1526f7e846732
tree5bfd82a2525cc2b2457a204cc17ccecacd8e9f27
parentc00da823550d0ff63d99b1b48effd6728bee156e
libxl: use COMPARE_PCI() macro is_pci_in_array()...

... rather than an open-coded equivalent.

This patch tidies up the is_pci_in_array() function, making it take a single
'libxl_device_pci' argument rather than separate domain, bus, device and
function arguments. The already-available COMPARE_PCI() macro can then be
used and it is also modified to return 'bool' rather than 'int'.

The patch also modifies libxl_pci_assignable() to use is_pci_in_array() rather
than a separate open-coded equivalent, and also modifies it to return a
'bool' rather than an 'int'.

NOTE: The COMPARE_PCI() macro is also fixed to include the 'domain' in its
      comparison, which should always have been the case.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Acked-by: Wei Liu <wl@xen.org>
tools/libs/light/libxl_internal.h
tools/libs/light/libxl_pci.c