qemu/include/hw/pci
Roque Arcudia Hernandez 26f2660bf7 hw/pci: Add parenthesis to PCI_BUILD_BDF macro
The bus parameter in the macro PCI_BUILD_BDF is not surrounded by
parenthesis. This can create a compile error when warnings are
treated as errors or can potentially create runtime errors due to the
operator precedence.

For instance:

 file.c32: error: suggest parentheses around '-' inside '<<'
 [-Werror=parentheses]
   171 | uint16_t bdf = PCI_BUILD_BDF(a - b, sdev->devfn);
       |                              ~~^~~
 include/hw/pci/pci.h:19:41: note: in definition of macro
 'PCI_BUILD_BDF'
    19 | #define PCI_BUILD_BDF(bus, devfn)     ((bus << 8) | (devfn))
       |                                         ^~~
 cc1: all warnings being treated as errors

Signed-off-by: Roque Arcudia Hernandez <roqueh@google.com>
Reviewed-by: Nabih Estefan <nabihestefan@google.com>
Message-Id: <20241101215923.3399311-1-roqueh@google.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2024-11-04 16:03:25 -05:00
..
msi.h hw/xen: Support MSI mapping to PIRQ 2023-03-01 09:09:22 +00:00
msix.h msix: Assert that specified vector is in range 2022-11-07 14:08:17 -05:00
pci_bridge.h virtio-pci: fix memory_region_find for VirtIOPCIRegion's MR 2024-11-04 16:03:24 -05:00
pci_bus.h hw/pci: modify pci_setup_iommu() to set PCIIOMMUOps 2023-11-03 09:20:31 +01:00
pci_device.h softmmu: Expand comments describing max_bounce_buffer_size 2024-11-04 09:22:58 -05:00
pci_host.h hw/pci/pci_host: Introduce PCI_HOST_BYPASS_IOMMU macro 2023-07-10 16:29:17 -04:00
pci_ids.h pci_ids/tulip: Add PCI vendor ID for HP and use it in tulip 2023-10-17 23:13:19 +02:00
pci_regs.h pcie: Add 1.2 version token for the Power Management Capability 2022-03-06 05:08:23 -05:00
pci.h hw/pci: Add parenthesis to PCI_BUILD_BDF macro 2024-11-04 16:03:25 -05:00
pcie_aer.h pci: remove some types from typedefs.h 2024-05-03 15:47:48 +02:00
pcie_doe.h hw/nvme: Add SPDM over DOE support 2024-07-22 20:15:42 -04:00
pcie_host.h include/hw/pci/pcie_host: Correct PCIE_MMCFG_SIZE_MAX 2022-05-16 16:15:40 -04:00
pcie_port.h hw/pci: Remove unused pcie_chassis_find_slot 2024-10-03 17:26:06 +03:00
pcie_regs.h pcie: Support PCIe Gen5/Gen6 link speeds 2024-03-12 17:56:55 -04:00
pcie_sriov.h Revert "pcie_sriov: Ensure VF function number does not overflow" 2024-08-01 04:32:00 -04:00
pcie.h hw/pcie: Provide a utility function for control of EP / SW USP link 2024-11-04 16:03:24 -05:00
shpc.h hw/pci: Constify VMState 2023-12-30 07:38:06 +11:00
slotid_cap.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00