[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] pci: fix handling of PCI bridges with subordinate bus number 0xff
- To: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 24 Sep 2021 08:38:16 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=yeXPBeXfD92VrJgIPKVAT3xAa1YNY34ei/eCe2HJlTM=; b=MqwUjqBvY9W8Cmmo5KspKVcAVXy8H9XLAaQT9hU2D2NrS7sE0J96UeRXgeMm0h13dO35x6HiwA9UO8n/hp1AlTrC85Pvj7LgtwIpOiNpvnU5ESXHMWWw6CBtS/gfVQqJBMebrc+eUnyyovJbz63AbZKUdvruKv47TWsYnb+emAVeMwQY3SRBd8mhGnTXxc6l/DJfQdq4qlQFSK0jHMNYr0nwkybbqgfOOTLsz1yucMTUWC+dxsPETw4UfssKEhFvikYqWxaOEp7fHuljZJsmH79YytKC1DNmKX/bo3UkUyWwx7GDSDfjKt544qvH89t/uRSZff+LWFTE2PcErp2Kgw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dzoYykAEq0N2VnSwePffQr3pnaWiSh3sjqS599GtkTk1npASbuCAJC2UhjDNoAk3R543MCrrQjwowd/eJYjVW7payCb8vRv3FjZDCCER+9v2+vsmy4hoUkG4uAtIs6VQbh+s1Yhz99lsHtI3dgQeQkenAok1h9PCX3EAvJWZVSFzolkj+We2/Off9NVZwaa8MPnZIEPbtUlyP4R2n8QkWbFXA1DXktnLfKSx/7E4zuXRJqIDG9AIl78wcd7VUCRVPPqRfBh3HsL7h1q68aUpSyPDpDOL0slWJnGEtVixzP6+yOqkEQS6Krf5qJWP9Rs51FvjOeNWlYSDyd1aTQs26w==
- Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
- Cc: paul@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Fri, 24 Sep 2021 06:38:37 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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
|