|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 07/11] vpci/header: program p2m with guest BAR view
On 29.09.2021 10:24, Oleksandr Andrushchenko wrote:
>
> On 29.09.21 11:16, Jan Beulich wrote:
>> On 29.09.2021 10:13, Michal Orzel wrote:
>>> On 23.09.2021 14:54, Oleksandr Andrushchenko wrote:
>>>> @@ -149,6 +172,10 @@ bool vpci_process_pending(struct vcpu *v)
>>>> if ( !bar->mem )
>>>> continue;
>>>>
>>>> + data.start_gfn = is_hardware_domain(v->vpci.pdev->domain) ?
>>>> + _gfn(PFN_DOWN(bar->addr)) :
>>>> + _gfn(PFN_DOWN(bar->guest_addr));
>>> I believe this would look better with the following alignment:
>>> data.start_gfn = is_hardware_domain(v->vpci.pdev->domain)
>>> ? _gfn(PFN_DOWN(bar->addr))
>>> : _gfn(PFN_DOWN(bar->guest_addr));
>> FWIW I agree, yet personally I think the conditional operator here
>> even wants to move inside the _gfn(PFN_DOWN()).
>
> I can do it as well:
>
> data.start_gfn = _gfn(PFN_DOWN(is_hardware_domain(v->vpci.pdev->domain) ?
> bar->addr : bar->guest_addr))
> But, help me please breaking it into multiline with 80 chars respected
Besides the option of latching v->vpci.pdev->domain or
is_hardware_domain(v->vpci.pdev->domain) into a helper variable,
data.start_gfn =
_gfn(PFN_DOWN(is_hardware_domain(v->vpci.pdev->domain)
? bar->addr : bar->guest_addr));
or
data.start_gfn =
_gfn(PFN_DOWN(is_hardware_domain(v->vpci.pdev->domain)
? bar->addr
: bar->guest_addr));
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |