[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 03/11] vpci/header: Move register assignments from init_bars
- To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 15 Oct 2021 08:04:56 +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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OLRHXPXXr566Gt+/J//2Bwutf5X9i5kKPwveis5k6dQ=; b=MW/1ldwaX9J8Wa3TuRAPLYpYeXPreAcbk0g8HoJCCNLhKc6PY1Uh4Uz+IuM46fDnutXTAygopp1+0mn5tvlQQhVLJZ9SO2pHeYmN68QrfpMtPXdOXRreLlZwba4VWjFOsG7BAwyR35jZ4ZJKjYF/3QyPoJk1ABvGhheUcpL7xH/6U+D36lDb7JjpvP/ybHq/h+Soknfg76jVAHLvHSrfw4PYTsaAY9u+RNDW0yoTFo11V/OQmhK6lVBSDT5y1j86ziJhudhjXXw19I1KqLI7Gpthw9vpHIcKC5oHwvTnZtS+pkIemCGSFc1pyaADL2w3jWpfiYTPzb/hvdwuXL+b/w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jm86GlhG3iHfcYNeIDPek9SyntzxFLe5IMS/NsUOoY09n1VM5yz6b0ArOykCI0DHKB4oPyLyW6tTeMzMO5hN+qKLIeEsZL0uehwb/aoepWs7RWBPv4hX1MKgn5DsMEhwlDpEHJ3Al/Xt6bdHvAAypOrXNa1DvlKxFhfN2B4qzEjWqZprTl2DoWfru7aoguoR/kl2M0A4zImbjl1HD+u0xN0KvNHWr0+8zl2Z1GDrJfw+C7qhsj886D5bsbfG3414r3rk153YyiPLX/7UjdFVW8cq2VMMxraswqV5QifdiJOoRMVAOviSYkzbGXucNk3AdbZPfHHoR6+XkVnHDUmeKQ==
- Authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=suse.com;
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, julien@xxxxxxx, sstabellini@xxxxxxxxxx, oleksandr_tyshchenko@xxxxxxxx, volodymyr_babchuk@xxxxxxxx, Artem_Mygaiev@xxxxxxxx, bertrand.marquis@xxxxxxx, rahul.singh@xxxxxxx, Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>, Oleksandr Andrushchenko <andr2000@xxxxxxxxx>
- Delivery-date: Fri, 15 Oct 2021 06:05:10 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 13.10.2021 15:51, Roger Pau Monné wrote:
> On Thu, Sep 30, 2021 at 10:52:15AM +0300, Oleksandr Andrushchenko wrote:
>> --- a/xen/drivers/vpci/header.c
>> +++ b/xen/drivers/vpci/header.c
>> @@ -445,6 +445,55 @@ static void rom_write(const struct pci_dev *pdev,
>> unsigned int reg,
>> rom->addr = val & PCI_ROM_ADDRESS_MASK;
>> }
>>
>> +static int add_bar_handlers(const struct pci_dev *pdev)
>
> Making this const is again misleading IMO, as you end up modifying
> fields inside the pdev, you get away with it because vpci data is
> stored in a pointer.
I think it was me who asked for const to be added in places like this
one. vpci data hanging off of struct pci_dev is an implementation
artifact imo, not an unavoidable connection. In principle the vpci
data corresponding to a physical device could also be looked up using
e.g. SBDF.
Here the intention really is to leave the physical device unchanged;
that's what the const documents (apart from enforcing).
Jan
|