|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 08/17] hvmloader: Extend PCI BAR struct
On 5/4/26 17:01, Jan Beulich wrote:
> On 13.03.2026 17:35, Thierry Escande wrote:
>> @@ -176,10 +177,13 @@ void pci_setup(void)
>>
>> /* Create a list of device BARs in descending order of size. */
>> struct bars {
>> - uint32_t is_64bar;
>> uint32_t devfn;
>> uint32_t bar_reg;
>> uint64_t bar_sz;
>> + uint64_t addr_mask; /* which bits of the base address can be
>> written */
>> + uint32_t bar_data; /* initial value - BAR flags here */
>
> Nit: Comment style again (also elsewhere).
>
>> @@ -278,13 +282,21 @@ void pci_setup(void)
>> bar_reg = PCI_ROM_ADDRESS;
>>
>> bar_data = pci_readl(devfn, bar_reg);
>> +
>> + is_mem = !!(((bar_data & PCI_BASE_ADDRESS_SPACE) ==
>> + PCI_BASE_ADDRESS_SPACE_MEMORY) ||
>> + (bar_reg == PCI_ROM_ADDRESS));
>
> Nit: Indentation (pending open parentheses want to be reflected by extra
> indenting blanks). With, as requested by Roger, is_mem switched to bool,
> the !! also can go away, and with it perhaps one pair of parentheses.
>
> (I realize pre-existing code further down has similar issues, yet when
> such code is touched - and even more so when new code is added - this
> wants getting right, to aid readability.)
>
I wanted to keep the changes as small as possible. But it's ok for me to
fix that.
Regards,
--
Thierry Escande | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |