On 24.09.2021 03:06, Igor Druzhinin wrote:
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -364,7 +364,7 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
> switch ( pdev->type = pdev_type(pseg->nr, bus, devfn) )
> {
> u16 cap;
> - u8 sec_bus, sub_bus;
> + u16 sec_bus, sub_bus;
>
> case DEV_TYPE_PCIe2PCI_BRIDGE:
> case DEV_TYPE_LEGACY_PCI_BRIDGE:
First of all you want to also address the same issue in free_pdev()
then. Further, since we're switching away from u16, uint16_t would
be the legitimate replacement. Plus, since cap is then of the same
type, fold all three variable declarations into a single line.
Finally, as per ./CODING_STYLE, fixed width types should be used
only where strictly needed. I can't see a reason for any of these
to be other than "unsigned int".
Jan